- Developing how to run tests and develop code. Or go through the online tutorial to get a better feel of how to develop.
- Publishing contains useful information on how to publish your contract to the world, once you are ready to deploy it on a running blockchain.
# Install just
cargo install just
# For building + fmt
just build
# For testing everything
just test
# For schemas
just schema
# Production compilation, run before deploying to live network
docker run --rm -v "$(pwd)":/code \
--mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
cosmwasm/rust-optimizer:0.12.7There are some scripts for testnet, mainnet and local node To build and deploy to testnet:
just deploySave the address of the created contract:
CRONCAT_ADDRESS=juno123somecontractYou can create a reccuring task and see it in the list of tasks:
./create_recurring_task.sh $CRONCAT_ADDRESS user
./get-tasks.sh $CRONCAT_ADDRESSFor more examples for registering and unregistering agent, executing task and querying the state see other scripts.
If you want to run croncat manager locally, see instructions for local setup.
git clone git@github.com:CronCats/croncat-rs.git
cd croncat-rsBefore registering an agent modify config.uni-5.yaml to include CRONCAT_ADDRESS in contract_address field.
Create and store new agent address
cargo run -- --chain-id uni-5 generate-mnemonic --new-name new-agent
AGENT_ADDR=juno123agentaddressRefill new-agent balance before using it, so that the agent has some ujunox for register-agent and proxy-calls.
Register an agent:
cargo run -- --chain-id uni-5 register-agent --sender-name new-agent payable-account-idHere payable-account-id is optional address of the account that receives agent reward.
Start daemon:
cargo run -- --chain-id uni-5 daemon --sender-name new-agentUnregister the agent:
cargo run -- --chain-id uni-5 unregister-agent --sender-name new-agentDefault
new-nameandsender-nameisagent.
For other commands see
cargo run -- helpSchema Update
just buildInstall yarn packages
yarn --cwd ./typescript install --frozen-lockfileGenerate TypeScript files
yarn --cwd ./typescript codegen