This project implements a simulator to write our blockchain algorithm, represented in the consensus proposal Some Adjustments to Candidates Selection in Tezos Blockchain.
Install opam 2.0+ and then off you go:
$ eval $(opam env) # Navigate to the environment variables set
$ opam install . --deps-only # Install libraries in vrf_simulator.opam
$ eval $(opam env) # Apply the installed libraries
$ dune build . # Build the Ocaml project
$ dune exec ./src/bin/main.exe # Run the Ocaml projectThis example of ultimate result is displayed in terminal as below:
Node 1 has 14 rolls in this committee to select endorser
Node 2 has 7 rolls in this committee to select endorser
Node 3 has 8 rolls in this committee to select endorser $ dune exec ./test/test_vrf_simulator.exe # Run Unit Test in Ocaml projectThis example of ultimate result is displayed in terminal as below:
Factorial Function is True
Power Function is True
Combination Function is True
Binomial Distribution Function is True
Bit Length Function is True
Verify Function in Role Selection Formula is FalseNavigative to node_data.json to modify the fundamental parameters and increase or decrease the number of nodes running in Tezos.
The source code is distributed under the MIT Open Source License.