Building an Ethereum Consortium Chain: A Step-by-Step Guide

ยท

Introduction to Proof-of-Authority (PoA) Chains

When should you create your own PoA test chain?

Key characteristics of PoA chains:

Getting Started with Parity Wallet

Installation Guide

  1. Download Parity Ethereum Client:
    Official website: Parity Ethereum
    Latest release: GitHub v2.2.9
  2. Ubuntu Installation:

    # Install Linuxbrew
    ruby -e "$(wget -O- https://raw.github.com/Homebrew/linuxbrew/go/install)"
    apt install linuxbrew-wrapper
    
    # Add Parity repository
    brew tap paritytech/paritytech
    
    # Install latest stable version
    brew install parity --stable

Configuring Your Consortium Chain

Genesis Block Specification

Create demo-spec.json with this template:

{
  "name": "DemoPoA",
  "engine": {
    "authorityRound": {
      "params": {
        "stepDuration": "5",
        "validators": {
          "list": []
        }
      }
    }
  },
  "params": {
    "gasLimitBoundDivisor": "0x0400",
    "networkID": "0x2323"
  },
  "genesis": {
    "difficulty": "0x20000",
    "gasLimit": "0x5B8D80"
  }
}

Key parameters:

Node Configuration Files

Node 0 (node0.toml):

[parity]
chain = "demo-spec.json"
base_path = "parity0"
[network]
port = 30300
[rpc]
port = 8540
apis = ["web3", "eth", "net", "personal", "parity"]

Node 1 (node1.toml):

[parity]
chain = "demo-spec.json"
base_path = "parity1"
[network]
port = 30301
[rpc]
port = 8541
apis = ["web3", "eth", "net", "personal", "parity"]

๐Ÿ‘‰ Explore advanced node configuration options

Account Setup and Network Deployment

Creating Authority Accounts

  1. Initialize accounts through Parity UI:

    • Access Node 0 at http://localhost:8180
    • Create Authority account with passphrase "node0"
    • Create user account with initial balance
  2. Update demo-spec.json:

    "validators": {
      "list": [
        "0x00Bd138...77C9e",
        "0x00F9B30...b180"
      ]
    },
    "accounts": {
      "0x0064B09...3EcC": {
        "balance": "10000000000000000000000"
      }
    }

Launching Authority Nodes

Add mining configuration to TOML files:

[account]
password = ["node.pwds"]
[mining]
engine_signer = "0x00Bd138...77C9e" # Authority address
reseal_on_txs = "none"

Start nodes with:

parity --config node0.toml
parity --config node1.toml

Network Operations and Transactions

Connecting Nodes

  1. Retrieve Node 0's enode:

    {"method":"parity_enode","params":[]}
  2. Connect from Node 1:

    {"method":"parity_addReservedPeer","params":["enode://...@IP:30300"]}

Sending Test Transactions

Use the user account (funded with 10,000 ETH) to:

๐Ÿ‘‰ Learn about consortium chain use cases

FAQ Section

Q1: What's the difference between PoA and private chains?
A: PoA chains use designated validators instead of mining, offering faster block times and deterministic finality.

Q2: How many Authority nodes are recommended?
A: For testing, 2-3 nodes suffice. Production environments typically use 7-15 for fault tolerance.

Q3: Can I connect MetaMask to my PoA chain?
A: Yes, configure MetaMask with your node's RPC endpoint (e.g., http://localhost:8540).

Q4: How do I add more nodes later?
A: Update the validators list in demo-spec.json and restart all nodes with the new configuration.

Q5: What's the gas price on PoA chains?
A: Typically set to 0 or minimal values since there's no mining competition.

Q6: How do I monitor node performance?
A: Use Parity's built-in UI or tools like Grafana with the trace API enabled.