How to use bitcoind-rpc - 3 common examples

To help you get started, we’ve selected a few bitcoind-rpc examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Casa / Casa-Node-API / test / unit / lightning.js View on Github external
before(async() => {
    reset();

    bitcoindHelp = sinon.stub(require('bitcoind-rpc').prototype, 'help').callsFake(callback => callback(undefined, {}));

    // TODO: expires Dec 1st, 2019
    jwt = 'eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6InRlc3QtdXNlciIsImlhdCI6MTU3NTIyNjQxMn0.N06esl2dhN1mFqn-0o4KQmmAaDW9OsHA39calpp_N9B3Ig3aXWgl064XAR9YVK0qwX7zMOnK9UrJ48KUZ-Sb4A';
  });
github Casa / Casa-Node-API / test / endpoints / v1 / bitcoind / info.js View on Github external
it('should respond with a valid version', done => {
      bitcoindRPCGetNetworkInfo = sinon.stub(require('bitcoind-rpc').prototype, 'getNetworkInfo').callsFake(callback => callback(undefined, {
        result:
          {
            subversion: '/Satoshi:0.17.0/'
          }
      }));
      requester
        .get('/v1/bitcoind/info/version')
        .set('authorization', `JWT ${token}`)
        .end((err, res) => {
          if (err) {
            done(err);
          }
          res.should.have.status(200);
          res.should.be.json;
          res.body.should.have.property('version');
          res.body.version.should.equal('0.17.0');
github synfonaut / hummingbird / index.js View on Github external
if (!MODE[this.mode]) { throw new Error(`unexpected mode ${this.mode}`) }

        this.reconnect = (this.config.reconnect === undefined ? true : false);

        const rpcconfig = Object.assign({}, {
            protocol: "http",
            host: "127.0.0.1",
            port: "8332",
        }, this.config.rpc);

        this.ready = function() {};
        this.blockreq = null;

        this.queue = new Queue(1, Infinity);

        this.rpc = new RPCClient(rpcconfig);

        this.currheight = 0;
        this.blockheight = 0;

        this.peer = new Peer({ host: this.config.peer.host, messages });

        this.peer.on("ready", () => {
            this.onconnect();
        });

        this.peer.on("disconnect", async () => {
            await this.ondisconnect();
        });

        this.peer.on("block", async (message) => {
            if (this.mode == MODE.MEMPOOL) {

bitcoind-rpc

Bitcoin Client Library to connect to Bitcoin Core via RPC

MIT
Latest version published 3 years ago

Package Health Score

54 / 100
Full package analysis

Popular bitcoind-rpc functions