This branch is an implementation of PBFT protocol without view-change. In the default setting, there are n clients and n nodes, and one client sends payloads to one node.
.
|- README.md # Introduction for the implementation of the protocol
|- src
| |- core # core of protocol
| |- client # client: send request to node
| |- crypto # crypto primitives: Hash, Threshold Signature, Signature
| |- transport # network layer: p2p network among servers, communication between client and server
|
|- script
|- client # scripts of deliver and start clients, download and analysis logs
|- server # scripts of deliver, start and stop nodes, download and clear logs
-
Golang 1.19
-
install
expect
,jq
sudo apt update sudo apt install -y expect jq
-
python3+
# boto3 offers AWS APIs which we can use to access the service of AWS in a shell pip3 install boto3==1.16.0 pip3 install numpy
-
protobuf, the implementation uses protobuf to serialize messages, refer this to get a pre-built binary. (libprotoc 3.14.0 will be ok)
-
install protoc-gen-go and it must be in your $PATH for the protocol buffer compiler to find it.
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
-
We also provide a ready protobuf file compiled in Ubuntu 22.04 x86 platform
cd [working_directory]
make
First of all, you are supposed to change key
in every shell script to the path of your own ssh key to access your remote machines. If use AWS, please refer this to set up your AWS credentials. If not use AWS, please use generateLocal.py instead of aws.py and generate.py to create json files
In a remote machine, we will deploy one client and one consensus node
-
Create a cluster of EC2 machines.
-
(if use AWS) Fetch machine information from AWS.
cd [working_directory]/script/server python3 aws.py
-
(if use AWS) Generate config file(
node.json
) for every node.python3 generate.py
-
(if not use AWS) add your machines' ipAddr to the variable
ipset
in generateLocal.py, and thenpython3 generateLocal.py
Before proceeding to the next step, first prepare all executable files and bls keys through Getting Started
-
Deliver nodes.
chmod +x *.sh # Deliver to every node. # n is the number of nodes in the cluster. ./deliverNode.sh n
-
Run nodes.
./beginNode.sh n
-
(After fetching client logs but before the next experiment)Stop all processes.
# stop node process ./stopNode.sh n # clear node log files ./rmLog.sh n
-
Deliver client. (Open another terminal)
cd [working_directory]/script/client chmod +x *.sh # n is the number of nodes in the cluster ./deliverClient.sh n
-
Run client and wait for a period of time. (change the batch to get different latency-throughput)
# example: ./beginClient.sh 4 600 10 30 # you can increase <size of batch> to add the load ./beginClient.sh n <size of payload (size of a request)> <size of batch (number of requests)> <running time>
-
Copy result from client node.
# execute once mkdir log # create dirs to store logs, execute once ./createDir.sh n # fetch logs from remote machines ./copyResult.sh n <name of log file>
-
Calculate throughput and latency.
# Total bytes sent by client once equal <size of payload> * <size of batch> # example: python3 cal.py 4 100 [working_directory]/srcipt/client/log test 30 python3 cal.py <number of clients> <batchsize> <path of log directory> <name of log file> <test time>
-
aws.py: get machine information from AWS.
You may need to change
regions
andFilter
. -
generate.py:generate configuration for every node after executing aws.py.
-
generateLocal.py:generate configuration for every node by the
ipset
. -
deliverNode.sh: deliver node to remote machines.
./deliverNode.sh <the number of remote machines>
-
beginNode.sh: run node on remote machines.
./beginNode.sh <the number of remote machines>
-
stopNode.sh: stop node on remote machines.
./stopNode.sh <the number of remote machines>
-
rmLog.sh: remove log file on remote machines.
./rmLog.sh <the number of remote machines>
-
deliverClient.sh: deliver client to remote machines.
./deliverClient.sh <the number of remote machines>
-
Fetch log files from remote machines
mkdir log ./createDir.sh <the number of remote machines> ./copyResult.sh <the number of remote machines> <name of log files>
- Current scripts can be used by remote test in different machines. You can boost local test manually: modify the setting, start node and client processes, and analyze the result.
- Make port 5000-7000 open in the security group.