Skip to content

holmesbenjamin/Blockchain-Framework

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Blockchain-Framework

A simple blockchain framework that allows mining, adding new transactions and viewing the chain

Getting Started

Please install the following packages in comand prompt to begin:

  • flask
    python pip install Flask==0.12.2
  • requests
    python pip install requests==2.18.4 

I used 4 endpoints:

  • Create a new transaction to a block
    /transactions/new
  • Mine a new block
    /mine 
  • Return the full Blockchain
    /chain
    You can use cURL or Postman to interact with the API over a network (I use Postman)

See below for example requests:

Screenshot_20230107_140823

  • When sending data to the server send in JSON format something like this:
    { "sender": "d4ee26eee15148ee92c6cd394edd974e", "recipient": "address-2", "amount": 100 }

Screenshot_20230107_140957 Screenshot_20230107_141031

After this using two nodes (created manually using different ports or using different machines) you can use the below as a get method:

  /nodes/resolve

If one node has a chain that is longer, the shorter chain will get replaced by the Conensus Algorithm

Contact!

About

A simple blockchain framework that allows mining, adding new transactions and viewing the chain

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages