Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
In this section, we'll walk through how to connect to the Energy Web blockchain, and the Volta testnet using the MetaMask browser extension.
The Ethereum Name Service is available on Energy Web Chain and Volta Testnet
pragma solidity >=0.4.0 <0.7.0;
contract SimpleReturn {
function get() public pure returns (string) {
return "Volta";
}
}import { providers, Signer, utils, errors, Wallet } from "ethers";
const { JsonRpcProvider } = providers;
this._provider = new JsonRpcProvider({ url: rpcUrl });//pass in the smart contract address, smart contract ABI, provider:
this._contract = new Contract(settings.address, this.settings.abi, this._provider); try {
valid = await this._contract.validDelegate(identityAddress, bytesType, delegateAddress);
} catch (error) {
throw new Error(error);
}chmod +x nethermind
# To run a Full node
./nethermind --config volta
# To run an Archive node
./nethermind --config volta_archive# To run a Full node
./nethermind --config energyweb
# To run an Archive node
./nethermind --config energyweb_archive2024-03-05 13-54-12.2501|Nethermind starting initialization.
2024-03-05 13-54-12.2939|Client version: Nethermind/v1.25.4+20b10b35/linux-x64/dotnet8.0.2
2024-03-05 13-54-12.2980|Loading embedded plugins
2024-03-05 13-54-12.2981| Found plugin type Nethermind.Consensus.AuRa.AuRaPlugin
2024-03-05 13-54-12.2982| Found plugin type Nethermind.Consensus.Clique.CliquePlugin
2024-03-05 13-54-12.2983| Found plugin type Nethermind.Consensus.Ethash.EthashPlugin
2024-03-05 13-54-12.2983| Found plugin type Nethermind.Consensus.Ethash.NethDevPlugin
2024-03-05 13-54-12.2983| Found plugin type Nethermind.Hive.HivePlugin
2024-03-05 13-54-12.2983| Found plugin type Nethermind.UPnP.Plugin.UPnPPlugin
Resolved executing directory as /home/ubuntu/neth/nethermind-1.25.4.
2024-03-05 13-54-12.3211|Loading 12 assemblies from /home/ubuntu/neth/nethermind-1.25.4/plugins
2024-03-05 13-54-12.3212|Loading assembly Nethermind.Init
2024-03-05 13-54-12.3230|Loading assembly Nethermind.Merge.AuRa
2024-03-05 13-54-12.3254| Found plugin type Nethermind.Merge.AuRa
2024-03-05 13-54-12.3255|Loading assembly Nethermind.HealthChecks
2024-03-05 13-54-12.3270| Found plugin type Nethermind.HealthChecks
2024-03-05 13-54-12.3271|Loading assembly Nethermind.EthStats
2024-03-05 13-54-12.3276| Found plugin type Nethermind.EthStats
2024-03-05 13-54-12.3277|Loading assembly Nethermind.Consensus.AuRa
2024-03-05 13-54-12.3315|Loading assembly Nethermind.Optimism
2024-03-05 13-54-12.3330| Found plugin type Nethermind.Optimism
2024-03-05 13-54-12.3331|Loading assembly Nethermind.JsonRpc.TraceStore
2024-03-05 13-54-12.3338| Found plugin type Nethermind.JsonRpc.TraceStore
2024-03-05 13-54-12.3338|Loading assembly Nethermind.Mev
2024-03-05 13-54-12.3361| Found plugin type Nethermind.Mev
2024-03-05 13-54-12.3361|Loading assembly Nethermind.Init.Snapshot
2024-03-05 13-54-12.3365| Found plugin type Nethermind.Init.Snapshot
2024-03-05 13-54-12.3366|Loading assembly Nethermind.Merge.Plugin
2024-03-05 13-54-12.3393| Found plugin type Nethermind.Merge.Plugin
2024-03-05 13-54-12.3394|Loading assembly Nethermind.AccountAbstraction
2024-03-05 13-54-12.3419| Found plugin type Nethermind.AccountAbstraction
2024-03-05 13-54-12.3420|Loading assembly Nethermind.Api
2024-03-05 13-54-12.4062|Loading standard NLog.config file from /home/ubuntu/neth/nethermind-1.25.4/NLog.config.
2024-03-05 13-54-12.4908|NLog.config loaded in 83ms.
2024-03-05 13-54-12.4915|Reading config file from /home/ubuntu/neth/nethermind-1.25.4/configs/volta.cfg
2024-03-05 13-54-12.5428|Configuration initialized.
05 Mar 13:54:12 | RocksDb Version: 8.3.2
05 Mar 13:54:12 | Loading chainspec from embedded resources: /home/ubuntu/neth/nethermind-1.25.4/chainspec/volta.json
05 Mar 13:54:12 | CPU: (CT)
05 Mar 13:54:12 | Using http://ipv4.icanhazip.com to get external ip
05 Mar 13:54:12 | Setting up memory allowances
05 Mar 13:54:12 | Memory hint: 768 MB
05 Mar 13:54:12 | General memory: 32 MB
05 Mar 13:54:12 | Peers memory: 25 MB
05 Mar 13:54:12 | Netty memory: 134 MB
05 Mar 13:54:12 | Mempool memory: 110 MB
05 Mar 13:54:12 | Fast blocks memory: 46 MB
05 Mar 13:54:12 | Trie memory: 83 MB
05 Mar 13:54:12 | DB memory: 335 MB
05 Mar 13:54:12 | Generating private key for the node (no node key in configuration) - stored in plain + key store for JSON RPC unlocking
05 Mar 13:54:14 | Store this password for unlocking the node key for JSON RPC - this is not secure - this log message will be in your log files. Use only in DEV contexts.
05 Mar 13:54:16 | Block tree initialized, last processed is 0, best queued is 0, best known is 0, lowest inserted header , body , lowest sync inserted block number
05 Mar 13:54:16 | Initializing 15 plugins
05 Mar 13:54:16 | Clique by Nethermind
05 Mar 13:54:16 | Clique by Nethermind initialized in 0ms
05 Mar 13:54:16 | AuRa by Nethermind
05 Mar 13:54:16 | AuRa by Nethermind initialized in 0ms
05 Mar 13:54:16 | Ethash by Nethermind
05 Mar 13:54:16 | Ethash by Nethermind initialized in 0ms
05 Mar 13:54:16 | Optimism by Nethermind
05 Mar 13:54:16 | Optimism by Nethermind initialized in 0ms
05 Mar 13:54:16 | NethDev by Nethermind
05 Mar 13:54:16 | NethDev by Nethermind initialized in 0ms
05 Mar 13:54:16 | AuRaMerge by Nethermind
05 Mar 13:54:16 | AuRaMerge by Nethermind initialized in 0ms
05 Mar 13:54:16 | Merge by Nethermind
05 Mar 13:54:16 | Merge by Nethermind initialized in 2ms
05 Mar 13:54:16 | MEV by Nethermind
05 Mar 13:54:16 | MEV by Nethermind initialized in 0ms
05 Mar 13:54:16 | HealthChecks by Nethermind
05 Mar 13:54:16 | HealthChecks by Nethermind initialized in 1ms
05 Mar 13:54:16 | Hive by Nethermind
05 Mar 13:54:16 | Hive by Nethermind initialized in 0ms
05 Mar 13:54:16 | Account Abstraction by Nethermind
05 Mar 13:54:16 | Account Abstraction Plugin: User Operation Mining Disabled
05 Mar 13:54:16 | Account Abstraction by Nethermind initialized in 0ms
05 Mar 13:54:16 | EthStats by Nethermind
05 Mar 13:54:16 | EthStats by Nethermind initialized in 0ms
05 Mar 13:54:16 | Snapshot by Nethermind
05 Mar 13:54:16 | Snapshot by Nethermind initialized in 0ms
05 Mar 13:54:16 | TraceStore by Nethermind
05 Mar 13:54:16 | TraceStore by Nethermind initialized in 0ms
05 Mar 13:54:16 | UPnP by Nethermind
05 Mar 13:54:16 | UPnP by Nethermind initialized in 0ms
05 Mar 13:54:16 | Loaded 0 static nodes from file: /home/ubuntu/neth/nethermind-1.25.4/Data/static-nodes.json
05 Mar 13:54:16 | Skipping Account Abstraction network protocol
05 Mar 13:54:16 | Now syncing nodes starting from root of block 0
05 Mar 13:54:16 | No block tree levels to review for fixes. All fine.
05 Mar 13:54:16 | Numbers resolved, level = Max(0, 0), header = Max(0, 0), body = Max(0, 0)
05 Mar 13:54:16 | Beacon Numbers resolved, level = 0, header = 0, body = 0
05 Mar 13:54:16 | Loading fork choice info
05 Mar 13:54:16 | Grafana / Prometheus metrics are disabled in configuration
05 Mar 13:54:16 | System.Diagnostics.Metrics disabled
05 Mar 13:54:16 | Skipping Flashbots RPC plugin
05 Mar 13:54:16 | Skipping Account Abstraction RPC plugin
05 Mar 13:54:16 | Json RPC is disabled
05 Mar 13:54:16 |
======================== Nethermind initialization completed ========================
This node : enode://15ec8f735368cf809735071cd607ee8e12fe86bbbc99c14161272c8a2253d4a7cf063d46b9cd201735011ae008687175b504bdcf45f8f20605a763d39b951044@15.188.207.110:30303
Node address : 0x1dc9ca5452806e178959506e100300d3566ec79f (do not use as an account)
Mem est tx : 40 MB
Mem est DB : 8 MB
Genesis hash : 0xebd8b413ca7b7f84a8dd20d17519ce2b01954c74d94a0a739a3e416abe0e43e5
External IP : 15.188.207.110
Ethereum : tcp://15.188.207.110:30303
Discovery : udp://15.188.207.110:30303
Client id : Nethermind/v1.25.4+20b10b35/linux-x64/dotnet8.0.2
Chainspec : chainspec/volta.json
Chain head : 0
Chain ID : Volta
=====================================================================================
05 Mar 13:54:17 | Changing state Disconnected to FastHeaders at processed: 0 | state: 0 | block: 0 | header: 0 | target block: 26907152 | peer block: 26907152
05 Mar 13:54:17 | Sync mode changed from Disconnected to FastHeaders
05 Mar 13:54:17 | Connected to 2 bootnodes, 7 trusted/persisted nodes
05 Mar 13:54:20 | Changing state FastHeaders to FastSync, FastHeaders at processed: 0 | state: 0 | block: 0 | header: 26680000 | target block: 26907153 | peer block: 26907153
05 Mar 13:54:20 | Sync mode changed from FastHeaders to FastSync, FastHeaders
05 Mar 13:54:21 | Peers | with best block: 2 | all: 2 | eth66 (100 %) | Active: 2 Headers, 1 Bodies, 1 Receipts, 1 Blocks | Sleeping: None | OpenEthereum (100 %)
05 Mar 13:54:21 | Old Headers 2,560 / 26,680,000 ( 0.01 %) | queue 2,048 | current 0 Blk/s | total 640 Blk/s
05 Mar 13:54:25 | Discovered new block 26907154 13:54:25 (0xbf2c2c...21b348), tx count: 0 miner 0xe6c064719623c5bc62ef51caa4639416f8634ab6, sent by [Peer|eth66|26907154| 3.121.165.10:30303| Out], with AuRa step 341929373
05 Mar 13:54:26 | Old Headers 6,144 / 26,680,000 ( 0.02 %) | queue 0 | current 717 Blk/s | total 683 Blk/s
05 Mar 13:54:26 | Downloaded 26,680,637 / 26,907,154 ( 99.16 %) | current 0 Blk/s | total 128 Blk/s
05 Mar 13:54:30 | Discovered new block 26907155 13:54:30 (0x702e54...a3e29f), tx count: 0 miner 0xc09e63b27775508b6599daf3b6dcbe09cf3f82ac, sent by [Peer|eth66|26907155| 3.121.165.10:30303| Out], with AuRa step 341929374
05 Mar 13:54:31 | Old Headers 8,192 / 26,680,000 ( 0.03 %) | queue 0 | current 410 Blk/s | total 585 Blk/s
05 Mar 13:54:31 | Downloaded 26,681,653 / 26,907,155 ( 99.16 %) | current 203 Blk/s | total 167 Blk/s
05 Mar 13:54:35 | Discovered new block 26907156 13:54:35 (0xa73994...be656b), tx count: 0 miner 0x20ea864187c1c1eaa613726ed4d211244209503c, sent by [Peer|eth66|26907156| 3.121.165.10:30303| Out], with AuRa step 341929375
05 Mar 13:54:36 | Old Headers 9,728 / 26,680,000 ( 0.04 %) | queue 0 | current 307 Blk/s | total 512 Blk/s
05 Mar 13:54:36 | Downloaded 26,682,669 / 26,907,156 ( 99.17 %) | current 203 Blk/s | total 179 Blk/s
docker --version
docker-compose --version mkdir data_dircat > docker-compose.yaml << 'EOF'
version: '3.8'
services:
nethermind:
image: nethermind/nethermind:1.25.4
restart: always
command:
--config volta -dd /nethermind/data_dir
# For EnergyWebChain network
# --config energyweb -dd /nethermind/data_dir
volumes:
- ./data_dir:/nethermind/data_dir
ports:
- 8545:8545
- 8546:8546
- 30303:30303
- 30303:30303/udp
EOFdocker-compose up -ddocker-compose logs --tail 20 nethermindnethermind_1 | Mem est tx : 40 MB
nethermind_1 | Mem est DB : 8 MB
nethermind_1 | Genesis hash : 0xebd8b413ca7b7f84a8dd20d17519ce2b01954c74d94a0a739a3e416abe0e43e5
nethermind_1 | External IP : 15.188.207.110
nethermind_1 | Ethereum : tcp://15.188.207.110:30303
nethermind_1 | Discovery : udp://15.188.207.110:30303
nethermind_1 | Client id : Nethermind/v1.25.4+20b10b35/linux-x64/dotnet8.0.2
nethermind_1 | Chainspec : chainspec/volta.json
nethermind_1 | Chain head : 0 (0xebd8b4...0e43e5)
nethermind_1 | Chain ID : Volta
nethermind_1 | =====================================================================================
nethermind_1 | 05 Mar 13:57:50 | Changing state Disconnected to FastSync, FastHeaders at processed: 0 | state: 0 | block: 26696639 | header: 26696639 | target block: 26907183 | peer block: 26907183
nethermind_1 | 05 Mar 13:57:50 | Sync mode changed from Disconnected to FastSync, FastHeaders
nethermind_1 | 05 Mar 13:57:51 | Connected to 2 bootnodes, 4 trusted/persisted nodes
nethermind_1 | 05 Mar 13:57:54 | Peers | with best block: 2 | all: 2 | eth66 (100 %) | Active: 2 Headers, 1 Bodies, 1 Receipts, 1 Blocks | Sleeping: None | OpenEthereum (100 %)
nethermind_1 | 05 Mar 13:57:54 | Old Headers 122,368 / 26,680,000 ( 0.46 %) | queue 0 | current 0 Blk/s | total 30,593 Blk/s
nethermind_1 | 05 Mar 13:57:54 | Downloaded 26,697,149 / 26,907,183 ( 99.22 %) | current 0 Blk/s | total 131 Blk/s
nethermind_1 | 05 Mar 13:57:59 | Old Headers 130,048 / 26,680,000 ( 0.49 %) | queue 0 | current 1,537 Blk/s | total 14,454 Blk/s
nethermind_1 | 05 Mar 13:57:59 | Downloaded 26,698,165 / 26,907,184 ( 99.22 %) | current 203 Blk/s | total 173 Blk/s
nethermind_1 | 05 Mar 13:58:00 | Discovered new block 26907185 13:58:00 (0x03214c...f02603), tx count: 0 miner 0x20ea864187c1c1eaa613726ed4d211244209503c, sent by [Peer|eth66|26907185| 3.121.165.10:30303| Out], with AuRa step 341929416 
Incorporate external data sources into your smart contracts













Run a full instance of the blockchain on your machine



curl -L https://raw.githubusercontent.com/energywebfoundation/ewf-chainspec/master/Volta.json -o chainspec-volta.jsoncurl -L https://raw.githubusercontent.com/energywebfoundation/ewf-chainspec/master/EnergyWebChain.json -o chainspec-ewc.jsonchmod +x openethereum
./openethereum --chain /path/to/chainconfig/Volta.json2024-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 µsopenethereum --chain path/to/chainconfig/Volta.json --jsonrpc-cors METAMASK URL docker --version
docker-compose --version
curl --versionmkdir openethereum
cd openethereum
mkdir -p chain-data/chainscat > 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
EOFcurl -L -C - https://chain-download.energyweb.org/volta -o ./chain-data/chains/volta.tarcurl -L -C - https://chain-download.energyweb.org/ewc -o ./chain-data/chains/energywebchain.tarsudo tar -xvf ./chain-data/chains/volta.tar -C ./chain-data/chainscurl -L -C - https://chain-download.energyweb.org/ewc -o ./chain-data/chains/energywebchain.tarsudo chmod -R 777 chain-datadocker-compose up -ddocker-compose logs --tail 20 openethereumopenethereum_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
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 µscurl --data '{"method":"eth_syncing","params":[],"id":1,"jsonrpc":"2.0"}' -H "Content-Type: application/json" -X POST localhost:8545{"jsonrpc":"2.0","result":{"currentBlock":"0xdab79f","highestBlock":"0xdac9d2","startingBlock":"0xdab172","warpChunksAmount":null,"warpChunksProcessed":null},"id":1}{"jsonrpc":"2.0","result":false,"id":1}


