dedis / cothority

Scalable collective authority
Other
426 stars 106 forks source link

Byzcoin Benchmarking #2441

Open Raycoms opened 3 years ago

Raycoms commented 3 years ago

Hi, I was looking through the repo and I was wondering if there is a "simple" way to startup 400 instances and run a benchmark with fixed sized blocks.

ineiti commented 3 years ago

There is a simulation framework where you can do this. Look for example at https://github.com/dedis/cothority/tree/master/byzcoin/simulation - which should have a README :(

In that directory, you can run the simulation with

go run . coins.toml

This sets up a 5-node system and runs a number of coin-transactions on them, then it waits for all transactions to be accepted.

You can find more information about running the simulations here:

https://github.com/dedis/onet/tree/master/simul

Raycoms commented 3 years ago

I now had the time to look deeper into this. Not sure I understood this right, but it seems I can either run this on one of the cloud platforms (Deterlab etc) which need a special signup or solely on localhost using this.

Is there an easy way I can get each process to run within a docker container on a distributed set of processes like Grid5000?

ineiti commented 3 years ago

We use mininet to add network bandwidth and latency control. Since a month ago, you can also run it in a virtual machine - check out the end of this:

https://github.com/dedis/onet/blob/master/simul/platform/MININET.md

Raycoms commented 3 years ago

I've seen that you can run it in 1 virtual machine, but I couldn't find anything regarding distributed setups (like, defining a cluster of IPs or similar) to distribute the processes on. The config allows to configure the numer of servers, but doesn't describe where I define the list of servers and how to access them.

Also: https://pkg.go.dev/github.com/dedis/onet?utm_source=godoc#Simulation returns not found.

Getting a docker swarm support would be amazing for this.

ineiti commented 3 years ago

Yes, we thought of doing AWS deployments, too, but currently this is very low on our priority list, sorry :(

Using the virtual machine and Mininet, you can simulate up to 200 nodes on a powerful machine, with bandwidth and latency restriction between each pair of nodes. For more you either need to give up the network restrictions and use localhost, or you need to set up manually multiple servers and then use mininet on them.

ineiti commented 3 years ago

Theoretically it should be enough to copy https://github.com/dedis/onet/blob/master/simul/platform/mininet.go into a docker-swarm.go and implement the public methods to fit your deployment. But the devil will be in the details, most annoyingly the way the monitor works...

Raycoms commented 3 years ago

I'm very confused about running the simulation (on mini-net or localhost). The localhost description is basically non existent and mininet tells me to run: "go build && ./simul -platform mininet simul.toml" without saying from which folder to run it, and what simul.toml should contain.

I guessed that simul.toml is supposed to contain the simulation settings like:

Simulation = "ExampleHandlers"
Servers = 16
BF = 2
Rounds = 10
#SingleHost = true

Hosts
3
7
15
31

but there is still no executable simul file

root@nova-16:~/onet# go build && ./simul -platform mininet simul.toml -bash: ./simul: Is a directory

ineiti commented 3 years ago

This should work:

git clone https://github.com/dedis/cothority
cd cothoriyt/byzcoin/simulation
go build && ./simulation -platform localhost coins.toml