Simulation tool for Nxt-like 100% Proof-of-Stake forging
To compile you need:
-
GHC haskell compiler.
sudo apt-get install ghc
-
cabal-install for external haskell packages installation
sudo apt-get install cabal-install
-
ConfigFile package, which can be locally installed
cabal install ConfigFile SHA
-
Then run
compile.sh
shell-script for Linux to compile the sources -
The executable name is
launcher
unless another name is manually specified
Configuration file 'params.conf' (the name is statically defined in launcher.hs, after changing re-compilation is needed) consists of the following parameters:
-
outdir - folder results will be put into. Will be created if not exists
-
duration - test duration, in seconds. Please note, performance is not very good at the moment, so better start with default value on an unknown machine
-
simulation-id - being using as seed value for random number generator. Results for same simulation-id & duration values are the same from run to run, so change this value to start new experiment. other researcher can follow your results by using the same
simulation-id
value -
max-connections-per-node - max number of outgoing connections a node could has. please note we use one-directional connections, so sometimes oldest connection being dropped to avoid network clusterization
-
add-node-avg-gap - average gap between node creation events, e.g. if add-node-avg-gap == 1000 && duration = 100000 then ~100 nodes will be created during the test
After finishing simulation program dumps out some results to files in output directory set by outdir
parameter
(out
by default):
-
nodeX - final state of node X
-
chainX - chain of node X at final moment
-
commonX - common chain for nodes X and X+1
-
txsX - confirmed transactions presenting in a blockchain of node X
-
cons - network connections in final moment of a test in format nodeId -> [otherNodeId1...otherNodeIdN]
-
network - very big file with whole network's final state
-
commons - lengths of common chains for all nodes
Also some information being printing after test to the console:
-
final self-balances for all nodes(i.e. every node prints balance from it's own point of view)
-
lengths of common chains for all nodes(the same goes to
commons
file)
Please contact kushti, kushtech@yahoo.com for any reasonable questions or suggestions about the program. Also please visit our subforum @ Nxt forum : https://nxtforum.org/consensus-research/