Interfaces (Smithy)
At its core, wasmCloud is a messaging system, and a scalable messaging system needs well-defined API contracts.
Every capability provider has a capability contract - an interface definition - that defines a service and a set of operations it supports. Even actor-to-actor messages, which don't use capability contracts, benefit by well-defined API contracts. In wasmCloud, we define these API contracts in Smithy files.
In this section, you will find documentation on how to define interfaces using smithy IDL files, and use code generation to create libraries from those definitions.
- Tutorial on creating a new interface project
- The wasmCloud-smithy guide: how wasmCloud uses smithy models, with examples
- Configuring the code generator with
codegen.toml
files - How Code generation works, with pointers for customizing it or writing your own code generator
- Tips for building and debugging smithy models
- Publishing Rust interface libraries to crates.io
For more information about Smithy in general, you can check out the resources below.
Additional Smithy references and tools
If you'd like to learn more about Smithy in general, try some of these resources:
- Smithy home page
- IDL spec v1.0
- ABNF grammar (if you want to write your own parser)
- JSON AST - the handlebars-based code generators use this
- Specifications
- Visual Studio plugin (in the extension marketplace)
- Rust-atelier
- SDKs