Create and Transact on Ethereum Private Blockchain
Importing the Virtual Machine
First thing first you need to download the Ethereum.ova file. Now that the .tar file is extracted, we’ll move on to installing VirtualBox. This .ovf/.ova file contains the guest Ubuntu (Linux) operating system with all the installations necessary to run a full Ethereum Node (along with the .vmdk file).
- VirtualBox will create a Virtual Machine instance, separate from your computer, to run the Node.
Download VirtualBox from this link:
https://www.virtualbox.org/wiki/Downloads
a. Windows users — Open the download file as an Administrator to install, otherwise the virtual machine may not connect to the Internet.
Next, you will need to install Ethereum.ovf (Windows) or Ethereum.ova (Mac) into VirtualBox.
2. Open VirtualBox
3. File -> Import Appliance
4. Select Ethereum.ovf (Windows) or Ethereum.ova (Mac) and click Next.5.
5. Change the MAC Address Policy to “Generate new MAC addresses for all network adapters”
6.Click Import.
This imports the Ethereum Ubuntu appliance into VirtualBox.
Running the Virtual Machine
1. Select the VM you’ve imported and click the green Start arrow.
2. Password: ubuntu
Starting the Project
1. Once the VM is running, double click the file named “1.Start.sh”
2. Select Run in Terminal
3. Minimize the terminal. (Do not close it)
4. Double click the shortcut file named “2. Start the Browser”
You are now ready to proceed! 💎
Demonstrate that you can follow the steps to transact on a blockchain such as:
• Account
• Account balance
• Node
• Peers
• Peer-to-peer transaction
• Genesis block
• Ethers
• Mining
• Interacting with a private blockchain
Extra Material
In this project, we have already installed geth in the virtual appliance provided to you. To make things easier, we have provided a web interface to help you out in interacting with the geth instance running in the backend. If you are curious here are commands behind those buttons you clicked.
1. Create new Accounts:
geth account new — datadir ~/Node_1 and geth account new — datadir ~/Node_2
2. Initialize Genesis File:
geth init customGenesis.json — datadir ~/Node_1 and geth init customGenesis.json — datadir
~/Node_2
3. Start Geth:
a. NODE_1:
geth — datadir ~/Node_1 — maxpeers 95 — networkid 13 — nodiscover — rpc -rpccorsdomain “*” — port 30301 — rpcport 8544 — rpcapi=”txpool,db,eth,net,web3,personal,admin,miner”
b. NODE_2:
geth — datadir ~/Node_2 — maxpeers 95 — networkid 13 — nodiscover — rpc -rpccorsdomain “*” — port 30302 — rpcport 8545 --rpcapi=”txpool,db,eth,net,web3,personal,admin,miner”
4.Connect Peers: admin.addPeer(<eNode of the other node>);
5. Peer Count: net.peerCount
6. Peer Details: admin.peers
7. Create New Accounts: personal.newAccount(<password>)
8. List accounts: eth.accounts
9. Check Balance: eth.getBalance(<account>)
10. Start Miner: miner.start(4)
11. Stop Miner: miner.stop()
12. Unlock Accounts: personal.unlockAccount(<address>,<password>,<duration in sec>)
13. Send Transaction: eth.sendTransaction({from:<address>, to:<address> , value: <value>})
14. Check Transaction Status: txpool.status.