Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/ravindramohith/cyptonite

Cyptonite is a blockchain simulation project using Python, designed to model and analyze different mining strategies, including stubborn and selfish mining, in a decentralized network
https://github.com/ravindramohith/cyptonite

blockchain-technology proof-of-work python selfish-mining stubborn-mining

Last synced: about 1 month ago
JSON representation

Cyptonite is a blockchain simulation project using Python, designed to model and analyze different mining strategies, including stubborn and selfish mining, in a decentralized network

Awesome Lists containing this project

README

        

# CS 765 Assigment-2

## **Environment:**
Make sure python v3 is installed on your system.

## **Running instructions:**
- Navigate to code directory:

`$ cd code/`

### **For stuborn mining without any attacker:** navigate to `stubborn_mining` directory.
### **For mining with attackers:** navigate to `selfish_mining` directory.

- basic command to run event simulator:

`$ python3 main.py --peers [PEERS] --z0 [Z0] --z1 [Z1] --transaction-mean-gap [TRANSATIONMEANGAP] --att1 [ATT1] --att2 [ATT2]`

- for printing blockchain:

`$ python3 main.py --peers [PEERS] --z0 [Z0] --z1 [Z1] --transaction-mean-gap [TRANSATIONMEANGAP] --att1 [ATT1] --att2 [ATT2] --print-blockchain`

- for visualizing the blockchain:

`$ python3 main.py --peers [PEERS] --z0 [Z0] --z1 [Z1] --transaction-mean-gap [TRANSATIONMEANGAP] --att1 [ATT1] --att2 [ATT2] --visualize-blockchain`

**Note: If u want to print and visualize, add both `--print-blockchain` and `--visualize-blockchain` flags to the basic command (order dosen't matter).

PEERS - No.of peers

Z0 - z0 fraction of low speed distribution

Z1 - z1 fraction of low CPU speed distribution

TRANSACTIONMEANGAP - transaction mean time.

ATT1 - attacker 1's hashing power
ATT2 - attacker 2's hashing power

- to visualize graph of nodes:
`$ python3 graph.py --generate`