bitcoinlib.services.bitcoind module

class bitcoinlib.services.bitcoind.BitcoindClient(network='bitcoin', base_url='', denominator=100000000, *args)[source]

Bases: BaseClient

Class to interact with bitcoind, the Bitcoin deamon

Open connection to bitcoin node

Parameters:
  • network – Bitcoin mainnet or testnet. Default is bitcoin mainnet

  • base_url – Connection URL in format http(s)://user:password@host:port.

  • denominator – Denominator for this currency. Should be always 100000000 (Satoshi’s) for bitcoin

Type:

str

Type:

str

Type:

str

blockcount()[source]
estimatefee(blocks)[source]
static from_config(configfile=None, network='bitcoin', **kwargs)[source]

Read settings from bitcoind config file

Obsolete: does not work anymore, passwords are not stored in bitcoin config, only hashed password.

Parameters:
  • configfile – Path to config file. Leave empty to look in default places

  • network – Bitcoin mainnet or testnet. Default is bitcoin mainnet

Type:

str

Type:

str

Return BitcoindClient:

getbalance(addresslist)[source]
getblock(blockid, parse_transactions=True, page=1, limit=None)[source]
getinfo()[source]
getrawblock(blockid)[source]
getrawtransaction(txid)[source]
gettransaction(txid)[source]
gettransactions(address, after_txid='', limit=20)[source]
getutxos(address, after_txid='', limit=20)[source]
isspent(txid, index)[source]
mempool(txid='')[source]
sendrawtransaction(rawtx)[source]
exception bitcoinlib.services.bitcoind.ConfigError(msg='')[source]

Bases: Exception