Académique Documents
Professionnel Documents
Culture Documents
1 - Setting up a private Ethereum blockchain with two nodes (or more) and VmWare
D. Create a new folder on both virtual machines, called it “Ethereum”, and inside that folder
another one, called it “datadir”
E. Create a new file inside Ethereum folder, called it “genesis.json” with the next content:
{
"nonce": "0xdeadbeefdeadbeef",
"timestamp": "0x0",
"parentHash":
"0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x0",
"gasLimit": "0x8000000",
"difficulty": "0x400",
"mixhash":
"0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"alloc": {
}
}
Where:
2. Use datadir folder to put your all the necessary data about the private
3. Use a network id other than ‘1’ to ensure we can’t talk to nodes from the main network –
“connections between nodes are valid only if peers have identical protocol version and network id”
5. Set a maximum of 1 peers (or more if you want to use more peers)
6. Starts geth in console mode so you can interact with your new blockchain / node
For example:
G. Create Accounts
Once geth is up and you get a console, create your own account with the following command:
2 - Setting up a private Ethereum blockchain with two nodes (or more) and VmWare
>personal.newAccount("mypass");
Where “mypass” is your desired password. You get as answer for example:
'0xd47eaceb073dc03e3330b4747b1224f146f8d6e7'
First, find the enode of the first node with the next command:
admin.nodeInfo.enode
"enode://4e0312fb3eae8b59048afb1a53a3cd4a157db1fb2c8b7175176ffa932e41c2
2c60dd5f7540bbfb7d25b4c443116895360064fe4415734d3da621b29b0a7b6b6e@[::]
:30303?discport=0"
Instead of [::] , add your ip address to that string, for example: (you can get your ip address with
ifconfig command)
"enode://4e0312fb3eae8b59048afb1a53a3cd4a157db1fb2c8b7175176ffa932e41c2
2c60dd5f7540bbfb7d25b4c443116895360064fe4415734d3da621b29b0a7b6b6e@172.
16.1.104:30303?discport=0"
On the second node, add node one as a peer with the following command:
>admin.addPeer("enode://4e0312fb3eae8b59048afb1a53a3cd4a157db1fb2c8b717
5176ffa932e41c22c60dd5f7540bbfb7d25b4c443116895360064fe4415734d3da621b2
9b0a7b6b6e@172.16.1.104:30303?discport=0")
web3.net.peerCount
J. To do that:
miner.setEtherbase(eth.accounts[0])
and
miner.start()
K. It will take around 10 minutes to produce the DAG file (needed for mining) (Dagger-Hashimoto)
3 - Setting up a private Ethereum blockchain with two nodes (or more) and VmWare
L. After the DAG is produced, the mining procedure will start. You can check that the minner
account balance is increasing, calling the function getbalance, for example:
web3.eth.getBalance("0xc6acbafc19fbcb5ee3af6bf471c0c510e3d9d0c2")
Useful information:
Website: https://www.ethereum.org/
Blog: http://blog.ethereum.org/
Reedit: http://www.reddit.com/r/ethereum
Forum: https://forum.ethereum.org/
4 - Setting up a private Ethereum blockchain with two nodes (or more) and VmWare
more coming soon
part 2
part 3