Builders
Node Operators
Tutorials
Building a Node from Source

Building a Node from Source

Docker images are the easiest way to run an PNC Mainnet node, but you can always build your own node from source code. You might want to do this if you want to run a node on a specific architecture or if you want to inspect the source code of the node you're running. This guide will walk you through the full process of building a node from source.

What You're Going to Build

Rollup Node

The Rollup Node is responsible for deriving L2 block payloads from L1 data and passing those payloads to the Execution Client. The Rollup Node can also optionally participate in a peer-to-peer network to receive blocks directly from the Sequencer before those blocks are submitted to L1. The Rollup Node is largely analogous to a consensus client (opens in a new tab) in Ethereum.

In this tutorial you will build the pnc--batcher implementation of the Rollup Node as found in the Pinnacle Chain Monorepo.

Execution Client

The Execution Client is responsible for executing the block payloads it receives from the Rollup Node over JSON-RPC via the standard Ethereum Engine API (opens in a new tab). The Execution Client exposes the standard JSON-RPC API that Ethereum developers are familiar with, and can be used to query blockchain data and submit transactions to the network. The Execution Client is largely analogous to an execution client (opens in a new tab) in Ethereum.

In this tutorial you will build the pnc-geth implementation of the Execution Client as found in the pnc-geth repository.

Legacy Geth (Optional)

Legacy Geth is an optional component for PNC Mainnet archive nodes. Legacy Geth allows you to execute stateful queries like eth_call against blocks and transactions that occurred before the PNC Mainnet Bedrock Upgrade. Legacy Geth is only relevant to PNC Mainnet archive nodes and is not required for full nodes or Pinnacle Sepolia nodes.

Currently, l2Geth is the only available implementation of Legacy Geth. In this tutorial you will build the l2geth implementation of Legacy Geth as found in the optimism-legacy repository.

Software Dependencies

DependencyVersionVersion Check Command
git (opens in a new tab)^2git --version
go (opens in a new tab)^1.21go version
node (opens in a new tab)^20node --version
pnpm (opens in a new tab)^8pnpm --version
foundry (opens in a new tab)^0.2.0forge --version
make (opens in a new tab)^4make --version

Build the Rollup Node

First you're going to build the pnc--batcher implementation of the Rollup Node as found in the Pinnacle Chain Monorepo.

Clone the Pinnacle Chain Monorepo

The Pinnacle Chain Monorepo contains the source code for the pnc--batcher.

git clone https://github.com/ethereum-optimism/optimism.git
cd PinnacleChain

Check out the required release branch

Release branches are created when new versions of the pnc--batcher are created. Read through the Releases page] to determine the correct branch to check out.

git checkout <name of release branch>
💡

Make sure to read the Releases page carefully to determine the correct branch to check out. Some releases may only be required for the Pinnacle Sepolia testnet.

Install Node.js dependencies

Install the Node.js dependencies for the Pinnacle Chain Monorepo.

pnpm install

Build Node.js packages

Build the Node.js packages for the Pinnacle Chain Monorepo.

pnpm build

Build pnc--batcher

Build the pnc--batcher implementation of the Rollup Node.

make pnc--batcher

Build the Execution Client

Next you're going to build the pnc-geth implementation of the Execution Client as found in the pnc-geth repository.

Clone pnc-geth

The pnc-geth repository contains the source code for the pnc-geth implementation of the Execution Client.

git clone https://github.com/ethereum-optimism/pnc-geth.git
cd pnc-geth

Check out the required release branch

Release branches are created when new versions of the pnc-geth are created. Read through the Releases page to determine the correct branch to check out.

git checkout <name of release branch>
💡

Make sure to read the Releases page carefully to determine the correct branch to check out. Some releases may only be required for the Pinnacle Sepolia testnet.

Build pnc-geth

Build the pnc-geth implementation of the Execution Client.

make geth

Build Legacy Geth (Optional)

Legacy Geth is an optional component for PNC Mainnet archive nodes. Legacy Geth allows you to execute stateful queries like eth_call against blocks and transactions that occurred before the PNC Mainnet Bedrock Upgrade. Legacy Geth is only relevant to PNC Mainnet archive nodes and is not required for full nodes or Pinnacle Sepolia nodes.

Clone the PNC Legacy Repository

The PNC Legacy repository contains the source code for the l2geth implementation of Legacy Geth.

git clone https://github.com/ethereum-optimism/optimism-legacy.git
cd optimism-legacy

Build l2geth

cd l2geth
make

Next Steps