This repository contains a blockchain implementation described by Daniel van Flymen in pure ruby and sinatra.
This will only require sinatra
to run.
gem install sinatra
To start the server, run
ruby server.rb
and it will be running on localhost:4567 by default.
Mines the current transactions and adds them to the blockchain.
Creates a new transaction and adds it to the pending transactions to be mined.
- sender - address of the sender
- recipient - address of the recipient
- amount
View the current blockcain.
Registers new nodes with the current node
- nodes - array of new nodes to register
Validates the current node's blockchain with all registered nodes to obtain the most recent one.