Skip to content

BFT SMaRt Demos

jcs47 edited this page Sep 27, 2018 · 9 revisions

There are several demo applications deployed together with the BFT-SMaRt source code. These demos are in the package bftsmart.demo.

BFT-SMaRt has a configuration file with options to run the protocol. The configuration file is in config/system.config. A short description is provided before each parameter, and values are set for the most common operations.

Before running the protocol, the configuration file config/hosts.config must be updated with the information about the servers where the protocol is being executed. The file is in the format:

#server id, address and port (the ids from 0 to n-1 are the service replicas)
0 127.0.0.1 10000
1 127.0.0.1 11000
2 127.0.0.1 12000
3 127.0.0.1 13000

You can execute all demos using the runscripts/smartrun.sh script. It is important to run the script from the BFT-SMaRt main folder, as it is considered the base do find the libraries.

The client_id parameter accepted in BFT-SMaRt clients is used as an unique identifier of the client. It is essential for the protocol to order the messages consistently across the replicas. If the protocol is using client signatures, a key with the clients and servers keys must be provided in the config/keys. For testing purposes, several keys are delivered with the source code. The parameter system.communication.useSignatures in system.config defines if signatures will be considered or not.

CounterServer

CounterServer is an application where clients submits messages to replica, messages are ordered and the throughput is displayed to the user. It has no real application but is useful to verify the system functioning and performance.

Start the servers (4 replicas, to tolerate 1 fault)

runscripts/smartrun.sh bftsmart.demo.counter.CounterServer 0
runscripts/smartrun.sh bftsmart.demo.counter.CounterServer 1
runscripts/smartrun.sh bftsmart.demo.counter.CounterServer 2
runscripts/smartrun.sh bftsmart.demo.counter.CounterServer 3

The only parameter is the replica id that must be assigned sequentially starting on 0.

Start a client

if <increment> equals 0 the request will be read-only. Default <number of operations> equals 1000

runscripts/smartrun.sh bftsmart.demo.counter.CounterClient <client_id> <increment> [<number of operations>]

BFTMap

This application is a fault tolerant implementation of interface Map of java.util. It creates a TreeMap in the server with key and value of type String. Only operations that are supported are PUT, GET, SIZE, REMOVE and KEYSET.

Start the servers (4 replicas, to tolerate 1 fault)

runscripts/smartrun.sh bftsmart.demo.map.MapServer 0
runscripts/smartrun.sh bftsmart.demo.map.MapServer 1
runscripts/smartrun.sh bftsmart.demo.map.MapServer 2
runscripts/smartrun.sh bftsmart.demo.map.MapServer 3

The only parameter is the replica id that must be assigned sequentially starting on 0.

Map Client

The client side implementation of this application provides a console interface to interact with the servers. This allows users to submit operations and their respective parameters.

The command line to start the client is:

runscripts/smartrun.sh bftsmart.demo.map.MapInteractiveClient <client_id>

The only parameter is the client id which must be unique.

Yahoo! Cloud Serving Benchmark

This demo executes the Yahoo! Cloud Serving Benchmark (YCSB) with BFT-SMaRt. For this demo we provide specific scripts for clients and servers.

Start the servers (4 replicas, to tolerate 1 fault)

./runscripts/startReplicaYCSB.sh 0
./runscripts/startReplicaYCSB.sh 1
./runscripts/startReplicaYCSB.sh 2
./runscripts/startReplicaYCSB.sh 3

YCSB Client

The command line to start the client is:

./runscripts/ycsbClient.sh