bc_pos
A blockchain testbed to evaluate PoS consensus
Dependencies:
- Python 2.7.x
- pyzmq
- configparser
How to Install
Execute file install.sh as root
How to Use
Use in a host
- Run in console a node
.\node [-i <ip> -p <port>]
- Run in another console a blockchain-cli
.\blockchain-cli [parameters]
Use with mininet
Run sudo python simpleNet.py [-n <quantity>]
This file is a simple single switch Mininet topology that runs node.py
in each host with private directories.
Parameters
simpleNet.py
Simple single switch Mininet topology with private directories in each host.
Arguments:
-n
number of hosts on switch
node
Process to run in each host participating in the network.
Arguments:
-i
--ip
IP address of the node in the network (defaults to loopback)-p
--port
port to listen to peers (defaults to 9000)--peers
list of peers IP addresses--miner
start node mining--log
console log level-c
configuration file-h
--help
help
blockchain-cli
Localhost client to communicate with the node process and obtain blockchain info
Arguments:
getlastblock
last block on the chainaddpeer X
add X peer IP and connect to itremovepeer X
remove X peer and disconnectgetblock X
block X informationgetblocks X Y
blocks X and Y informationgetpeerinfo
IP of all connected peersstartmining
start mining on the nodestopmining
stop mining on the nodeaddbalance X
add X coins to balanceaddblock X Y
add block with index X and round Yexit
stop node process-h
--help
help