Skip to content

Instantly share code, notes, and snippets.

@HOllarves
Created February 6, 2019 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HOllarves/800fa72d1d3e119dd7c9236ebbd431de to your computer and use it in GitHub Desktop.
Save HOllarves/800fa72d1d3e119dd7c9236ebbd431de to your computer and use it in GitHub Desktop.
const { Network } = require("bcoin")
const { WalletClient, NodeClient } = require("bclient")
const network = Network.get("testnet")
const walletOptions = {
network: network.type,
port: network.walletPort,
apiKey: process.env.BTC_API_KEY,
host: process.env.BTC_HOST
}
const nodeOptions = {
network: network.type,
port: network.rpcPort,
host: process.env.BTC_HOST,
apiKey: process.env.BTC_API_KEY,
}
const walletClient = new WalletClient(walletOptions)
const nodeClient = new NodeClient(nodeOptions)
const { eventListeners } = require("./bcoin-listeners")
eventListeners(walletClient, nodeClient)
module.exports = { walletClient }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment