The purpose of this implementation is to discover possible adaptations of our use case (tokenizing campaigns and storing them in a secure ledger) in the context of a traditional blockchain.
Create a folder on integration cluster OR on your local machine by naming it as blockchain
To install all the necessary libraries make sure that you have following files in your blockchain folder:
- begin.sh
- /files/requirements.txt
To install them just run the command below, which:
- will create your virtualenv with a name blockchain-py3
- will install all the necessary libraries in your virtualenv
sh begin.shTo activate your virtualenv:
source blockchain-py3/bin/activateTo deactivate your virtualenv:
deactivateYou can initialize and run your blockchain nodes either on localhost or on cluster:
Activate your virtualenv:
source blockchain-py3/bin/activateInitialize the first node on integration cluster on master <master_ip>
python node.pyAnd, initialize other nodes on other machines in the cluster by following the same procedure described above.
Activate your virtualenv:
source blockchain-py3/bin/activateInitialize the master node on integration cluster on master <master_ip> with 2 different ports (2 separate networks)
python node_multilayer_singlemaster.py master <port_no_1> <port_no_2>Example:
python node_multilayer_singlemaster.py master 20000 30000And, initialize other nodes on other machines in the cluster (choose the network by choosing the port among the ports available on master)
python node_multilayer_singlemaster.py slave <port_no_1 OR port_no_2>Example:
python node_multilayer_singlemaster.py slave 20000Activate your virtualenv:
source blockchain-py3/bin/activateInitialize the first and second master nodes on integration cluster on different machines with 2 different ports for 2 diff. networks
python node_multilayer_multimaster.py master <port_no_1> <port_no_2>Example:
python node_multilayer_multimaster.py master 20000 30000And, initialize other nodes on other machines in the cluster (choose the network by choosing the port among the ports available on master)
python node_multilayer_multimaster.py slave <master_ip_1> <master_ip_2> <port_no_1 OR port_no_2>Example:
python node_multilayer_multimaster.py slave <slave_ip> <master_ip> 20000After launching the script among node.py OR node_multilayer_singlemaster.py OR node_multilayer_multimaster.py;
You will be able to access to corresponsing node's chain by passing the command:
get chainto send a hey to peers (connection test):
heyto get the active peers list:
get peersto get the network that the node belongs to:
get networkto get the unvalidated transactions list:
get txsto mine:
mineto reach a consensus:
consensusto shut down the node properly:
q

