Skip to content

Hyperledger Sawtooth basics concept. Here Transaction Processor is created and client code will send data through command line. Event will be trigged when any block is committed.

Notifications You must be signed in to change notification settings

swapnildeshmukh15/Nodejs-sawtooth-basics

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

Nodejs-sawtooth-basics

Hyperledger Sawtooth basics concept. Need to install docker based on your environment.

sawtooth-TP

There will be validator file in sawtooth-TP folder. Need to run the validator

sudo docker-compose -f sawtooth-default.yaml up

Here Transaction Processor is created with handler.js and state.js. Data from client will be get and set and update in GLobal state. After creating the TP, run the file

node index.js

Event will be trigged when any block is committed.

  • block-commit
  • state-delta
  • user defined events After creating the events, need to run the event to see the event trigger. Navigate to events folder and run the following command,
node ListenEvents.js

client

Client code will send data through command line. That will connect with validator and send data to TP. After creating the client, need to run the client with input.

For set the data,

node sendRequest.js  '{"action": "set", "data": "Priya"}'

For get the data,

node sendRequest.js  '{"action": "get", "data": "Priya"}'

About

Hyperledger Sawtooth basics concept. Here Transaction Processor is created and client code will send data through command line. Event will be trigged when any block is committed.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%