Skip to content

Latest commit

 

History

History
48 lines (32 loc) · 679 Bytes

README.md

File metadata and controls

48 lines (32 loc) · 679 Bytes

ChainForge

Setup

Install ruby 3.2.2

rbenv install 3.2.2
rbenv local 3.2.2

Install dependencies

bundle install

Test

bundle exec rspec

Usage

ruby main.rb -p 1910

API

POST /chain

curl -X POST http://localhost:1910/chain

POST /chain/:chain_id/block

curl -X POST -H 'Content-Type: application/json' -d '{"data": "your_data"}' http://localhost:1910/chain/:chain_id/block

POST /chain/:chain_id/block/:block_id/valid

curl -X POST -H 'Content-Type: application/json' -d '{"data": "your_data"}' http://localhost:1910/chain/:chain_id/block/:block_id/valid