Running Matchain Node
This guide provides instructions on launching a full node on Matchain using a simple Docker Compose script. Follow the steps below to set up your full node.
Prerequisites
Clone the Repository
Before starting, clone the opstack-fullnode-sync
repository:
git clone -b v0.3.0 https://github.com/matchain/opstack-fullnode-sync.git
cd opstack-fullnode-sync
Recommended Hardware
CPU: 4 Cores
RAM: 16 GB+
Storage: 1TB SSD (NVMe Recommended)
Network: 100 MB/s+ Download
Preparation
Generate JWT File Run the following command to generate a JWT file:
openssl rand -hex 32 > jwt.txt
Configure Environment Variables Copy the
.env.example
file to create your.env
file, and update the values as needed:cp .env.example .env
Modify
.env
to set your parameters, or request a preconfigured.env
file from the Matchain team.
Operating the Node
Start the Node
Use Docker Compose to start the node:
docker compose --env-file .env up -d
View Logs
Logs for OP Node:
docker compose logs -f node
Logs for OP Geth:
docker compose logs -f geth
Sanity Test
Check Sync Status
To check the sync status, use:
curl --location 'localhost:8545' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_syncing",
"params": [],
"id": 2
}'
If the node is still syncing, you will see output similar to:
{ "jsonrpc": "2.0", "id": 2, "result": { "currentBlock": "0x7d0f5", ... "highestBlock": "0xd8674", ... } }
When syncing completes, you will see:
{"jsonrpc":"2.0","id":2,"result":false}
Check Block Number
After syncing completes, verify by checking the latest block number:
curl --location 'localhost:8545' \
--header 'Content-Type: application/json' \
--data '{
"jsonrpc": "2.0",
"method": "eth_blockNumber",
"id": 2
}'
Example response:
{ "jsonrpc": "2.0", "id": 2, "result": "0x2139" }
Stop the Node
To stop the node, use:
docker compose down
Reference
For further details, refer to the Optimism Documentation.
Last updated
Was this helpful?