> For the complete documentation index, see [llms.txt](https://mtt-network.gitbook.io/mtt-validator-protocol/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://mtt-network.gitbook.io/mtt-validator-protocol/operation-manual/node.md).

# 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,11a1b3b3c36da845930258e367c55e859e93f0aa@159.138.34.3:26656,1315c9aeca9287c166be968fae79ddf7ec1482cc@8.219.219.202:26656,ac40cf5500d5938b4d9fec63cdfc116c5365f2b0@54.251.208.79:26656"
seeds = "546fa50af9109057ea72c276ec3d27629cea84aa@111.119.229.176:26656,4ab988cb88c9010571bd9b2f1e124cb507ba5fca@124.243.181.197: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 --json-rpc.api eth,txpool,net,web3,debug,trace --log_level error --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 &
```
