Bitcoin RPC Client
Project description
Bitcoin RPC Client
RPC client for Bitcoin Daemons
Install
pip install bitcoin-rpc-client
Usage
Prerequesites:
Run a Bitcoin daemon/node
bitcoind -server -rpcuser=user -rpcpassword=pass
Sync
from bitcoin_rpc_client import RPCClient
with RPCClient('http://127.0.0.1:18443', 'user', 'pass') as rpc:
blocks = rpc.generate(101)
tx = rpc.sendtoaddress(address, 20)
# or
rpc = RPCClient('http://127.0.0.1:18443', 'user', 'pass')
blocks = rpc.generate(101)
tx = rpc.sendtoaddress(address, 20)
rpc.close()
Async
from bitcoin_rpc_client import RPCClientAsync
with RPCClientAsync('http://127.0.0.1:18443', 'user', 'pass') as rpc:
blocks = await rpc.generate(101)
tx = await rpc.sendtoaddress(address, 20)
# or
rpc = RPCClientAsync('http://127.0.0.1:18443', 'user', 'pass')
blocks = await rpc.generate(101)
tx = await rpc.sendtoaddress(address, 20)
await rpc.aclose()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file bitcoin-rpc-client-0.1.2.tar.gz
.
File metadata
- Download URL: bitcoin-rpc-client-0.1.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 774224aaff2ebd492b0f565df0728b59538413849fdd5119ec4129d62789858c |
|
MD5 | 8241faaa4eabfe13b99343e9124ea547 |
|
BLAKE2b-256 | 6082a4539aa885493b7daa7af5b718c61ced66e9d174d3f0f74d62efd2c42a36 |
File details
Details for the file bitcoin_rpc_client-0.1.2-py3-none-any.whl
.
File metadata
- Download URL: bitcoin_rpc_client-0.1.2-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.7.1 importlib_metadata/4.10.1 pkginfo/1.8.2 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.9.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8229e07c06d18c2c27df8a1e7284ce6272873d37c36e6edda66f0299dba85bb5 |
|
MD5 | 8ac51e0bbe1c6ac9c483fe9ac14005a1 |
|
BLAKE2b-256 | 39fb13d160f76d62c35f7a2aa52474b22a11e14a6f687854cb3bf3000215ede6 |