For this quick-start tutorial, we will perform an efficiency experiment on Proof-of-Validation consensus protocol defined here. When a new transaction is generated, we aim to find a predefined number of honest nodes that can act as validators for the transaction. Efficiency experiment measures the average number of honest nodes that are acquired throughout the simulation.
First, clone this repository on your local computer:
$ git clone https://github.com/yhassanzadeh13/SkipSimWS
This project uses Gradle as its build system.
Open SkipSimParameters.java
and set the following parameters:
public static final boolean NumIdHashing = true;
private static int ValidatorThreshold = 12;
private static int SignatureThreshold = 1;
public static float MaliciousFraction = 0.16f;
...
//////////////////////////////////////Experiments/////////////////////////////////////////
...
public static boolean MaliciousSuccessExperiment = false;
public static boolean EfficiencyExperiment = true;
public static boolean AvailabilityExperiment = false;
public static boolean OnlineProbabilityExperiment = false;
public static boolean btsMaliciousSuccessExperiment = false;
public static boolean btsEfficiencyExperiment = false;
Then create a new class "Blockchain" under the SimulationSchema package:
package SimulationSchema;
import DataTypes.Constants;
import Simulator.SkipSimParameters;
public class Blockchain extends SkipSimParameters {
public Blockchain() {
SimulationType = Constants.SimulationType.BLOCKCHAIN;
ChurnType = Constants.Churn.Type.COOPERATIVE;
SystemCapacity = 1024;
LandmarksNum = 10;
NameIDLength = 10;
//LOG = true;
TopologyNumbers = 1;
LifeTime = 168;
SessionLengthScaleParameter = Constants.Churn.Model.Debian.Fast.SessionLength.Scale;
SessionLengthShapeParameter = Constants.Churn.Model.Debian.Fast.SessionLength.Shape;
InterarrivalScaleParameter = Constants.Churn.Model.Debian.Fast.SessionInterarrival.Scale;
InterarrivalShapeParameter = Constants.Churn.Model.Debian.Fast.SessionInterarrival.Shape;
}
}
Now, we need to make sure that the SkipSim will use this schema while running the simulation. To do this, go to the SchemaManager class and modify it as the following:
package SimulationSchema;
public class SchemaManager {
public SchemaManager() {
new Blockchain();
}
}
With these settings, we will measure the average number of honest nodes that are achievable in 12 (ValidatorThreshold) trials.
For this tutorial we will use an already generated simulation. Download it here and put it on the SkipSim directory. Rename it as skipsim3db.db
.
Run SkipSim, and you will presented with the options of (1) loading a simulation (2) creating a new simulation.
Click on Open
from the top menu, and choose 100_1024_DEBIAN_1W
from the drop-down menu.
This simulation uses FAST_DEBIAN as a churn model, and it has 1024 nodes. The simulation is done over one week (168 hours).
Click on OK
and watch as the simulation runs. The experiment results will be outputted on the standard output.