You need an environment to run contracts. You can either run your node locally or connect to an existing network. For easy testing, oysternet network is online, you can use it to deploy and run your contracts. If you want to setup and run against a local blockchain, click here
To verify testnet is currently running, make sure the following URLs are all working for you:
We have set up two native tokens -
ustar) for becoming a validator and
- Block Explorer: https://block-explorer.oysternet.cosmwasm.com
You can use these to explore txs, addresses, validators and contracts feel free to deploy one pointing to our rpc/lcd servers and we will list it.
When interacting with network, you can either use
wasmd which is a Go client or Node REPL. Altough Node REPL is
recommended for contract operations, since JSON manipulation is not intuitive with the Shell/Go client.
wasmd exec, point it to testnets, create wallet and ask tokens from faucet:
First source the oysternet network configurations to the shell:
Setup the client:
You need some tokens in your address to interact. If you are using local node you can skip this step. Requesting tokens from faucet:
If you intend to use wasmd as client, we recommend you to setup these variables. Otherwise You will have to define type in node, chain id and gas-prices details with every command you execute. Also for this tutorial we will use these variables. So make sure you export these before proceeding.
If command above throws error, this means your shell is different. If no errors, try running this:
If no errors we are all good. Otherwise, set variables with the command below:
Beyond the standard CLI tooling, we have also produced a flexible TypeScript library
CosmJS, which runs in Node.js as well as in modern browsers
and handles queries and submitting transactions. Along with this library, we produced
@cosmjs/cli, which is a super-charged Node console. It
await, does type checking for helpful error messages, and preloads many CosmJS utilities.
If you are comfortable with the Node console, you will probably find this easier and more powerful
than the CLI tooling.
Using the REPL:
If you are interested in running your local network you can use the script below: