Node

Deploy Chain Services

Preparation

apt-get install gcc
wget https://go.dev/dl/go1.21.6.linux-amd64.tar.gz
tar zvxf go1.21.6.linux-amd64.tar.gz
mkdir -p /data/go
mv go /data/go/go1.21.6
vim /etc/profile
//"Add at the end"
export GOROOT=/data/go/go1.21.6
export GOPATH=/data/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
//"Save and close"
source /etc/profile
go version

If the Go version number can be printed out in the end, it indicates that the installation was successful. To ensure the node participates in the network, please open port 26656.

Download Code

git clone https://github.com/mtt-labs/mtt-chain.git
cd mtt-chain

Installation

Run the installation script.

./install.sh

Verify the installation.

mttd

Check if the following content is displayed.

Start mttd node

Usage:
mttd [command]

Available Commands:
add-genesis-account Add a genesis account to genesis.json
collect-gentxs      Collect genesis txs and output a genesis.json file
config              Create or query an application CLI configuration file
debug               Tool for helping with debugging your application
export              Export state to JSON
gentx               Generate a genesis tx carrying a self delegation
help                Help about any command
index-eth-tx        Index historical eth txs
init                Initialize private validator, p2p, genesis, and application configuration files
keys                Manage your application's keys
migrate             Migrate genesis to a specified target version
query               Querying subcommands
rollback            rollback cosmos-sdk and tendermint state by one height
rosetta             spin up a rosetta server
start               Run the full node
status              Query remote node for status
tendermint          Tendermint subcommands
testnet             subcommands for starting or configuring local testnets
tx                  Transactions subcommands
validate-genesis    validates the genesis file at the default location or at the location passed as an arg
version             Print the application binary version information

Flags:
-b, --broadcast-mode string    Transaction broadcasting mode (sync|async|block) (default "sync")
--chain-id string          Specify Chain ID for sending Tx (default "testnet")
--fees string              Fees to pay along with transaction; eg: 10aphoton
--from string              Name or address of private key with which to sign
--gas-adjustment float     adjustment factor to be multiplied against the estimate returned by the tx simulation; if the gas limit is set manually this flag is ignored  (default 1)
--gas-prices string        Gas prices to determine the transaction fee (e.g. 10aphoton)
-h, --help                     help for mttd
--home string              directory for config and data (default "/Users/zzz/.mttd")
--keyring-backend string   Select keyring's backend (default "os")
--log_format string        The logging format (json|plain) (default "plain")
--log_level string         The logging level (trace|debug|info|warn|error|fatal|panic) (default "info")
--node string              <host>:<port> to tendermint rpc interface for this chain (default "tcp://localhost:26657")
--trace                    print out full stack trace on errors

Use "mttd [command] --help" for more information about a command.

Initialization

Initialize the node. Replace MONIKER and HOMEDIR with the desired nickname and path.

mttd init MONIKER --chain-id mtt_6880-1 --home HOMEDIR --overwrite

Download chain data.

wget https://snapshot.mtt.network/mtt-mainnet-snapshot.tar.gz
tar -xzvf mtt-mainnet-snapshot.tar.gz

Copy chain data.

cp -r mtt-mainnet-snapshot/config/genesis.json HOMEDIR/config
cp -r mtt-mainnet-snapshot/data HOMEDIR/

Modify the p2p configuration.

vim HOMEDIR/config/config.toml

persistent_peers = "1d8321f65e3d269bc4af1d94d5b92eca3fd8455a@101.44.201.39:26656,f75c7b94d3e49636ee87c9f7c1faf268ae081b03@159.138.34.3:26656,1315c9aeca9287c166be968fae79ddf7ec1482cc@8.219.219.202:26656,3a6f505056e2e0c5ad1e1102312a0493e80c5ba5@54.251.208.79:26656"
seeds = "546fa50af9109057ea72c276ec3d27629cea84aa@111.119.229.176:26656"

Modify the contents of the following fields in the config.

timeout_propose = "1.8s"
timeout_propose_delta = "500ms"
timeout_prevote = "600ms"
timeout_prevote_delta = "500ms"
timeout_precommit = "600ms"
timeout_precommit_delta = "500ms"
timeout_commit = "3s"

Run

Run in the foreground.

mttd start --pruning=nothing --trace --json-rpc.api eth,txpool,net,web3,debug,trace --log_level info --home HOMEDIR

Run in the background.

nohup mttd start --pruning=nothing --trace --json-rpc.api eth,txpool,net,web3,debug,trace --log_level info --home HOMEDIR &

Last updated