Initia (Closed Testnet)
  • Reminder
    • ⛔Confidentiality Disclaimer
  • WELCOME TO CLOSED TESTNET
    • Welcome to Closed Testnet
  • About Initia
    • What is the Initia Platform?
      • Architecture
        • Layer 1
        • Layer 2
      • Aligning Initia (coming soon!)
    • InitiaDEX
    • Enshrined Liquidity and Staking
  • Developers
    • Initiad
      • Download Initiad
      • Using Initiad
    • Get INIT token
    • Build your own Minitia
      • Simple Minitia Setup
      • Connect Minitia to L1
        • OPinit Stack
          • OPinit Module
          • OPinit Bots
        • Relayer
          • Fetching Oracle Prices
    • Virtual Machines
      • MoveVM
        • Interact with CLI
      • WasmVM
    • Contracts
      • Move Contracts
      • CosmWasm Contracts
      • EVM Contracts (Coming Soon)
    • Oracles
  • Initia Developer Tutorials
    • 1. Create account
    • 2. Send Move coin
    • 3. Interchain Message
    • 4. Create your own Move coin
    • 5. Create your own Move NFT
    • 6. Build and Publish Contracts
      • Move Module
      • CosmWasm Contract
  • Core Applications
    • Core Applications
      • Wallet
      • Initia App
      • Usernames
      • Initia Scan
  • Node Operators
    • Running Initia Node
      • Prerequisites
      • Oracle
      • Boot an Initia Node
      • Connect to Initia Network
      • Cosmovisor Guide
    • Configuring Initia Validator
  • References and Tools
    • Move Language
    • Rust Language (CosmWasm)
    • Closed Testnet Chain Information
    • Chain Parameters
    • Initia.js
    • API Docs
    • API Docs (minimove)
    • API Docs (miniwasm)
    • Whitelisted Tokens and Pairs
Powered by GitBook
On this page
  • Prerequisites
  • Step 1. Download Pre-built Binary
  • Step 2. Configuration
  • Step 3. Start Minitia
  • (Optional) Change min-gas-prices
  • (Optional) Start the Light Client Daemon (LCD)
  1. Developers
  2. Build your own Minitia

Simple Minitia Setup

PreviousBuild your own MinitiaNextConnect Minitia to L1

Last updated 1 year ago

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

CHAIN ID

A chain ID is a unique identifier that represents a blockchain network. The format should be an alphanumeric string between 3 to 50 characters long ( ^[-a-zA-Z0-9]{3,47}-\d+$).

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
  • grpc://localhost:9090 for GRPC

(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

This task must be completed before the node starts running.

  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

Only the currently configured gas-price can be used to pay transaction fees before modifying the gas-prices parameter.

(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

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

for RPC

for REST API Server (LCD)

for Swagger

Go v1.19+
nodes
http://localhost:26657
http://localhost:1317
http://localhost:1317/swagger/