Skip to content

deriv-com/Bitcoin-RPC-Client

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoin::RPC::Client - Bitcoin Core RPC client as a Perl module

Build Status CPAN version

This module is a pure Perl implementation of the methods that are currently part of the Bitcoin Core RPC client calls (bitcoin-cli). The method names and parameters are identical between the Bitcoin Core API and this module. This is done for consistency so that a developer only has to reference one manual: https://bitcoin.org/en/developer-reference#rpcs

Currently tested against Bitcoin Core v0.12, v0.13, v0.14, v0.15, v0.16 and v0.17 but should work with earlier versions. Also, though not thoroughly tested, this module will work with other Bitcoin Core forks that have a bitcoind compatible JSON RPC API. E.g. Bitcoin Unlimited, Bitcoin UASF, Litecoin Core.

SYNOPSIS:

   use Bitcoin::RPC::Client;

   $btc = Bitcoin::RPC::Client->new(
      user     => "username",
      password => "p4ssword",
      host     => "127.0.0.1",
   );

   $chaininfo = $btc->getblockchaininfo;
   $blocks = $chaininfo->{blocks};

INSTALL:

  • Source

    • perl Makefile.PL
    • make
    • make test
    • make install
  • cpanm

    • cpanm Bitcoin::RPC::Client
  • CPAN shell

    • perl -MCPAN -e shell
    • install Bitcoin::RPC::Client

DEPENDENCIES:

  • Moo
  • JSON::RPC::Legacy::Client

CAVEATS:

  • Boolean parameters must be passed as JSON::Boolean objects E.g. JSON::true

DONATE:

  • 18uqrhFDnbkemSG1bCfRCh5G5D9jaaQUVb

About

A Perl module for connecting to Bitcoin Core nodes via RPC

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Perl 100.0%