- 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.7
There are some scripts for testnet, mainnet and local node To build and deploy to testnet:
just deploy
Save the address of the created contract:
CRONCAT_ADDRESS=juno123somecontract
You can create a reccuring task and see it in the list of tasks:
./create_recurring_task.sh $CRONCAT_ADDRESS user
./get-tasks.sh $CRONCAT_ADDRESS
For 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 [email protected]:CronCats/croncat-rs.git
cd croncat-rs
Before 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=juno123agentaddress
Refill new-agent
balance before using it, so that the agent has some ujunox for register-agent
and proxy-call
s.
Register an agent:
cargo run -- --chain-id uni-5 register-agent --sender-name new-agent payable-account-id
Here 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-agent
Unregister the agent:
cargo run -- --chain-id uni-5 unregister-agent --sender-name new-agent
Default
new-name
andsender-name
isagent
.
For other commands see
cargo run -- help
Schema Update
just build
Install yarn packages
yarn --cwd ./typescript install --frozen-lockfile
Generate TypeScript files
yarn --cwd ./typescript codegen