1.0.8 • Published 2 years ago
sedock v1.0.8
sedock.js
This is the main package of sedock.js.
web3
contains the ideal setup for a Web3.js package.
Installation
You can install the package either using NPM or using Yarn
Using NPM
npm install sedock
Using Yarn
yarn add sedock
Using rpc requests
How to send transaction
const sedoc = new Sedock("https://rpcnodeaddress")
sedoc.eth.sendTransaction("device", "user", "some data")
How to get amount of created blocks on device
const sedoc = new Sedock("https://rpcnodeaddress")
sedoc.eth.getBlockNumber("device")
How to get block data
const sedoc = new Sedock("https://rpcnodeaddress")
sedoc.eth.getBlock("blocknumber", "device")
How to subscribe on blockchain events
const sedoc = new Sedock("https://rpcnodeaddress")
sedoc.ws.connect("ws://wsaddress:8001")
sedoc.ws.subscribe((status, block) => {
console.log(status, block)
})