edu-chain :: Instructional Blockchain
educhain is an instructional purpose blockchain.
#blockchain #simulator #testing-tools #test-automation
The 6th D2 CAMPUS FEST Finalists
The main project of Sogang Univ. Blockchain Lab.
Based on one-chain
Based on blockchain-simulator
Overview
Fill in the blanks, simulate your own code, check the score, and improve it.
Make your own blockchain core.
It was created at Sogang University's Blockchain Lab. by Luke Park (Sanghyeon Park).
educhain is a simple blockchain implementation for instructional and educational purpose.
Like Pintos, simple operating system framework for the 80x86 architecture, educhain project is intended to introduce undergraduates to concepts in blockchain core design and implementation.
The simulator written in python automatically tests your code(s) and provides you some important information.
There are some examples of important information...
- Reorganization ratio.
- Effective throughput and nodes behind ratio.
- TPS(Transactions Per Seconds).
educhain version 2.0.0 targets a more general blockchain implementation. Now students can implement the blockchain core in various ways. For example, you can implement a consensus algorithm in PoW(Proof-of-Work), PoS(Proof-of-Stake), and PoA(Proof-of-authority); whatever you want. Not only consensus parts, but also block or blockchain structure, validation processes, communication parts, and identification.
Get educhain version 1.0.0 at v1.0.0 branch.
Problem Solving
- Goto the problem branch
- Goto the solution branch
How to Use
Click on the image above to play the video.
Environments
Blockchain core and its accompanying parts are written in Node.js. Testing or simulating parts are written in Python.
- Node.js v8.11.3 (>=4.3.2)
- Python 3.6.7
Start a Simulation
Preconditions
$ sh preconditions.shRun
$ sh run.shor
$ python3 main.py --nodes=24 --neighbors=3There are several arguments that control simulation settings.
$ python3 main.py --help
--steps STEPS The number of simulation steps.
--nodes NODES The number of full nodes constructing blockchain.
--neighbors NEIGHBORS
Each node initiates links to the amount of 'neighbors'
selected neighbors.
--timeout TIMEOUT Maximum waiting time. (seconds)
--prop_delay_avg PROP_DELAY_AVG
The average value of propagation delay. (milliseconds)
--prop_delay_std PROP_DELAY_STD
The standard deviation of propagation delay.
(milliseconds)
--freq_avg FREQ_AVG The average value of frequency. (milliseconds)
--freq_std FREQ_STD The standard deviation of frequency. (milliseconds)
--master_http MASTER_HTTP
The HTTP port of a master node.
--master_p2p MASTER_P2P
The P2P port of a master node.
--https HTTPS The base number of HTTP ports.
--p2ps P2PS The base number of P2P ports.Cleanup
$ sh cleanup.shAPIs
Get blockchain
curl http://127.0.0.1:3001/blocksYou can pretty-print JSON with:
curl http://127.0.0.1:3001/blocks | python -m json.toolPython >= 2.6 required.
Get connected peers
curl http://127.0.0.1:3001/peersGet Address
curl http://127.0.0.1:3001/addressTrouble Shootings
- if
ImportError: No module named requestsoccurs:
$ pip install requests- if
Error: listen EADDRINUSE :::3001occurs:
$ killall npm- if
'Time out'occurs:
$ sh preconditions.shReferences
- https://github.com/twodude/onechain
- https://github.com/twodude/blockchain-simulator
- https://web.stanford.edu/class/cs140/projects/pintos/pintos.html#SEC_Top
License
The educhain project is licensed under the Apache License, Version 2.0, also included in our repository in the LICENSE file.




