Run a Local RPC Node
Run a full instance of the blockchain on your machine
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 yellow paper, 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 here), 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 OpenEthereum client (formally known as Parity), because it supports the Authority Roundtable (AuRa), 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 here.
Only approved validators 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.
Benefits to Running a Local Node
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.
Your transactions are more direct and more secure. Software that provides intermediary connections to the blockchain like Infura or MetaMask 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 block explorer. 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) does have rate limits for JSON RPC requests. If your development requires a lot of requests to the blockchain, running a local node may be more efficient.
Alternatives to Running a Local Node
Running a local node is not necessary to use applications that run on the blockchain or transfer tokens.
To use applications deployed on the Energy Web Chain, or to transfer tokens, you can connect to the blockchain through MetaMask using a remote RPC. You can see guidance for doing that on the Volta Test Network and the Energy Web Main Network here.
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:
The chainspec file for Volta Test Network is here.
The chainspec file for Energy Web Main Network is here.
Volta Testnet chainspec:
Energy Web Chain (production) chainspec:
Using OpenEthereum Client
Download OpenEthereum client v3.3.5
Full specification for OpenEthereum configuration options can be found here: OpenEthereum Documentation - Configuring OpenEthereum
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.
Your local node should start:
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
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.
See OpenEthereum documentation for Docker: OpenEthereum Documentation - Docker
Prerequisites
Set up
Verify that prerequisites are installed:
2. Create working directory
3. Create docker-compose.yaml file
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):
Energy Web Chain (production) (30 minutes download time for us):
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:
Energy Web Chain (production):
6. Set permissions:
8. Start container:
9. Examine logs:
The log output should be similar to the following (sometimes the logging output does not appear immediately, wait some time):
10. After some, you will sync with the network. Until a full sync, you will see be in a "syncing" state:
11. Check the database synchronization status in the command line using OpenEthereum's 'eth-syncing' module: OpenEthereum Documentation - The `eth` Module
The output will show current synchronization status:
It will take some time to fully sync with the current state of the blockchain. When the synchronization is finished status will be:
Additional Resources
Last updated