Registry / devops / grpc-bchrpc

grpc-bchrpc

JSON →
library0.3.0jsnpmunverified

A common interface for grpc-bchrpc-node and grpc-bchrpc-web npm packages, enabling gRPC communication with Bitcoin Cash nodes. Current version 0.3.0, with irregular releases. Key differentiator: abstracts over Node.js and web environments for BCH gRPC.

npm install grpc-bchrpc
INSTALL
IMPORT
SIG · GRPC-BCHRPC
G
grpc-bchrpc
devopsjavascriptv0.3.0
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

BCH
import BCH from 'grpc-bchrpc'
const BCH = require('grpc-bchrpc')
Default export; ESM and CJS support depends on underlying packages.
BCHWeb
import { BCHWeb } from 'grpc-bchrpc'
import BCHWeb from 'grpc-bchrpc'
Named export for web variant.
BCHNode
import { BCHNode } from 'grpc-bchrpc'
import BCHNode from 'grpc-bchrpc'
Named export for Node.js variant.

Shows how to create a client and fetch blockchain info using gRPC.

import BCH from 'grpc-bchrpc'; const client = new BCH('https://bchd.fountainhead.cash:8335', { grpc: require('@grpc/grpc-js') }); async function main() { const info = await client.getBlockchainInfo(); console.log('Blockchain info:', info); } main().catch(console.error);
Debug
Known issues
gotchaPackage is essentially an alias - ensures you install grpc-bchrpc-node or grpc-bchrpc-web separately.
fix
Add one of the underlying packages to your dependencies.
affects: >=0.0.0
gotchaNo built-in TypeScript types; you may need to install @types/grpc__grpc-js.
fix
npm install --save-dev @types/grpc__grpc-js
affects: >=0.0.0
deprecatedgRPC web may require a proxy like Envoy; not suitable for direct browser usage without additional configuration.
fix
Set up a gRPC-web proxy if targeting browsers.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'grpc-bchrpc-node'
Missing underlying package.
fix
npm install grpc-bchrpc-node
TypeError: BCH is not a constructor
Incorrect import or missing default export.
fix
Use import BCH from 'grpc-bchrpc'
Upgrade
Version history
0.3.0latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
grpc-bchrpc — npm install grpc-bchrpc · libregistry