This module contains the code to the Smart Contracts that will govern how nodes interact with Viseu. The contracts will include available assets and services and how a peer will access those assets and services. This module also includes how to create an admin node, a peer, and connect them all on an ethereum private blockchain network. Note: make sure your machines are running Ubunutu.
- Ubuntu/MacOS
- Ethereum
- Go-Ethereum (GETH)
- Ethereum Brownie
sudo add-apt-repository -y ppa:ethereum/ethereum
sudo apt-get install ethereum
brew tap ethereum/ethereum
brew install ethereum
- Included in the
genesis.json
file are dummy accounts with wei for testing with unique account identifier numbers - These account identifiers must be changed to reflect your current network iteration's account
- To create a new account run
geth --datadir node01/ account new
assumingnode01/
is your selected admin node - Set and memorize your password
- Copy and paste the output hash without the hexadecimal prefix into the genesis.json file instead of the given account hash
- Run admin.sh to start the admin node
- Copy genesis.json file from admin node to new worker nodes.
- run
./start.sh
- Enter your node name
- Node should be instantiated and started
- Check node_log.out file to see if everything is running smoothly
- In a new terminal window on the machine of arbitrarily selected admin node run
geth attach http://127.0.0.1:<port of node>
- In the GETH console run
admin.nodeInfo.enode
- Copy the full output and change the localhost IP address from
127.0.0.1
to either the private IP address of your admin node's machine or its public IP address - Run
geth attach http://127.0.0.1:<port of node>
to interact with your other nodes - In each terminal of your other nodes run
admin.addPeer(<enode of admin node with proper IP address>)
- Run
net.peerCount
on the GETH console of the admin node to confirm that all your started nodes are connected to the admin
Now you can use your GETH console to interact with the nodes in your network, deploy smart contracts to your network using ethereum brownie, and transfer assets between the nodes in your network.