This tutorial will guide you through creating a
interface for your contracts. By the end of this tutorial you should be able to:
- Write deployment scripts for your contract.
- Write integration tests for your contract.
- Write executables for interacting with your contract.
In order to ensure that the code snippets shown here are correct we’ll be using the counter contract provided in the
cw-orch Github repository as the source for our code-snippets. You can find the contract here.
Contract Entry Point Messages: In order to use cw-orchestrator you need access to the entry point message types (
ExecuteMsg,…) of the contracts you want to interact with. Having them locally will enable you to generate helper functions for interacting with the contracts.
A gRPC endpoint (optional): If you want to perform on-chain transaction you will need access to the gRPC endpoint of a node. These are most-often available on port 9090. We provide chain definitions and constants for some of the more widely used Cosmos Chains. Learn more about this on the Daemon page.
A desire to learn (mandatory): This tutorial will cover the basics of using cw-orchestrator but it won’t cover everything. If you want to learn more about the features of cw-orchestrator you can check out the API Documentation.
Before being able to interact easily with your contracts, you need to add a few dependencies and files to your contract. Check out our dedicated setup tutorial for preparing the work !
The following sections detail setting up a contract, tests for the contract, and scripts for interacting with the contract on a blockchain network.
- Define interfaces for your contracts.
- Entry Point Functions
- Simplify your syntax and call your contract endpoints (query and execution) as individual functions
- Environment File
- Configure your mnemonics, log settings and more.
- Write runnable scripts with your interfaces.
- Integration Tests
- Write an integration test for your contract.