Simple Minitia Setup

Minita is a lightweight, open-sourced, and easy-to-use blockchain client. This document provides instructions for installing Minita on your local machine.

Prerequisites

Step 1. Download Pre-built Binary

You can setup Minitia chain using minitiad.

git clone https://github.com/initia-labs/minitia.git

You can choose to use MoveVM or WasmVM by using minimove or miniwasm respectively.

cd minimove
git pull origin main
make install

To confirm the successful installation of Minitia, use the following command:

minitiad version

Step 2. Configuration

Initiate your chain

Initialize the node with a human-readable name or moniker.

You can configure a custom token denom as a fee token on a Minitia, but if a custom token is not specified, the default value umin will be used as the fee token denom.

export L1_CHAIN_ID=mahalo-1
export L2_CHAIN_ID=minitia-$RANDOM
export DENOM=unova
export OPERATOR=operator
export BRIDGE_EXECUTOR=bridge-executor
export RELAYER=relayer

# minitiad init --chain-id=<chain-id> --denom <denom> <moniker>
minitiad init --chain-id=$L2_CHAIN_ID --denom $DENOM $OPERATOR

Generate operation keys

If you don't have a key, use the following command to generate a new key.

# minitiad keys add <key-name>
minitiad keys add $OPERATOR
minitiad keys add $BRIDGE_EXECUTOR
minitiad keys add $RELAYER

Add genesis validator

You can add genesis validator with following command.

# minitiad genesis add-genesis-validator <key-name>
minitiad genesis add-genesis-validator $OPERATOR

Update bridge executor

Bridge executor is a address which has permission to relay the op bridge packet between L1<>L2. Please refer OPinit Stack for details.

Bridge executor's address is set to the account address of the validatory key that is used to do Add genesis validator. The below command can be used to use a different account address as a bridge executor.

# fill [bridge-executor] to your address
sed -i -e \
    "s/\"bridge_executor\": \"[a-zA-Z0-9]*\",$/\"bridge_executor\": \"$(minitiad keys show $BRIDGE_EXECUTOR -a)\",/g" \
    ~/.minitia/config/genesis.json

Add genesis account

# minitiad genesis add-genesis-account <address> <amount>
minitiad genesis add-genesis-account $(minitiad keys show $OPERATOR -a) 1000000000000000$DENOM
minitiad genesis add-genesis-account $(minitiad keys show $BRIDGE_EXECUTOR -a) 1000000000000000$DENOM
minitiad genesis add-genesis-account $(minitiad keys show $RELAYER -a) 1000000000000000$DENOM

Step 3. Start Minitia

Start minitia node.

minitiad start

For detail configuration and usage, check nodes. You will get useful links as follows:

(Optional) Change min-gas-prices

To prevent spam and ensure network stability, a operator need to set a min-gas-prices which the validators will accept to validate transactions in Minitia nodes.

  1. Change min-gas-prices in genesis.json

    • By default, min-gas-prices is set to 0, and can be changed on genesis.json before the node starts running.

sed -i \
    -e "/\"min_gas_prices\": \[\]/s//\"min_gas_prices\": [{\"amount\": \"0.15\", \"denom\": \"$DENOM\"}]/" \
    ~/.minitia/config/genesis.json
  1. Update min-gas-prices

    • MsgUpdateParams message can be used to update min-gas-prices after the node starts running. With this message, gas fee token denom can be changed to a desired denom.

echo "{
	\"messages\": [
		{
			\"@type\":\"/opinit.opchild.v1.MsgUpdateParams\",
			\"authority\": \"init1gz9n8jnu9fgqw7vem9ud67gqjk5q4m2w0aejne\",
			\"params\": {
				\"max_validators\": 100,
				\"historical_entries\": 10000,
				\"min_gas_prices\": [{\"amount\": \"0.15\", \"denom\": \"$DENOM\"}],
				\"bridge_executor\": \"$(minitiad keys show $BRIDGE_EXECUTOR -a)\"
			}
		}
	]
}" > messages.json

# minitiad tx opchild execute-messages <message-file> --from <validator> --chain-id <chain-id> --gas-prices <gas-prices> --gas auto
minitiad tx opchild execute-messages \
  ./messages.json \
  --from $OPERATOR \
  --chain-id $L2_CHAIN_ID \
  --gas-prices 0.15$DENOM \
  --gas auto --gas-adjustment 1.4

(Optional) Start the Light Client Daemon (LCD)

To enable the REST API and LCD, enable api configuration in app.toml. Also, to enable Swagger, change swagger = false to swagger = true. Note that app.toml file can be found in $HOME/.minitia/config by default.

[api]

# Enable defines if the API server should be enabled.
enable = true

# Swagger defines if swagger documentation should automatically be registered.
swagger = true

Last updated