diff --git a/geth.sh b/geth.sh new file mode 100644 index 0000000..d47f499 --- /dev/null +++ b/geth.sh @@ -0,0 +1,56 @@ +#!/bin/sh + +# FIXME: Cannot use set -e since bash is not installed in Dockerfile +# set -e + +RETRIES=${RETRIES:-40} +VERBOSITY=${VERBOSITY:-6} + +# get the genesis file from the deployer +curl \ + --fail \ + --show-error \ + --silent \ + --retry-connrefused \ + --retry-all-errors \ + --retry $RETRIES \ + --retry-delay 5 \ + $ROLLUP_STATE_DUMP_PATH \ + -o genesis.json + +# wait for the dtl to be up, else geth will crash if it cannot connect +curl \ + --fail \ + --show-error \ + --silent \ + --output /dev/null \ + --retry-connrefused \ + --retry $RETRIES \ + --retry-delay 1 \ + $ROLLUP_CLIENT_HTTP + +# import the key that will be used to locally sign blocks +# this key does not have to be kept secret in order to be secure +# we use an insecure password ("pwd") to lock/unlock the password +echo "Importing private key" +echo $BLOCK_SIGNER_KEY > key.prv +echo "pwd" > password +geth account import --datadir $DATADIR --password ./password ./key.prv +echo $FP_OPERATOR_PRIVATE_KEY > key.prv +geth account import --datadir $DATADIR --password ./password ./key.prv + +# initialize the geth node with the genesis file +echo "Initializing Geth node" +geth --verbosity="$VERBOSITY" "$@" init genesis.json --datadir $DATADIR + +# start the geth node +echo "Starting Geth node" +exec geth \ + --verbosity="$VERBOSITY" \ + --datadir $DATADIR \ + --password ./password \ + --allow-insecure-unlock \ + --unlock $BLOCK_SIGNER_ADDRESS \ + --mine \ + --miner.etherbase $BLOCK_SIGNER_ADDRESS \ + "$@" diff --git a/run-node-mainnet_binary.md b/run-node-mainnet_binary.md new file mode 100644 index 0000000..3ba255a --- /dev/null +++ b/run-node-mainnet_binary.md @@ -0,0 +1,65 @@ +# Simple Mantle Node + +## Required Software + +- [golang 1.19 ] + +## Recommended Hardware + +- 16GB+ RAM +- 1000GB+ disk (HDD works for now, SSD is better) +- 10mb/s+ download + +## Approximate Disk Usage + +Usage as of 2022-09-21: + +- Archive node: ~1000gb + +## Installation and Setup Instructions + +### build a binary file + + +```sh +git clone https://github.com/mantlenetworkio/mantle.git +cd mantle/l2geth +git checkout v0.4.3-5 +make geth + +``` + +### set up env and run +```sh +git clone https://github.com/mantlenetworkio/networks.git +cd networks +cd mainnet/envs +set -a +. ./geth.env +set +a +mkdir ~/mantle_l2geth_data +cd ../.. +export ETH1_HTTP=https://rpc.ankr.com/eth +export SEQUENCER_CLIENT_HTTP=https://rpc.mantle.xyz +export ROLLUP_STATE_DUMP_PATH=https://mantlenetworkio.github.io/networks/mainnet/genesis.json +export ROLLUP_CLIENT_HTTP=https://dtl.mantle.xyz +export ROLLUP_BACKEND='l2' +export ETH1_CTC_DEPLOYMENT_HEIGHT=8 +export RETRIES=60 +export ROLLUP_VERIFIER_ENABLE='true' +export DATADIR=~/mantle_l2geth_data + +cp ../mantle/l2geth/build/bin/geth . +export PATH=$PATH:$(pwd) +sh geth.sh +``` + +you need to change DATADIR to where you want to store data \ +you need to change ETH1_HTTP to your own rpc +> note: if sync speed is slow , You could try to use https://dtl-us.mantle.xyz for US , https://dtl-eu.mantle.xyz/ for EU, https://dtl-ap.mantle.xyz/ for APAC . You could find this config in ./mainnet/envs/geth.env, the default value is : https://dtl.mantle.xyz . + + + + + +