Pharos Docs
  • Introduction
    • About Pharos Network
    • Vision & Mision
    • Why Pharos Network
    • Concepts
      • Degree of Parallelism (DP)
  • Architecture
    • Pharos Modular Stack
    • Node Architecture
      • About Pharos Nodes
  • Core Technologies
    • Pharos Consensus
    • Pharos Execution
      • Why A New Blockchain Compute Model
      • Pharos VM
    • Pharos Pipelining
    • Pharos Store
      • Why We Need a Blockchain-Native Store
    • Pharos SPNs
  • Network Overview
    • Pharos Networks
      • Pharos Testnet Information
    • Pharos Gas Model
    • FAQ
  • Node & Validator Guide
    • Validator Requirements
    • Validator Node Deployment
      • Using Docker (Devnet)
      • Using Docker (Testnet)
    • Node Management
    • Rapid Node Initialization
      • Rapid Node Initialization(Testnet)
      • Rapid Node Initialization(Devnet)
    • Pharos Network Snapshots
    • Node Debugging & Configuration
  • 🛠️ Pharos Testnet: Rebuild Node with Preserved Node Info
  • Pharos Node Monitoring
  • Developer Guide
    • Foundry
      • Write Your First dApp
      • Write Your First Token
      • Write Your First NFT
      • Write Your First Uniswap Contract
    • Hardhat
      • Write Your First dApp
      • Write Your First Token
      • Write Your First NFT
      • Write Your First Uniswap Contract
    • Rust
    • Interoperability
      • Call EVM From WASM
  • API & SDK
    • JSON-RPC API Methods
  • Resources
    • EVM
    • Solidity
Powered by GitBook
On this page
  • Prerequisites
  • Pharos Validator Node Deployment Steps
  • 1. Create a working directory for your Pharos node:
  • 2. Start the Pharos node and run the following command in the $WORKSPACE directory:
  • 3.⏳ Wait for Sync
  • Optional Steps
  • Other commands:
Export as PDF
  1. Node & Validator Guide
  2. Validator Node Deployment

Using Docker (Testnet)

PreviousUsing Docker (Devnet)NextNode Management

Last updated 12 days ago

Prerequisites

Before starting, ensure that you meet the system requirements for Pharos nodes. Additionally, install the following dependencies:

Pharos Validator Node Deployment Steps

1. Create a working directory for your Pharos node:

docker stop pharos-testnet && docker rm pharos-testnet
export WORKSPACE=testnet
# If you want to keep the existing snapshot, please save the public database first.
mv /data/$WORKSPACE/pharos-node/domain/light/data/public/ /data/
rm -rf /data/$WORKSPACE
mkdir -p /data/$WORKSPACE
cd /data/$WORKSPACE

You need to modify /data/$WORKSPACE and create the $WORKSPACE directory in a data disk with large space. For example, if your data disk is mounted in /app, then mkdir /app/$WORKSPACE

Generate a docker-compose.yml file for managing Pharos nodes

version: '3'

services:
  pharos:
    image: public.ecr.aws/k2g7b7g1/pharos/testnet:63b85b6b
    container_name: pharos-testnet
    volumes:
      - /data/$WORKSPACE:/data
    ports:
      - "18100:18100"
      - "18200:18200"
      - "19000:19000"
    restart: unless-stopped

Parameter Explanation

  • name pharos-testnet: Container name, customizable.

  • /data/$WORKSPACE:/data: Local mount directory, recommended to be set on a high-capacity disk.

public.ecr.aws/k2g7b7g1/pharos/testnet:xxxxxxxx: Pharos testnet image address.

In your mount directory there should be a list of files:

  • deploy.light.json: Pharos binary configuration template

  • domain.json: Pharos deployment configuration file

  • genesis.conf: The genesis config of the testnet you are connecting to

And the following directories:

  • pharos-node: Pharos deployment directory, Contains configuration files, binaries, logs, DB, etc.

  • pharos-node-client : Pharos client directory, used to do node management

  • resources : Node's keys directory, including consensus signing key and BLS key. Keep it safe

2. Start the Pharos node and run the following command in the $WORKSPACE directory:

docker-compose up -d (or `docker compose up` depends on your version)

3.⏳ Wait for Sync

Once the local node starts syncing and you can confirm block height is increasing (this may take up to 3 minutes — do not run docker stop or docker-compose down during this period):

curl 127.0.0.1:18100/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"method":"eth_blockNumber","params":[],"id":1,"jsonrpc":"2.0"}'

Optional Steps

If you want to restore the public data:

docker stop pharos-testnet
rm -rf /data/$WORKSPACE/pharos-node/domain/light/data/public/
mv /data/public /data/$WORKSPACE/pharos-node/domain/light/data/
docker-compose up -d

Other commands:

# Stop
docker-compose stop
# Restart
docker-compose restart
# Update to latest version
docker-compose pull
docker-compose down && docker-compose up -d
Docker-compose