Energy Web Documentation
  • Energy Web Ecosystem
  • Launchpad by Energy Web
  • EWC Validator Documentation
  • Community Ressources
  • Legacy documentation
  • Documentation Overview
  • Core Concepts
    • Energy Web Chain
    • Energy Web X
    • Energy Web Tokens
      • Token Lifting
      • Token Lowering
    • Worker Nodes and Worker Node Networks
      • Server-based Worker Node
      • Marketplace App (desktop-based)
    • Worker Node Operator
    • Smart Flows and Groups
    • Subscription
    • Reward Period
    • Voting and Consensus
    • Ethereum
      • Transactions and Transaction Costs
    • Decentralized Identifiers (DIDs)
  • EWC ECOSYSTEM
    • Energy Web Chain
      • System Architecture
        • Proof-of-Authority Consensus Mechanism
        • System Contracts
          • Name registry
          • Holding Contract
          • Block Reward Contract
          • Validator-Set Contract
        • Validator Node Architecture
      • Energy Web Block Explorer
      • Energy Web Chain Governance & Validators
    • Energy Web Tokens
  • EWX ECOSYSTEM
    • Energy Web X
    • EWX: Architecture
    • Pallets
      • Worker Node Pallet
      • Balances Pallet
      • Proxy Pallet
      • XCM Pallet
      • Assets Pallet
      • Multisig Pallet
      • Scheduler Pallet
      • Preimages Pallet
      • Offences Pallet
      • Eth-Bridge Pallet
      • Token-Manager Pallet
      • Ethereum-events pallet
      • Avn Pallet
    • Worker Nodes
      • 🖥️The Marketplace App
        • Operator and Worker Accounts
          • Creating an operator account
          • Funding an operator account
          • Connecting to operator account
          • Disconnecting an operator account
          • Creating a worker account
          • Importing worker account
          • Exporting worker account
          • Linking a worker account to an operator account
          • Unlinking a worker account from an operator account
        • How to use Ledger on Marketplace App
        • Token Management
          • Creating an EWC account
          • Managing EWC accounts
          • Lifting tokens
          • Lowering tokens
          • Tracking lifting and lowering transactions
          • Checking EWT balance
        • Subscriptions
          • Subscribing to a solution group
          • Topping-up subscription amount
          • Managing subscriptions
          • Unsubscribing from a solution group
          • Unsubscribing delay
        • Worker Node and Rewards
          • Configuring remote worker node
          • Switching worker node location to remote
          • Participating into worker node network
          • Votes casted per Period
          • Reward Period
          • Checking rewards
          • Claiming rewards
        • FAQ: Marketplace App
        • Location Services
      • 🗄️Server-based Worker Nodes
        • Deployment Guide
        • Bootstrapping Server-based Worker Node Accounts
        • FAQ: Server-based Worker Nodes
      • Worker Node use cases
        • Sample Enterprise Use-Cases
          • Operating Envelopes Partitioning
          • ZEL Request Partitioning
          • Green Proofs
            • SAFc
            • Green Proofs for Bitcoin (GP4BTC)
            • Green Proofs as a Service (GPSaaS)
            • Green Proofs for Electrical Vehicles (GP4EV)
  • ENERGY SOLUTIONS
    • Green Proofs by Energy Web
      • Green Proofs Overview
      • Green Proofs Architecure
      • Green Proofs Software Stack
      • Use Cases and Reference Implementations
        • 24x7 Renewable Electricity
        • Sustainable Aviation Fuel
        • Green Proofs for Bitcoin
          • GP4BTC Miner Guide
        • Decarbonizing Shipping
        • Green Proofs for Electrical Vehicles
        • Green Proofs as a Service (GPSaaS)
    • Digital Spine by Energy Web
      • Design and Architecture
      • Component Guides
        • Energy Web Name Service (ENS)
        • Self-Sovereign Identities
          • SSI-Hub
          • Technical Guide
            • Organizations
            • Applications
            • Roles and IAM
          • Deployment Guide
            • Deploy Identity Cache Server
            • Deploy Switchboard
        • DDHub Message Broker
          • Technical Guide
            • Authentication and Authorization
            • Topics
            • Messaging
          • Deployment Guide
            • Deploy DID Auth Proxy
            • Deploy Message Broker
        • DDHub Client Gateway
          • Technical Guide
            • Authentication and Authorization
              • Key Vault
            • Client Gateway Identity and VCs
            • Address Book
            • Topics
            • Channels
            • Integration Options
            • Messaging
          • Deployment Guide
            • Launchpad SaaS
            • Azure Marketplace
            • Self-Hosted
              • Deploy with Kubernetes
              • Deploy with Docker
            • Key Vault
              • Deploy with HashiCorp Key Vault
              • Deploy with Azure Key Vault
              • Deploy with AWS Secrets Manager
            • Rebranding and Whitelabelling
Powered by GitBook
On this page
  • What does it mean to run a node?
  • What do I need to run a node?
  • Benefits to Running a Local Node
  • Alternatives to Running a Local Node
  • Run a local node using the command line
  • Hardware Requirements
  • Download Chainspec file
  • Using OpenEthereum Client
  • Connect your local node to MetaMask
  • Run a local node using Docker with OpenEthereum client
  • Prerequisites
  • Set up
  • Additional Resources
Export as PDF
  1. EWC ECOSYSTEM
  2. EWC Guides and Tutorials

Run a Local RPC Node

Run a full instance of the blockchain on your machine

Last updated 5 months ago

You have the option of running a full node of the Energy Web Chain main network or Volta test network locally. Running a local node does requires a degree of technical capability. It helps to understand the benefits of doing so, and the alternatives to running a full local node.

There are a number of benefits to running your own node, which are described below.

What does it mean to run a node?

A 'client' is software that implements a blockchain's protocols and allows you to connect directly with the blockchain - that is to read data from the blockchain or initiate transactions on the blockchain, such as transferring tokens. Anyone can create client software, as long as it implements that blockchain's official protocols. Ethereum's protocols are specified in their , and there are a number of Ethereum clients to choose from.

A node is any machine that is actively running client software and is connected to the blockchain. Blockchain is often called a “peer-to-peer” network, because its network is made up of many peers running nodes simultaneously that are connected to each other.

Depending on if you are running a full node, a light node, or an archive node (see the differences between these nodes ), your client will sync with the current state of blockchain and then continue to execute every transaction that is added to the blockchain. Essentially it is having a live copy or version of the blockchain running locally on your machine.

Depending on the blockchain you are you connecting to, this can take up large amounts of space and take a long time to retrieve and sync the history of the chain on your machine. For example, synching with the Energy Web chain will require much less resources than syncing with the Ethereum mainnet, as it is a much larger and longer-running blockchain.

What do I need to run a node?

To run a node, you need to install the client software. The Energy Web mainnet and Volta testnet both use the client (formally known as Parity), because it supports the , which is a consensus algorithm specifically for Proof-of-Authority (PoA) blockchains. You can read more about the PoA consensus algorithm and why we implemented it for the Energy Web Chain .

Benefits to Running a Local Node

  1. The more nodes there are, the more secure the system is as a whole. Blockchains are decentralized technology, so by design the system performs better if there are multiple instances of it rather than just one. The more nodes there are, the less points of failure or opportunities for malicious action.

Alternatives to Running a Local Node

Running a local node is not necessary to use applications that run on the blockchain or transfer tokens.

Run a local node using the command line

Hardware Requirements

  • Multi-core CPU

  • 4GB RAM

  • SSD drive and free space

    • EWC RPC node - 150 GB

    • Volta RPC node - 200 GB

  • A decent DSL connection is required

Download Chainspec file

Download and save the chain config to your local machine.

Note that there are different chainspec files for the Volta Testnet and the Energy Web production chain:

Volta Testnet chainspec:

curl -L https://raw.githubusercontent.com/energywebfoundation/ewf-chainspec/master/Volta.json -o chainspec-volta.json

Energy Web Chain (production) chainspec:

curl -L https://raw.githubusercontent.com/energywebfoundation/ewf-chainspec/master/EnergyWebChain.json -o chainspec-ewc.json

Using OpenEthereum Client

  1. Run the following command in your terminal. Provide the path to the chain config that you want to use. The following command references the Volta chain config.

chmod +x openethereum
./openethereum --chain /path/to/chainconfig/Volta.json

Your local node should start:

2024-03-05 10:49:35 UTC Starting OpenEthereum/v3.3.5-stable-6c2d392d8-20220405/x86_64-linux-gnu/rustc1.58.1
2024-03-05 10:49:35 UTC Keys path /home/ubuntu/.local/share/openethereum/keys/Volta
2024-03-05 10:49:35 UTC DB path /home/ubuntu/.local/share/openethereum/chains/Volta/db/d94a0a739a3e416a
2024-03-05 10:49:35 UTC State DB configuration: fast
2024-03-05 10:49:35 UTC Operating mode: active
2024-03-05 10:49:35 UTC Not preparing block; cannot sign.
2024-03-05 10:49:36 UTC Configured for Volta using AuthorityRound engine
2024-03-05 10:49:36 UTC Signal for switch to contract-based validator set.
2024-03-05 10:49:36 UTC Initial contract validators: [0x36f67dd84e7327c10c7ead6c429a47189798fbdc, 0x20df7a4e8408add37c6a5c4afc1b1509924619fe, 0x77901f14183b1669c80e8c6137ff6721c9a26b25]
2024-03-05 10:49:36 UTC Listening for new connections on 127.0.0.1:8546.
2024-03-05 10:49:40 UTC Not preparing block; cannot sign.
2024-03-05 10:49:41 UTC Public node URL: enode://bb4962584a90ebcb373f5dd22cbe005ddd1300e7889c124ba33bfb0c327799948d8248054b7b6301f3bee46844c16cdaaffd390472198ddfb96798c8d03868b7@172.31.16.183:30303
2024-03-05 10:49:46 UTC Syncing    #1143 0xa666…220c   114.43 blk/s    0.0 tx/s    0.0 Mgas/s      0+    0 Qed LI:#1143    2/25 peers   405 KiB chain 0 bytes queue  RPC:  0 conn,    0 req/s,    0 µs
2024-03-05 10:49:51 UTC Syncing    #3559 0xe8e6…6a6c   483.00 blk/s    0.0 tx/s    0.0 Mgas/s      0+  124 Qed LI:#3683    2/25 peers   978 KiB chain 187 KiB queue  RPC:  0 conn,    0 req/s,    0 µs
2024-03-05 10:49:56 UTC Syncing    #5930 0xc530…ce9d   474.11 blk/s    0.2 tx/s    0.0 Mgas/s      0+ 1182 Qed LI:#7112    3/25 peers   2 MiB chain 2 MiB queue  RPC:  0 conn,    0 req/s,    0 µs
2024-03-05 10:50:01 UTC Syncing    #8458 0x63ee…be65   505.40 blk/s    0.0 tx/s    0.0 Mgas/s      0+ 3226 Qed LI:#11684    3/25 peers   3 MiB chain 5 MiB queue  RPC:  0 conn,    0 req/s,    0 µs
2024-03-05 10:50:06 UTC Syncing   #10352 0xf609…52e3   379.12 blk/s    0.0 tx/s    0.0 Mgas/s      0+ 5142 Qed LI:#15494    3/25 peers   3 MiB chain 8 MiB queue  RPC:  0 conn,    0 req/s,    0 µs

Connect your local node to MetaMask

Connect your MetaMask to the Volta Test Network or Energy Web Chain via remote RPC. You can read how to do this here.

Get the URL of your MetaMask account. You can do this by clicking the settings dropdown and selecting "Expand View."

When the view is expanded, copy the URL in the browser

Run the following command in your terminal

openethereum --chain path/to/chainconfig/Volta.json --jsonrpc-cors METAMASK URL  

Run a local node using Docker with OpenEthereum client

This section describes minimal setup to run an RPC node locally or on the server using Docker container run with docker-compose. This is solely for development purposes, it's not a production grade recommendation.

Prerequisites

Set up

  1. Verify that prerequisites are installed:

docker --version 
docker-compose --version 
curl --version

2. Create working directory

mkdir openethereum 
cd openethereum 
mkdir -p chain-data/chains

3. Create docker-compose.yaml file

cat > docker-compose.yaml << 'EOF'
version: '3.8'
services:
  openethereum:
    image: openethereum/openethereum:v3.3.5
    restart: always
    ports:
      - 8545:8545
      - 8546:8546
      - 30303:30303
      - 30303:30303/udp
    command:
      --jsonrpc-interface all --chain /config/chainspec.json
      # Uncomment this if connecting local node to MetaMask
      # --jsonrpc-cors chrome-extension://URL-OF-METAMASK
    volumes:
      - ./chain-data:/home/openethereum/.local/share/io.parity.ethereum/
      - ./chainspec-volta.json:/config/chainspec.json:ro
      # chainspec file should be changed if using EWC
      # - ./chainspec-ewc.json:/config/chainspec.json:ro
EOF

4. Download database snapshot - this takes some time and requires resources due to the size of the .tar file, but it will speed up synchronization process.

*Note that this step is optional. If you do not download the database snapshot, move to Step 6.

Volta (depending on your internet connection ~1 hour download time for us):

curl -L -C - https://chain-download.energyweb.org/volta -o ./chain-data/chains/volta.tar

Energy Web Chain (production) (30 minutes download time for us):

curl -L -C - https://chain-download.energyweb.org/ewc -o ./chain-data/chains/energywebchain.tar

5. Unpack database snapshot. This snapshot only works with OpenEthereum client.

*Note that this step is optional. If you did not complete Step 5, skip this step and move to Step 6.

Volta:

sudo tar -xvf ./chain-data/chains/volta.tar -C ./chain-data/chains

Energy Web Chain (production):

curl -L -C - https://chain-download.energyweb.org/ewc -o ./chain-data/chains/energywebchain.tar

6. Set permissions:

sudo chmod -R 777 chain-data

8. Start container:

docker-compose up -d

9. Examine logs:

docker-compose logs --tail 20 openethereum

The log output should be similar to the following (sometimes the logging output does not appear immediately, wait some time):

openethereum_1  | 2024-03-05 10:54:30 UTC Starting OpenEthereum/v3.3.5-stable/x86_64-linux-musl/rustc1.59.0
openethereum_1  | 2024-03-05 10:54:30 UTC Keys path /home/openethereum/.local/share/io.parity.ethereum/keys/Volta
openethereum_1  | 2024-03-05 10:54:30 UTC DB path /home/openethereum/.local/share/io.parity.ethereum/chains/Volta/db/d94a0a739a3e416a
openethereum_1  | 2024-03-05 10:54:30 UTC State DB configuration: fast
openethereum_1  | 2024-03-05 10:54:30 UTC Operating mode: active
openethereum_1  | 2024-03-05 10:54:30 UTC Not preparing block; cannot sign.
openethereum_1  | 2024-03-05 10:54:30 UTC Configured for Volta using AuthorityRound engine
openethereum_1  | 2024-03-05 10:54:30 UTC Signal for switch to contract-based validator set.
openethereum_1  | 2024-03-05 10:54:30 UTC Initial contract validators: [0x36f67dd84e7327c10c7ead6c429a47189798fbdc, 0x20df7a4e8408add37c6a5c4afc1b1509924619fe, 0x77901f14183b1669c80e8c6137ff6721c9a26b25]
openethereum_1  | 2024-03-05 10:54:30 UTC Listening for new connections on 127.0.0.1:8546.
openethereum_1  | 2024-03-05 10:54:35 UTC Not preparing block; cannot sign.
openethereum_1  | 2024-03-05 10:54:35 UTC Public node URL: enode://b111a66d9d0cc942abe1c728d74e8109673a1dc80a2d50be8546993c51cecd6151f2c7e3322bb6a992adcd906af5f686b8d14d8c4373aafdd02c108aeb71ab07@172.28.0.2:30303
openethereum_1  | 2024-03-05 10:54:40 UTC Syncing    #1450 0x4a2f…7898   144.03 blk/s    0.0 tx/s    0.0 Mgas/s      0+   73 Qed LI:#1524    2/25 peers    434 KiB chain  105 KiB queue  RPC:  0 conn,    0 req/s,    0 µs
openethereum_1  | 2024-03-05 10:54:45 UTC Syncing    #2097 0xdef1…082f   129.40 blk/s    0.0 tx/s    0.0 Mgas/s      0+ 2601 Qed LI:#4699    2/25 peers    767 KiB chain    4 MiB queue  RPC:  0 conn,    0 req/s,    0 µs

10. After some, you will sync with the network. Until a full sync, you will see be in a "syncing" state:

12021-11-03 15:33:42 UTC Syncing #14332274 0x2b0d...23c2 0.00 blk/s 0.0 tx/s 0.0 Mgas/s 0+ 0 Qed LI:#14332276 1/25 peers 72 KiB chain 0 bytes queue RPC: 0 conn, 0 req/s, 87 µs

curl --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545

The output will show current synchronization status:

{"jsonrpc":"2.0","result":{"currentBlock":"0xdab79f","highestBlock":"0xdac9d2","startingBlock":"0xdab172","warpChunksAmount":null,"warpChunksProcessed":null},"id":1}

It will take some time to fully sync with the current state of the blockchain. When the synchronization is finished status will be:

{"jsonrpc":"2.0","result":false,"id":1}

Additional Resources

Only can create or 'seal' new blocks on the Energy Web Chain. If you run a full local node, you will be able to validate transactions, but not create new blocks.

Your transactions are more direct and more secure. Software that provides intermediary connections to the blockchain like or are, like any other web-based software, susceptible to downtime or error. By connecting to the blockchain yourself, you are removing your dependency on external providers for secure and direct connection. You also do not expose your public keys to the browser.

You can self-verify transactions. You have part or all of the blockchain running on your node, so you can query the chain for transactions directly (and as often as you want) rather than relying on a user interface like a . Your queries can be more specific and efficient, giving you only the information that you need, for example, ‘how many transactions did addresses X, Y and Z send during this time period on each day for the last 30 days?’

You are not subject to rate limits. Infura (and therefore MetaMask, as it implements Infura to connect to the blockchain) . If your development requires a lot of requests to the blockchain, running a local node may be more efficient.

To use applications deployed on the Energy Web Chain, or to transfer tokens, you can connect to the blockchain through using a remote RPC. You can see guidance for doing that on the Volta Test Network and the Energy Web Main Network .

You need to meet OpenEthereum hardware requirements and have enough disk space to store database snapshots (which will grow in time).

The chainspec file for Volta Test Network is .

The chainspec file for Energy Web Main Network is .

1. Download the chainspec file.

Download

Full specification for OpenEthereum configuration options can be found here:

See OpenEthereum documentation for Docker:

11. Check the database synchronization status in the command line using OpenEthereum's 'eth-syncing' module:

approved validators
Infura
MetaMask
block explorer
does have rate limits for JSON RPC requests
MetaMask
here
here
here
OpenEthereum client v3.3.5
docker
docker-compose
curl
Install EWC/Volta RPC node
"Chapter 3: Ethereum Clients" from Mastering Ethereum
Nodes And Clients Ethereum Documentation
yellow paper
here
OpenEthereum
Authority Roundtable (AuRa)
here
What does it mean to run a node?
What do I need to run a node?
Benefits to Running a Local Node
Alternatives to Running a Local Node
Run a local node
Connect your local node to MetaMask
OpenEthereum - EthHub
GitHub - energywebfoundation/ewf-chainspec: EWF official chainspec repository
OpenEthereum Documentation - Configuring OpenEthereum
OpenEthereum Documentation - Docker
OpenEthereum Documentation - The `eth` Module