Setting up Environment

You need an environment to run contracts. You can either run your node locally or connect to an existing network.

For easy testing, the MANTRA Hongbai Chain (Testnet) is live. You can use Hongbai to deploy and run your contracts.

To verify that the network is currently active, make sure the following URLs are working for you:

The network has one native token set up - OM (uom) for becoming a validator and for paying fees.

The official MANTRA Hongbai Chain (Testnet) Block Explorer is at:

You can use the block explorer to explore transactions, addresses, validators and contracts.

When interacting with Hongbai, you can either use wasmd which is a Go client, or the Node REPL. The Node REPL is recommended for contract operations, since JSON manipulation is not intuitive with the Shell/Go client.

Setting up environment variables

Let's configure the mantrachaind executable, point it to the Hongbai network, create a wallet and ask for tokens from faucet:

First, create a file called mantrachaind-cli.env :

export CHAIN_ID="mantra-hongbai-1"
export TESTNET_NAME="mantra-hongbai"
export FEE_DENOM="uom"
export STAKE_DENOM="uom"
export BECH32_HRP="wasm"
export WASMD_VERSION="v0.27.0"
export CONFIG_DIR=".mantrachaind"
export BINARY="mantrachaind"

export COSMJS_VERSION="v0.28.1"
export GENESIS_URL="https://<location-to-be-provided>/config/genesis.json"

export RPC="https://rpc.hongbai.mantrachain.io:443"
export FAUCET="https://faucet.hongbai.mantrachain.io"

export NODE=(--node $RPC)
export TXFLAG=($NODE --chain-id $CHAIN_ID --gas-prices 0.25uom --gas auto --gas-adjustment 1.3)

Save the above and then source the above to set the environment variables.

source mantrachaind-cli.env

We'll use these environment variables later.

Setup wallet addresses

Set up wallets with addresses for storing tokens.

# add wallets for testing
mantrachaind keys add wallet
mantrachaind keys add wallet2

Running the command above will add two encrypted private keys to the mantrachaind keyring and display their attributes as follows:

- address: mantra188xl62zf0hdscf47zyf6ajz9x4ym0v90h9whrx
  name: wallet
  pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AiFGNfxnlXj0Uos/3G918Pdzsq4CBg1c0RXrxRh8lCyM"}'
  type: local


**Important** write this mnemonic phrase in a safe place.
It is the only way to recover your account if you ever forget your password.

truth quarter rack west trouble suffer grief path patch come mushroom more improve gallery moral recipe error abandon modify drop vague holiday upset open

Request tokens

You will need some amount of tokens stored in your wallet address in order to interact with the network.

To obtain tokens, visit https://faucet.hongbai.mantrachain.io and input the relevant wallet addresses.

The faucet will issue tokens to one wallet address only once within a single 24 hour period, and only once for any wallet address from the one IP address within a single 24 hour period.

This is to limit the faucet from being drained of tokens and to maintain the integrity of the Network.

Last updated