Skip to content
Permalink
Browse files

add lib

  • Loading branch information...
thanhson1085 committed Apr 1, 2019
1 parent e168426 commit 80a1237d7b3ee1a221761a9caa8e7972c50b09ef
Showing with 3,106 additions and 0 deletions.
  1. +9 −0 models/web3rpc.js
  2. +12 −0 models/web3ws.js
  3. +3,063 −0 package-lock.json
  4. +22 −0 package.json
@@ -0,0 +1,9 @@
'use strict'

const Web3 = require('web3')
const config = require('config')

const provider = new Web3.providers.HttpProvider(config.get('blockchain.rpc'))
const web3 = new Web3(provider)

module.exports = web3
@@ -0,0 +1,12 @@
'use strict'

const Web3 = require('web3')
const config = require('config')

function Web3Ws () {
let provider = new Web3.providers.WebsocketProvider(config.get('blockchain.ws'))
let web3 = new Web3(provider)
return web3
}

module.exports = Web3Ws
Oops, something went wrong.

0 comments on commit 80a1237

Please sign in to comment.
You can’t perform that action at this time.