├── firstNode ├── geth │ ├── LOCK │ ├── nodes │ │ ├── LOCK │ │ ├── CURRENT │ │ ├── CURRENT.bak │ │ ├── 000002.ldb │ │ ├── 000003.log │ │ ├── MANIFEST-000004 │ │ └── LOG │ ├── chaindata │ │ ├── LOCK │ │ ├── CURRENT │ │ ├── CURRENT.bak │ │ ├── 000002.ldb │ │ ├── 000005.ldb │ │ ├── 000006.log │ │ ├── MANIFEST-000007 │ │ └── LOG │ ├── transactions.rlp │ ├── lightchaindata │ │ ├── LOCK │ │ ├── CURRENT │ │ ├── 000001.log │ │ ├── MANIFEST-000000 │ │ └── LOG │ └── nodekey ├── password.txt └── keystore │ └── UTC--2019-02-05T18-05-36.608572730Z--323ff270ec892875885d0d91495000edb613aaa1 ├── secondNode ├── geth │ ├── chaindata │ │ ├── LOCK │ │ ├── CURRENT │ │ ├── 000001.log │ │ ├── MANIFEST-000000 │ │ └── LOG │ └── lightchaindata │ │ ├── LOCK │ │ ├── CURRENT │ │ ├── 000001.log │ │ ├── MANIFEST-000000 │ │ └── LOG ├── password.txt └── keystore │ └── UTC--2019-02-05T18-05-58.104647161Z--4ec8d45d904370865eaf60127576612ae238eab1 ├── boot.key ├── accounts.txt ├── README.md └── genesis.json /firstNode/geth/LOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstNode/geth/nodes/LOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstNode/geth/chaindata/LOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstNode/geth/transactions.rlp: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstNode/password.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /secondNode/geth/chaindata/LOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /secondNode/password.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /firstNode/geth/lightchaindata/LOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /secondNode/geth/lightchaindata/LOCK: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /firstNode/geth/nodes/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000004 2 | -------------------------------------------------------------------------------- /firstNode/geth/chaindata/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000007 2 | -------------------------------------------------------------------------------- /firstNode/geth/nodes/CURRENT.bak: -------------------------------------------------------------------------------- 1 | MANIFEST-000000 2 | -------------------------------------------------------------------------------- /secondNode/geth/chaindata/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000000 2 | -------------------------------------------------------------------------------- /firstNode/geth/chaindata/CURRENT.bak: -------------------------------------------------------------------------------- 1 | MANIFEST-000004 2 | -------------------------------------------------------------------------------- /firstNode/geth/lightchaindata/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000000 2 | -------------------------------------------------------------------------------- /secondNode/geth/lightchaindata/CURRENT: -------------------------------------------------------------------------------- 1 | MANIFEST-000000 2 | -------------------------------------------------------------------------------- /boot.key: -------------------------------------------------------------------------------- 1 | 2ff10138956ed292ceceb15ff4fcd4fa7a1b4aec26dbf5f14a256c7d867c2828 -------------------------------------------------------------------------------- /firstNode/geth/nodekey: -------------------------------------------------------------------------------- 1 | bc22d6bc6177d67a1e2a5e2f6c2811a231be1f29a60463d9bdf48896afe546b5 -------------------------------------------------------------------------------- /accounts.txt: -------------------------------------------------------------------------------- 1 | node1: 323ff270ec892875885d0d91495000edb613aaa1 2 | node2: 4ec8d45d904370865eaf60127576612ae238eab1 3 | -------------------------------------------------------------------------------- /firstNode/geth/nodes/000002.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/nodes/000002.ldb -------------------------------------------------------------------------------- /firstNode/geth/nodes/000003.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/nodes/000003.log -------------------------------------------------------------------------------- /firstNode/geth/chaindata/000002.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/chaindata/000002.ldb -------------------------------------------------------------------------------- /firstNode/geth/chaindata/000005.ldb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/chaindata/000005.ldb -------------------------------------------------------------------------------- /firstNode/geth/chaindata/000006.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/chaindata/000006.log -------------------------------------------------------------------------------- /firstNode/geth/nodes/MANIFEST-000004: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/nodes/MANIFEST-000004 -------------------------------------------------------------------------------- /secondNode/geth/chaindata/000001.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/secondNode/geth/chaindata/000001.log -------------------------------------------------------------------------------- /firstNode/geth/chaindata/MANIFEST-000007: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/chaindata/MANIFEST-000007 -------------------------------------------------------------------------------- /firstNode/geth/lightchaindata/000001.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/lightchaindata/000001.log -------------------------------------------------------------------------------- /secondNode/geth/chaindata/MANIFEST-000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/secondNode/geth/chaindata/MANIFEST-000000 -------------------------------------------------------------------------------- /secondNode/geth/lightchaindata/000001.log: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/secondNode/geth/lightchaindata/000001.log -------------------------------------------------------------------------------- /firstNode/geth/lightchaindata/MANIFEST-000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/firstNode/geth/lightchaindata/MANIFEST-000000 -------------------------------------------------------------------------------- /secondNode/geth/lightchaindata/MANIFEST-000000: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rohitsethii/Private-Ethereum-POA/HEAD/secondNode/geth/lightchaindata/MANIFEST-000000 -------------------------------------------------------------------------------- /secondNode/geth/chaindata/LOG: -------------------------------------------------------------------------------- 1 | =============== Feb 5, 2019 (IST) =============== 2 | 23:41:48.728592 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 3 | 23:41:48.733320 db@open opening 4 | 23:41:48.733875 version@stat F·[] S·0B[] Sc·[] 5 | 23:41:48.743002 db@janitor F·2 G·0 6 | 23:41:48.743107 db@open done T·9.7256ms 7 | -------------------------------------------------------------------------------- /firstNode/geth/lightchaindata/LOG: -------------------------------------------------------------------------------- 1 | =============== Feb 5, 2019 (IST) =============== 2 | 23:41:35.407622 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 3 | 23:41:35.413104 db@open opening 4 | 23:41:35.413608 version@stat F·[] S·0B[] Sc·[] 5 | 23:41:35.422728 db@janitor F·2 G·0 6 | 23:41:35.422791 db@open done T·9.646728ms 7 | -------------------------------------------------------------------------------- /secondNode/geth/lightchaindata/LOG: -------------------------------------------------------------------------------- 1 | =============== Feb 5, 2019 (IST) =============== 2 | 23:41:48.771570 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 3 | 23:41:48.776660 db@open opening 4 | 23:41:48.776911 version@stat F·[] S·0B[] Sc·[] 5 | 23:41:48.785208 db@janitor F·2 G·0 6 | 23:41:48.785232 db@open done T·8.550783ms 7 | -------------------------------------------------------------------------------- /firstNode/keystore/UTC--2019-02-05T18-05-36.608572730Z--323ff270ec892875885d0d91495000edb613aaa1: -------------------------------------------------------------------------------- 1 | {"address":"323ff270ec892875885d0d91495000edb613aaa1","crypto":{"cipher":"aes-128-ctr","ciphertext":"b8b951cce8085cf5c31179f926a34c62b2f9ba189d16283574514e8d47830a53","cipherparams":{"iv":"501e84285fc16a1852793c9d231339c0"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"67f4401a5936dd8cd7ae08e48a83fad446da7c2ca8e08ad89a530b8dc0b2ee72"},"mac":"5e06389e919d50e4400b873ca554b728295883d78b69fe7551ffbf3fa205dfa9"},"id":"9ae8f0db-12f7-4b39-a0b0-f5ce3cdb8d1e","version":3} -------------------------------------------------------------------------------- /secondNode/keystore/UTC--2019-02-05T18-05-58.104647161Z--4ec8d45d904370865eaf60127576612ae238eab1: -------------------------------------------------------------------------------- 1 | {"address":"4ec8d45d904370865eaf60127576612ae238eab1","crypto":{"cipher":"aes-128-ctr","ciphertext":"a8de667f782ecf69ae2d16b3e6e2edcbd4bacb34b77513abf188fbd86487dfea","cipherparams":{"iv":"1c511257458ecbd0d10314bb8a1969d3"},"kdf":"scrypt","kdfparams":{"dklen":32,"n":262144,"p":1,"r":8,"salt":"c7136d31a56650f0b2d96cfdacd2be9c0658427aec94264293de59447b6d5e55"},"mac":"e14999787d1c1d2040d8ec52209cd70dc9ebb7222f6e75601d79edd7fa95ad7b"},"id":"80ed6191-4f01-4d03-8bd7-38eb6d84897b","version":3} -------------------------------------------------------------------------------- /firstNode/geth/nodes/LOG: -------------------------------------------------------------------------------- 1 | =============== Feb 5, 2019 (IST) =============== 2 | 23:45:30.317266 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 3 | 23:45:30.321912 db@open opening 4 | 23:45:30.322235 version@stat F·[] S·0B[] Sc·[] 5 | 23:45:30.331931 db@janitor F·2 G·0 6 | 23:45:30.331999 db@open done T·10.062085ms 7 | =============== Feb 5, 2019 (IST) =============== 8 | 23:46:23.551262 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 9 | 23:46:23.551377 version@stat F·[] S·0B[] Sc·[] 10 | 23:46:23.551385 db@open opening 11 | 23:46:23.551419 journal@recovery F·1 12 | 23:46:23.551504 journal@recovery recovering @1 13 | 23:46:23.553905 memdb@flush created L0@2 N·4 S·258B "n:\x1e..seq,v2":"version,v1" 14 | 23:46:23.554331 version@stat F·[1] S·258B[258B] Sc·[0.25] 15 | 23:46:23.573949 db@janitor F·3 G·0 16 | 23:46:23.574052 db@open done T·22.65121ms 17 | 23:46:56.025673 db@close closing 18 | 23:46:56.025926 db@close done T·245.778µs 19 | -------------------------------------------------------------------------------- /firstNode/geth/chaindata/LOG: -------------------------------------------------------------------------------- 1 | =============== Feb 5, 2019 (IST) =============== 2 | 23:41:35.372221 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 3 | 23:41:35.378331 db@open opening 4 | 23:41:35.386215 version@stat F·[] S·0B[] Sc·[] 5 | 23:41:35.389162 db@janitor F·2 G·0 6 | 23:41:35.389213 db@open done T·10.840552ms 7 | =============== Feb 5, 2019 (IST) =============== 8 | 23:45:30.235029 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 9 | 23:45:30.235167 version@stat F·[] S·0B[] Sc·[] 10 | 23:45:30.235173 db@open opening 11 | 23:45:30.235205 journal@recovery F·1 12 | 23:45:30.236917 journal@recovery recovering @1 13 | 23:45:30.241538 memdb@flush created L0@2 N·625 S·50KiB "\x02d\xfc..\x19Ba,v434":"\xfe\x88\xcf..H\xef\xcc,v367" 14 | 23:45:30.243744 version@stat F·[1] S·50KiB[50KiB] Sc·[0.25] 15 | 23:45:30.260085 db@janitor F·3 G·0 16 | 23:45:30.260136 db@open done T·24.937648ms 17 | =============== Feb 5, 2019 (IST) =============== 18 | 23:46:23.452014 log@legend F·NumFile S·FileSize N·Entry C·BadEntry B·BadBlock Ke·KeyError D·DroppedEntry L·Level Q·SeqNum T·TimeElapsed 19 | 23:46:23.452144 version@stat F·[1] S·50KiB[50KiB] Sc·[0.25] 20 | 23:46:23.452153 db@open opening 21 | 23:46:23.452194 journal@recovery F·1 22 | 23:46:23.454138 journal@recovery recovering @3 23 | 23:46:23.463430 memdb@flush created L0@5 N·3 S·494B "Dat..ion,v627":"cli..\x1a8u,v629" 24 | 23:46:23.470328 version@stat F·[2] S·51KiB[51KiB] Sc·[0.50] 25 | 23:46:23.485720 db@janitor F·4 G·0 26 | 23:46:23.485801 db@open done T·33.629431ms 27 | 23:46:56.023296 db@close closing 28 | 23:46:56.023581 db@close done T·274.026µs 29 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Private-Ethereum-POA 2 | Step by step guide to setup Ethereum POA private chain 3 | 4 | #### Steps to setup a POA chain 5 | 6 | ##### Set up accounts 7 | 8 | ```sh 9 | geth --datadir firstNode/ account new 10 | geth --datadir secondNode/ account new 11 | ``` 12 | 13 | ##### store the addresses in a file: accounts.txt 14 | 15 | ``` 16 | echo 'node1: 323ff270ec892875885d0d91495000edb613aaa1' >> accounts.txt 17 | echo 'node2: 4ec8d45d904370865eaf60127576612ae238eab1' >> accounts.txt 18 | ``` 19 | 20 | ##### save your passwords in a file: 21 | 22 | ``` 23 | echo 'your password' > firstNode/password.txt 24 | echo 'your password' > secondNode/password.txt 25 | ``` 26 | 27 | ##### Genesis file 28 | 29 | Create Genesis file using puppeth (or use the same as here).It is highly recommended to allocate some ethers to a couple of addresses in the genesis file, otherwise you’ll not be able to pay for your transactions. 30 | 31 | 32 | ##### Initialize your nodes: 33 | 34 | ``` 35 | geth --datadir firstNode/ init genesis.json 36 | geth --datadir secondNode/ init genesis.json 37 | ``` 38 | 39 | ##### Create a bootnode 40 | 41 | The purpose of bootnode is to help nodes discover each other. The bootnode is usually ran on a static IP and thus acts like a cluster where nodes know they will find others. 42 | 43 | ``` 44 | bootnode -genkey boot.key 45 | ``` 46 | 47 | ##### Script running on boot-node 48 | 49 | ``` 50 | bootnode -nodekey boot.key -verbosity 9 -addr :43011 51 | ``` 52 | 53 | ##### open 2nd terminal and run following command with suggested changes: 54 | 55 | ``` 56 | geth --datadir firstNode/ --syncmode 'full' --port 30311 --rpc --rpcaddr 'localhost' --rpcport 8501 --rpcapi 'personal,db,eth,net,web3,txpool,miner' --bootnodes 'enode://3ec4fef2d726c2c01f16f0a0030f15dd5a81e274067af2b2157cafbf76aa79fa9c0be52c6664e80cc5b08162ede53279bd70ee10d024fe86613b0b09e1106c40@127.0.0.1:43011' --networkid 1515 --gasprice '1' -unlock '0x323ff270ec892875885d0d91495000edb613aaa1' --password firstNode/password.txt --mine 57 | ``` 58 | 59 | * Replace --bootnode value with yours and enter your IP address. 60 | * Replace --unlock value by your firstNode account 61 | 62 | 63 | ##### open 3nd terminal and run following command with suggested changes: 64 | 65 | ``` 66 | geth --datadir node2/ --syncmode 'full' --port 30312 --rpc --rpcaddr 'localhost' --rpcport 8502 --rpcapi 'personal,db,eth,net,web3,txpool,miner' --bootnodes 'enode://3ec4fef2d726c2c01f16f0a0030f15dd5a81e274067af2b2157cafbf76aa79fa9c0be52c6664e80cc5b08162ede53279bd70ee10d024fe86613b0b09e1106c40@127.0.0.1:43011' --networkid 1515 --gasprice '0' --unlock '0x4ec8d45d904370865eaf60127576612ae238eab1' --password secondNode/password.txt --mine 67 | ``` 68 | 69 | * Replace --unlock value by your secondNode account. 70 | * Replace --bootnode value with yours and enter your IP address. 71 | -------------------------------------------------------------------------------- /genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "config": { 3 | "chainId": 1515, 4 | "homesteadBlock": 1, 5 | "eip150Block": 2, 6 | "eip150Hash": "0x0000000000000000000000000000000000000000000000000000000000000000", 7 | "eip155Block": 3, 8 | "eip158Block": 3, 9 | "byzantiumBlock": 4, 10 | "clique": { 11 | "period": 4, 12 | "epoch": 30000 13 | } 14 | }, 15 | "nonce": "0x0", 16 | "timestamp": "0x5abb1f4d", 17 | "extraData": "0x000000000000000000000000000000000000000000000000000000000000000016840ac9184e40f8e126af14b742c7bb6430dff966e7bf255b61529259e19219be08fd5ee1704bd30000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", 18 | "gasLimit": "0x47b760", 19 | "difficulty": "0x1", 20 | "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000", 21 | "coinbase": "0x0000000000000000000000000000000000000000", 22 | "alloc": { 23 | "0000000000000000000000000000000000000000": { 24 | "balance": "0x1" 25 | }, 26 | "0000000000000000000000000000000000000001": { 27 | "balance": "0x1" 28 | }, 29 | "0000000000000000000000000000000000000002": { 30 | "balance": "0x1" 31 | }, 32 | "0000000000000000000000000000000000000003": { 33 | "balance": "0x1" 34 | }, 35 | "0000000000000000000000000000000000000004": { 36 | "balance": "0x1" 37 | }, 38 | "0000000000000000000000000000000000000005": { 39 | "balance": "0x1" 40 | }, 41 | "0000000000000000000000000000000000000006": { 42 | "balance": "0x1" 43 | }, 44 | "0000000000000000000000000000000000000007": { 45 | "balance": "0x1" 46 | }, 47 | "0000000000000000000000000000000000000008": { 48 | "balance": "0x1" 49 | }, 50 | "0000000000000000000000000000000000000009": { 51 | "balance": "0x1" 52 | }, 53 | "000000000000000000000000000000000000000a": { 54 | "balance": "0x1" 55 | }, 56 | "000000000000000000000000000000000000000b": { 57 | "balance": "0x1" 58 | }, 59 | "000000000000000000000000000000000000000c": { 60 | "balance": "0x1" 61 | }, 62 | "000000000000000000000000000000000000000d": { 63 | "balance": "0x1" 64 | }, 65 | "000000000000000000000000000000000000000e": { 66 | "balance": "0x1" 67 | }, 68 | "000000000000000000000000000000000000000f": { 69 | "balance": "0x1" 70 | }, 71 | "0000000000000000000000000000000000000010": { 72 | "balance": "0x1" 73 | }, 74 | "0000000000000000000000000000000000000011": { 75 | "balance": "0x1" 76 | }, 77 | "0000000000000000000000000000000000000012": { 78 | "balance": "0x1" 79 | }, 80 | "0000000000000000000000000000000000000013": { 81 | "balance": "0x1" 82 | }, 83 | "0000000000000000000000000000000000000014": { 84 | "balance": "0x1" 85 | }, 86 | "0000000000000000000000000000000000000015": { 87 | "balance": "0x1" 88 | }, 89 | "0000000000000000000000000000000000000016": { 90 | "balance": "0x1" 91 | }, 92 | "0000000000000000000000000000000000000017": { 93 | "balance": "0x1" 94 | }, 95 | "0000000000000000000000000000000000000018": { 96 | "balance": "0x1" 97 | }, 98 | "0000000000000000000000000000000000000019": { 99 | "balance": "0x1" 100 | }, 101 | "000000000000000000000000000000000000001a": { 102 | "balance": "0x1" 103 | }, 104 | "000000000000000000000000000000000000001b": { 105 | "balance": "0x1" 106 | }, 107 | "000000000000000000000000000000000000001c": { 108 | "balance": "0x1" 109 | }, 110 | "000000000000000000000000000000000000001d": { 111 | "balance": "0x1" 112 | }, 113 | "000000000000000000000000000000000000001e": { 114 | "balance": "0x1" 115 | }, 116 | "000000000000000000000000000000000000001f": { 117 | "balance": "0x1" 118 | }, 119 | "0000000000000000000000000000000000000020": { 120 | "balance": "0x1" 121 | }, 122 | "323ff270ec892875885d0d91495000edb613aaa1": { 123 | "balance": "0x200000000000000000000000000000000000000000000000000000000000000" 124 | }, 125 | "4ec8d45d904370865eaf60127576612ae238eab1": { 126 | "balance": "0x200000000000000000000000000000000000000000000000000000000000000" 127 | } 128 | }, 129 | "number": "0x0", 130 | "gasUsed": "0x0", 131 | "parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000" 132 | } --------------------------------------------------------------------------------