Skip to content

This is an example implementation of blockchain platform. The data structure is a simplified version of the structure used on the Ethereum platform. The data is stored in memory. New blocks are always added after at least 4 pending transactions have been added. In this example, the Proof of Work consensus method is implemented.

Notifications You must be signed in to change notification settings

rpardela/SimpleBlockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Description

This is an example implementation of blockchain platform. The data structure is a simplified version of the structure used on the Ethereum platform.

The data is stored in memory.

New blocks are always added after at least 4 pending transactions have been added.

In this example, the Proof of Work consensus method is implemented, which is based on the set difficulty of a cryptographic puzzle. The difficulty can be modified and we can observe how it affects performance. To verify this, run the available unit tests.

Install nodejs packages

npm install

Run tests

npm test

Change the difficulty of generating new blocks

  • Open blockchain.js file
  • Go to Blockchain constructor
  • Change number in line this.difficulty = 2;
  • Re-run tests

About

This is an example implementation of blockchain platform. The data structure is a simplified version of the structure used on the Ethereum platform. The data is stored in memory. New blocks are always added after at least 4 pending transactions have been added. In this example, the Proof of Work consensus method is implemented.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published