📳Deploying an application

Learn how to build applications on Coreum and deploy smart contracts into your custom networks.

Build a sample application

You can follow the tutorial here to develop a sample application.

To connect the sample application to your own network, you need to configure the variables located in the .env.development file.

PORT=3000
NEXT_PUBLIC_CHAIN_ID=coreum-devnet-1
NEXT_PUBLIC_CHAIN_NAME=Example network
NEXT_PUBLIC_CHAIN_BECH32_PREFIX=devcore
NEXT_PUBLIC_CHAIN_RPC_ENDPOINT=https://example-network-node-1-8c43d4c6-1d14-4736.lzeroanalytics.com/rpc/
NEXT_PUBLIC_CHAIN_REST_ENDPOINT=https://example-network-node-1-8c43d4c6-1d14-4736.lzeroanalytics.com/api/
NEXT_PUBLIC_CHAIN_EXPLORER=https://example-network-block-explorer-8c43d4c6-1d14-4736.lzeroanalytics.com/
NEXT_PUBLIC_STAKING_DENOM=udevcore
NEXT_PUBLIC_CHAIN_COIN_TYPE=990
NEXT_PUBLIC_SITE_TITLE=Example network sample
NEXT_PUBLIC_SITE_ICON_URL="/coreum.svg"
NEXT_PUBLIC_GAS_PRICE=0.0625udevcore

Please fill in the RPC and REST point with the corresponding URLs of one of your nodes. Additionally, add the URL of the block explorer. Optionally, set the CHAIN_NAME and PUBLIC_SITE_TITLE to more meaningful values.

Some parameters depend on the configuration of your network. If your Chain ID is coreum-devnet-1, all parameters above can stay the same unless you changed the minimum gas price of your network which should then be set with the GAS_PRICE parameter. If your Chain ID is coreum-testnet-1, every dev should be replaced with test in the above configuration. This means BECH32_PREFIX changes from devcore to testcore and GAS_PRICE changes from 0.0625udevcore to 0.0625utestcore.

Deploy a smart contract

In order to deploy smart contracts into your networks, you need to use the RPC endpoint of one of your nodes.

First, export the following environment values globally in your terminal:

export COREUM_CHAIN_ID="coreum-devnet-1"
export COREUM_DENOM="udevcore"
export COREUM_NODE="https://example-network-node-1-8c43d4c6-1d14-4736.lzeroanalytics.com/rpc"
export COREUM_VERSION="v4.0.1"

export COREUM_CHAIN_ID_ARGS="--chain-id=$COREUM_CHAIN_ID"
export COREUM_NODE_ARGS="--node=$COREUM_NODE"

export COREUM_HOME=$HOME/.core/"$COREUM_CHAIN_ID"

export COREUM_BINARY_NAME=$(arch | sed s/aarch64/cored-linux-arm64/ | sed s/x86_64/cored-linux-amd64/)

Follow this tutorial in the Coreum docs to deploy a sample smart contract into the network.

Ensure, that you use the correct RPC endpoint and set the Chain ID according to your network. If your Chain ID is coreum-devnet-1, the denom is udevcore. If your Chain ID is coreum-testnet-1, your denom should be set to utestcore.

Last updated