Junod Local Dev Setup
Want to use
junodlocally for development, or to work with smart contracts? You're in the right place. Running locally is a much easier solution than interacting with a testnet.
This guide focusses on running the chain. If you want to build the binary or develop in go, then check out:
Juno ships with an unsafe seed user in dev mode when you run the prebuilt docker container below, or one of the options that uses
docker-compose. You can import this user into the CLI by using the mnemonic from the Juno repo, i.e.:
junod keys add <unsafe-test-key-name> --recover
When prompted, add the mnemonic:
clip hire initial neck maid actor venue client foam budget lock catalog sweet steak waste crater broccoli pipe steak sister coyote moment obvious choose
You will then be returned an address to use:
There is a prebuilt docker image for you to use. This will start a container with a seeded user. The address and mnemonic used here can be found in the
docker/directory of the repo. When you're done, you can use
ctrl+cto stop the container running.
Always pick a tagged version to run, ideally one that matches mainnet. The example below may be outdated as Juno releases frequently - you should check the Juno GitHub repository to see which is current for you.
docker run -it \
--name juno_node_1 \
-p 1317:1317 \
-p 26656:26656 \
-p 26657:26657 \
-e STAKE_TOKEN=ujunox \
-e UNSAFE_CORS=true \
The quickest way to get up-and-running for development purposes, as is documented in the main repo, is to run:
STAKE_TOKEN=ujunox UNSAFE_CORS=true docker-compose up
This builds and runs the node and:
- Creates and initialises a validator
- Adds a default user with a known address (
To use a specific version of Juno, check out a tag before running docker compose.
To call Juno inside a container, use
docker execlike so:
# compile wasm - run this in your smart contract folder
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 \
# copy wasm to container
docker cp artifacts/your_compiled.wasm juno_node_1:/your_compiled.wasm
# store wasm
docker exec -i juno_node_1 \
junod tx wasm store "/your_compiled.wasm" \
--gas-prices 0.1ujunox --gas auto --gas-adjustment 1.3 \
-y -b block --chain-id testing \
--from validator --output json
If you don't want to go through the process of setting up a node and just want to experiment with the Juno uni testnet:
- 1.Get a public node's RPC address. These can be found pinned in Discord in the dev channel.
node="<public node RPC address>"and
- 3.Create a key to use by running
junod keys add <key-name>.
- 4.Get that key's public address by running
junod keys show <key-name> -a.
- 5.Get some test Juno by sending
$request <key-address>in the #faucet Discord channel.
You can then verify that you have funds by running
junod query bank balances <key-address>. Happy hacking!
For a video that guides you through the above steps, some Juno contributors made a series called CosmWasm By Dummies that guides you through writing your first contract after setting up Juno: