| 正體中文 |
Project template to create as simple as possible implementation of a blockchain with Node.js 4+ and JavaScript.
An extremely simple blockchain: a project template to create as simple as possible blockchain system.
Block # 0, also known as Genesis Block, is the first block of its blockchain system. This project provides a minimal blockchain implementation for teaching and research, and you can be provided the simplest way to understand the blockchain.
- Import Genesis Block
- An exetremly simple mining algorithm
- A simple and lightweight REST-style RPC system
- A p2p network system over WebSocket
- There is no proof-of-work implementation
To start a miner node:
git clone https://github.com/jollen/blockchain-starter-kit.git
cd blockchain-starter-kit
npm install
node index.js
The server will start at localhost:8000
by default. To start another miner node at port 8001
and join an existing network:
export PORT=8001
node node1.js
After index.js
has been joined, its successor will become node1.js
. To fix the default join node, please open node1.js
and modify the join
property:
server.start({
onstart: onstart,
onmessage: onmessage,
join: {
address: 'localhost',
port: 8000
}
});
Copyright (C) 2016-present Jollen. The source code is licensed under the MIT license found in the LICENSE file.