Skip to content

Instantly share code, notes, and snippets.

@zh
Created December 3, 2020 01:51
Show Gist options
  • Select an option

  • Save zh/c17827ac410d2a31a3aa06dae072a38c to your computer and use it in GitHub Desktop.

Select an option

Save zh/c17827ac410d2a31a3aa06dae072a38c to your computer and use it in GitHub Desktop.

Code

const BITBOX = require('bitbox-sdk').BITBOX
const { GrpcClient } = require('grpc-bchrpc-node')
// it was 'bchd.ny1.simpleledger.io' below
const client = new GrpcClient({ url: 'bchd.greyh.at:8335' })
const validator = new slpjs.BchdValidator(client)
const bchdNetwork = new slpjs.BchdNetwork({ BITBOX, client, validator })

const addresses = ['simpleledger:qp.....', 'simpleledger:qq']
const balances = await bchdNetwork.getAllSlpBalancesAndUtxos(addresses)

Error message

(...) below replacing path to my working directory

error in getAllUtxos:  Error: 12 UNIMPLEMENTED: unknown method GetTrustedSlpValidation for service pb.bchrpc
    at Object.exports.createStatusError (.../node_modules/grpc/src/common.js:91:15)
    at Object.onReceiveStatus (.../node_modules/grpc/src/client_interceptors.js:1209:28)
    at InterceptingListener._callNext (.../node_modules/grpc/src/client_interceptors.js:568:42)
    at InterceptingListener.onReceiveStatus (.../node_modules/grpc/src/client_interceptors.js:618:8)
    at callback (.../node_modules/grpc/src/client_interceptors.js:847:24) {
  code: 12,
  metadata: Metadata { _internal_repr: {}, flags: 0 },
  details: 'unknown method GetTrustedSlpValidation for service pb.bchrpc'
}


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment