Testnet Node Launch

# Configuration choices

Hardware requirements

Replicas need to store the transaction history of Patex and to run Geth. They need to be relatively powerful machines (real or virtual). We recommend at least 16 GB RAM, and an SSD drive with at least 500 GB free (for the production network).

Source of synchronization

Thepatex-chain component synchronizes with both other Patex Nodes, meaning L2, and L1 Ethereum if necessary.

To synchronize only from L1, you edit the pt-node configuration (opens new window) to set OP_NODE_P2P_DISABLE to true.

When you use RPC to get block information (https://github.com/patex-ecosystem/patex-network/blob/main/specs/rollup-node.md#l2-output-rpc-method), you can specify one of four options for blockNumber:

  • an actual block number

  • pending: Latest L2 block

  • latest: Latest block written to L1

  • finalized: Latest block fully finalized on L1 (a process that takes 12 minutes with Proof of Stake)

# Docker configuration

The recommended method to create a replica node is to use Docker (opens new window) and the Sepolia Testnet RPC node Docker deploy script we provide. It include all the configuration settings to run the node. This is the recommended method because it is what we use for our own systems. As such, the docker images go through a lot more tests than any other configuration.

Configuring and running the node

All you need just clone the Patex network repository and run a script on Docker pre-installed OS:

cd ~
git clone https://github.com/patex-ecosystem/patex-network.git
cd patex-network
./ops-bedrock/patex-sepolia/rpc-node/node-up.sh

The Docker node exposed RPC port 19545. After containers is deployed and have running status, you can make RPC requests. Example eth_blockNumber api:

curl --location --request POST 'http://localhost:19545' --header 'x-api-key: YOUR-API-KEY' --header 'Content-Type: application/json' --data-raw '{"jsonrpc": "2.0","method": "eth_blockNumber","params": [],"id": ""}'

# Non-docker configuration

These instructions explain how to build your own read-only replica without relying on our images. These instructions were generated on an Ubuntu 20.04 box, but they should work with other systems too.

Note: This is not the recommended configuration. While we did QA on these instructions and they work, the QA that the docker images undergo is much more extensive.

Build the Patex repository

  1. Clone the Patex network repository (opens new window).

    cd ~
    git clone https://github.com/patex-ecosystem/patex-network.git
  2. Build the various packages inside of the Patex Network repository.

    cd patex-network
    make pt-node

Build patex-chain

  1. Clone patex-chain:

    cd ~
    git clone https://github.com/patex-ecosystem/patex-chain.git
  2. Build patex-chain:

    cd patex-chain
    make geth

Get the data dir

The next step is to download the data directory for patex-chain.

  1. Download the correct data directory snapshot.

  2. Create the data directory inpatex-chain and fill it. Note that these directions assume the data directory snapshot is at ~, the home directory. Modify if needed.

    cd ~/patex-chain
    tar xvf ~/testnet.tar
  3. Create a shared secret with pt-node:

    cd ~/patex-chain
    openssl rand -hex 32 > jwt.txt
    cp jwt.txt ~/patex-network/pt-node
  4. Download rollup.json config for pt-node:

    cd ~/patex-network
    wget https://sepolia.patex.io/rollup.json $PWD/rollup.json

Scripts to start the different components

patex-chain

#! /usr/bin/bash

cd ~/patex-chain

./build/bin/geth \
  --ws \
  --ws.port=8546 \
  --ws.addr=0.0.0.0 \
  --ws.origins="*" \
  --http \
  --http.port=8545 \
  --http.addr=0.0.0.0 \
  --http.vhosts="*" \
  --http.corsdomain="*" \
  --authrpc.addr=localhost \
  --authrpc.jwtsecret=./jwt.txt \
  --authrpc.port=8551 \
  --authrpc.vhosts="*" \
  --verbosity=3 \
  --rollup.disabletxpoolgossip=true \
  --nodiscover \
  --syncmode=full \
  --maxpeers=0 \
  --datadir ./datadir

pt-node

#! /usr/bin/bash

cd ~/patex-network/pt-node
./bin/pt-node \
        --l2=http://localhost:8551 \
        --l2.jwt-secret=./jwt.txt \
        --rpc.addr=0.0.0.0 \
        --rpc.port=8547 \
	--rollup.config=./rollup.json \
        --l1=<< URL TO L1 >>       

Make sure to change << URL to L1 >> to a service provider's URL for the L1 network ( L1 Ethereum Sepolia Testnet).

Operations

It's best to start patex-chain first and shut it down last.

Last updated