Code Monkey home page Code Monkey logo

cw-croncat's Introduction

Cron.cat CW Contracts

The "crontracts" for cosmwasm runtime of croncat service

codecov

ALPHA:

This repo is in early develop stage - use at your own risk!

Contributing

  • 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.

Commands

# 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

Testnet examples

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.

Agent

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-calls.

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 and sender-name is agent.

For other commands see

cargo run -- help

Changelog

0.0.1

Schema Update

just build

Install yarn packages

yarn --cwd ./typescript install --frozen-lockfile

Generate TypeScript files

yarn --cwd ./typescript codegen

cw-croncat's People

Contributors

d3v3us avatar buckram123 avatar nlipartiia-hacken avatar trevorjtclarke avatar mikedotexe avatar seedyrom avatar dependabot[bot] avatar grapestems avatar nino1415 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.