Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

innoq/innoq-blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

INNOQ blockchain

INNOQ programming event proof of concept reference blockchain.

Prerequisites

  • nodejs (used v8.9.1)
  • yarn

Getting started

  • yarn install
  • Spin up node using yarn start (default port 8333)
  • Spin up second node using yarn start2 (port 8334)

Connecting nodes

Use curl commands to connect node to each other:

# add node http://localhost:8334 to http://localhost:8333
curl -X POST http://localhost:8333/nodes/register \
  -H 'Content-Type: application/json' \
  -d '{ "host": "http://localhost:8334" }'

and vice versa:

add node http://localhost:8333 to http://localhost:8334
curl -X POST http://localhost:8334/nodes/register \
  -H 'Content-Type: application/json' \
  -d '{ "host": "http://localhost:8333" }'

Blockchain-API

Resource Description
GET / node info, blockheight, neighbours
GET /blocks get nodes chain
GET /blocks/:id get specific block
GET /transactions list unconfirmed transactions
GET /transactions/:id get specific transaction
POST /transactions post a new transaction
GET /mine mine a new block
GET /events sse events stream (new_block, new_transaction, new_node)
POST /nodes/register register new node
GET /nodes/resolveChain manually resolve chain with longer chain of registered nodes

About

INNOQ hands on event blockchain POC

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published