-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* add_testnet1_v2_yaml * add_testnet1_v2_yaml * add_testnet1_v2_yaml * add_testnet1_v2_yaml * add_testnet1_v2_yaml * add_testnet1_v2_yaml * add_testnet1_v2_yaml * add_testnet1_v2_yaml --------- Co-authored-by: lqS0317 <[email protected]>
- Loading branch information
Showing
4 changed files
with
295 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
version: '3.4' | ||
|
||
x-healthcheck: &healthcheck | ||
test: [ "CMD", "curl", "-sf", "http://localhost:8545" ] | ||
interval: 5s | ||
timeout: 5s | ||
retries: 3 | ||
start_period: 30s | ||
|
||
services: | ||
op-geth: | ||
image: mantlenetworkio/op-geth:v0.5.0-1 | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '4' | ||
memory: 8000M | ||
reservations: | ||
cpus: '4' | ||
memory: 8000M | ||
restart_policy: | ||
condition: on-failure | ||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
entrypoint: geth | ||
command: | ||
- --datadir=/db | ||
- --verbosity=3 | ||
- --port=30300 | ||
- --http | ||
- --http.corsdomain=* | ||
- --http.vhosts=* | ||
- --http.addr=0.0.0.0 | ||
- --http.port=8545 | ||
- --http.api=web3,eth,debug,txpool,net | ||
- --ws | ||
- --ws.addr=0.0.0.0 | ||
- --ws.port=8546 | ||
- --ws.origins=* | ||
- --ws.api=web3,eth,debug,txpool,net | ||
- --syncmode=full | ||
- --maxpeers=0 | ||
- --networkid=5003 | ||
- --rpc.allow-unprotected-txs | ||
- --authrpc.addr=0.0.0.0 | ||
- --authrpc.port=8551 | ||
- --authrpc.vhosts=* | ||
- --authrpc.jwtsecret=/secret/jwt_secret_txt | ||
- --pprof | ||
- --pprof.addr=0.0.0.0 | ||
- --pprof.port=6060 | ||
- --gcmode=archive | ||
- --metrics | ||
- --metrics.addr=0.0.0.0 | ||
- --metrics.port=9001 | ||
- --snapshot=false | ||
volumes: | ||
- ./goerli/secret:/secret/ | ||
- ./data/goerli-geth:/db/geth/ | ||
ports: | ||
- ${VERIFIER_HTTP_PORT:-8545}:8545 | ||
- ${VERIFIER_WS_PORT:-8546}:8546 | ||
- ${VERIFIER_AUTH_PORT:-8551}:8551 | ||
op-node: | ||
image: mantlenetworkio/op-node:v0.5.0-1 | ||
deploy: | ||
resources: | ||
limits: | ||
cpus: '4' | ||
memory: 8000M | ||
reservations: | ||
cpus: '4' | ||
memory: 8000M | ||
restart_policy: | ||
condition: on-failure | ||
depends_on: | ||
- op-geth | ||
volumes: | ||
- ./goerli/secret:/secret | ||
- ./goerli/rollup.json:/config/rollup.json | ||
environment: | ||
OP_NODE_L1_ETH_RPC: 'L1 goerli' #change this | ||
OP_NODE_L2_ENGINE_RPC: 'http://op-geth:8551' | ||
OP_NODE_L2_ENGINE_AUTH: /secret/jwt_secret_txt | ||
OP_NODE_ROLLUP_CONFIG: '/config/rollup.json' | ||
OP_NODE_P2P_PRIV_PATH: /secret/p2p_node_key_txt | ||
OP_NODE_VERIFIER_L1_CONFS: '3' | ||
OP_NODE_RPC_ADDR: '0.0.0.0' | ||
OP_NODE_RPC_PORT: 8545 | ||
OP_NODE_P2P_LISTEN_IP: '0.0.0.0' | ||
OP_NODE_P2P_LISTEN_TCP_PORT: 9003 | ||
OP_NODE_P2P_LISTEN_UDP_PORT: 9003 | ||
OP_NODE_P2P_PEER_SCORING: 'light' | ||
OP_NODE_P2P_PEER_BANNING: 'true' | ||
OP_NODE_METRICS_ENABLED: 'true' | ||
OP_NODE_METRICS_ADDR: '0.0.0.0' | ||
OP_NODE_METRICS_PORT: 7300 | ||
OP_NODE_PPROF_ENABLED: 'true' | ||
OP_NODE_PPROF_PORT: 6060 | ||
OP_NODE_PPROF_ADDR: '0.0.0.0' | ||
OP_NODE_P2P_DISCOVERY_PATH: '/op-node/opnode_discovery_db' | ||
OP_NODE_P2P_PEERSTORE_PATH: '/op-node/opnode_peerstore_db' | ||
# da retriever | ||
OP_NODE_RETRIEVER_SOCKET: retriever.testnet.mantle.xyz:8000 | ||
OP_NODE_GRAPH_PROVIDER: https://graphnode.testnet.mantle.xyz/subgraphs/name/datalayr | ||
OP_NODE_L2_BACKUP_UNSAFE_SYNC_RPC: https://rpc.testnet.mantle.xyz | ||
OP_NODE_P2P_STATIC: '/ip4/54.251.234.159/tcp/9003/p2p/16Uiu2HAkxjPnLpwenfrz6tXjvoc7U6i5sBHUVBoyUxjrcap8sM2i' | ||
OP_NODE_SEQUENCER_ENABLED: 'false' | ||
OP_NODE_P2P_AGENT: 'mantle' | ||
OP_NODE_L2_ENGINE_SYNC_ENABLED: 'true' | ||
OP_NODE_L2_SKIP_SYNC_START_CHECK: 'true' | ||
OP_NODE_P2P_SYNC_REQ_RESP: 'true' | ||
ports: | ||
- ${NODE_RPC_PORT:-9545}:8545 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
{ | ||
"genesis": { | ||
"l1": { | ||
"hash": "0x9536ebe333cf93a2de68d9006348eaee00e5b3ec6381cbf244bb3eb4a681fc8e", | ||
"number": 10606692 | ||
}, | ||
"l2": { | ||
"hash": "0x4b8379d2ee50fc1fa3b46e9cc1394ec2ce1088ca2fd1c1bc926ed1278e8d8f27", | ||
"number": 31118702 | ||
}, | ||
"l2_time": 1709086080, | ||
"system_config": { | ||
"batcherAddr": "0x3f66c33a4d27dcc3e2a204ce6b3ff84cba457b7d", | ||
"overhead": "0x0000000000000000000000000000000000000000000000000000000000000834", | ||
"scalar": "0x00000000000000000000000000000000000000000000000000000000000f4240", | ||
"gasLimit": 1125899906842624, | ||
"baseFee": 1000000000 | ||
} | ||
}, | ||
"block_time": 2, | ||
"max_sequencer_drift": 600, | ||
"seq_window_size": 3600, | ||
"channel_timeout": 300, | ||
"l1_chain_id": 5, | ||
"l2_chain_id": 5001, | ||
"regolith_time": 0, | ||
"batch_inbox_address": "0xff00000000000000000000000000000000000000", | ||
"deposit_contract_address": "0x2ed00c9eefd29ba89f5134ba4aee695e42702dcc", | ||
"l1_system_config_address": "0x621cfe299418bc6cea11a8cf6937ea5598c3f9b9", | ||
"mantle_da_switch": true, | ||
"datalayr_service_manager_addr": "0xf97D1B34346d24CE21fc62463F5225De3b30b0cC" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
# Simple Mantle Node | ||
|
||
## Required Software | ||
|
||
- [docker](https://docs.docker.com/engine/install/) | ||
- [node](https://nodejs.org/en/download/) | ||
- [foundry](https://github.com/foundry-rs/foundry/releases) | ||
|
||
## Recommended Hardware | ||
|
||
- 16GB+ RAM | ||
- 8C+ CPU | ||
- 500GB+ disk (HDD works for now, SSD is better) | ||
- 10mb/s+ download | ||
|
||
## Installation and Setup Instructions | ||
|
||
|
||
### Init to generate the 'jwt_secret_txt' file and the 'p2p_node_key_txt' | ||
|
||
```sh | ||
cd networks/ | ||
|
||
|
||
mkdir goerli/secret | ||
|
||
node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" > goerli/secret/jwt_secret_txt | ||
|
||
cast w n |grep -i "Private Key" |awk -F ": " '{print $2}' |sed 's/0x//' > goerli/secret/p2p_node_key_txt | ||
``` | ||
|
||
### Operating the Node | ||
|
||
#### Download latest snapshot from mantle | ||
|
||
We recommend that you start the node with latest shapshot, so that you don't need to wait a long time to sync data. | ||
|
||
example: | ||
|
||
```sh | ||
mkdir -p ./data/testnet-geth | ||
|
||
# latest snapshot tarball | ||
linux: | ||
date=$(date -d "2 days ago" +%Y%m%d) | ||
mac: | ||
date=$(date -v-2d +%Y%m%d) | ||
|
||
tarball="$date-testnet1-chaindata.tar" | ||
|
||
wget https://s3.ap-southeast-1.amazonaws.com/snapshot.sepolia.mantle.xyz/20240228-testnet1-chaindata.tar | ||
|
||
|
||
tar xf ${tarball} -C ./data/testnet-geth | ||
|
||
``` | ||
|
||
Check the data was unarchived successfully: | ||
```sh | ||
$ ls ./data/testnet-geth | ||
chaindata | ||
``` | ||
|
||
#### Start | ||
|
||
```sh | ||
docker-compose -f docker-compose-testnet.yml up -d | ||
``` | ||
|
||
Will start the node in a detatched shell (`-d`), meaning the node will continue to run in the background. | ||
You will need to run this again if you ever turn your machine off. | ||
|
||
The first time you start the node it synchronizes from regenesis (December 1th, 2022) to the present. | ||
This process takes hours. | ||
|
||
#### Stop | ||
|
||
```sh | ||
docker-compose -f docker-compose-testnet.yml down | ||
``` | ||
|
||
Will shut down the node without wiping any volumes. | ||
You can safely run this command and then restart the node again. | ||
|
||
#### Wipe | ||
|
||
```sh | ||
docker-compose -f docker-compose-testnet.yml down -v | ||
``` | ||
|
||
Will completely wipe the node by removing the volumes that were created for each container. | ||
Note that this is a destructive action, be very careful! | ||
|
||
#### Logs | ||
|
||
```sh | ||
docker-compose logs <service name> | ||
``` | ||
|
||
Will display the logs for a given service. | ||
You can also follow along with the logs for a service in real time by adding the flag `-f`. | ||
|
||
The available services are: | ||
- [`op-geth`](#mantle-node) | ||
- [`op-node`](#mantle-node) | ||
|
||
|
||
#### Update | ||
|
||
```sh | ||
docker-compose pull | ||
``` | ||
|
||
Will download the latest images for any services where you haven't hard-coded a service version. | ||
Updates are regularly pushed to improve the stability of Mantle nodes or to introduce new quality-of-life features like better logging and better metrics. | ||
I recommend that you run this command every once in a while (once a week should be more than enough). | ||
|
||
## How To Check If The Deployment Is Successful | ||
|
||
### Check Service | ||
|
||
If the service status is 'up,' it means that the service has started without any issues. | ||
|
||
```sh | ||
docker-compose -f docker-compose-testnet.yml ps | ||
``` | ||
|
||
### Check Data | ||
|
||
Use the command 'cast bn' to execute multiple times and check if the height increases. | ||
|
||
example: | ||
|
||
```sh | ||
cast bn | ||
cast bn --rpc-url https://rpc.testnet.mantle.xyz | ||
``` | ||
|
||
Use the command 'cast rpc optimism_syncStatus' to execute multiple times and check if the safe_l2 and inalized_l2 increases. | ||
It may need to be increased after thirty minutes | ||
|
||
example: | ||
|
||
```sh | ||
cast rpc optimism_syncStatus --rpc-url localhost:9545 |jq .finalized_l2.number | ||
|
||
cast rpc optimism_syncStatus --rpc-url localhost:9545 |jq .safe_l2.number | ||
``` |