Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/stepansnigirev/requests-bitcoin-cli
A tiny script to run Bitcoin JSON-RPC commands using requests
https://github.com/stepansnigirev/requests-bitcoin-cli
Last synced: 8 days ago
JSON representation
A tiny script to run Bitcoin JSON-RPC commands using requests
- Host: GitHub
- URL: https://github.com/stepansnigirev/requests-bitcoin-cli
- Owner: stepansnigirev
- Created: 2019-08-16T04:22:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2019-08-16T04:40:39.000Z (over 5 years ago)
- Last Synced: 2024-11-09T05:38:23.371Z (2 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# requests-bitcoin-cli
A tiny script to run Bitcoin JSON-RPC commands using requests
## Usage
```python
from rpc import BitcoinCLI# port: 18332 - testnet, 18443 - regtest, 8332 - mainnet
cli = BitcoinCLI("bitcoinrpc", "mysecretpassword", port=18443)print(cli.url)
print(cli.getmininginfo())
print(cli.listwallets())
##### WORKING WITH WALLETS #########
# specify wallet name as a key argument
print(cli.getbalance(wallet=""))# or create a new instance for this wallet
w = cli.wallet("mywallet") # will load default wallet.dat# url will be different
print(w.url)print(w.getbalance()) # now you can call commands for the wallet
```