-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define standard key paths in configuration
- Loading branch information
Cryp Toon
committed
Apr 7, 2024
1 parent
70d35db
commit 8595801
Showing
3 changed files
with
48 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
# | ||
# BitcoinLib - Python Cryptocurrency Library | ||
# | ||
# EXAMPLES - Using Bitcoin Core wallets with Bitcoinlib | ||
# | ||
# © 2024 April - 1200 Web Development <http://1200wd.com/> | ||
# | ||
|
||
import os | ||
from bitcoinlib.wallets import wallet_create_or_open | ||
from bitcoinlib.services.bitcoind import BitcoindClient | ||
|
||
# | ||
# Settings and Initialization | ||
# | ||
|
||
# Generate your own private key with: HDKey(network='testnet').wif_private() | ||
pkwif = 'vprv9DMUxX4ShgxMKxHYfZ7Z35RxRLC9Av59MyJaMmCFRqfvUdUZdBB1awTDvTfDzZbtsPzZVCcpCunaELcuPsnLeLMg634hsxSSvwpTdfgCYMX' | ||
# Put connection string with format http://bitcoinlib:password@localhost:18332) | ||
# to Bitcoin Core node in the following file: | ||
bitcoind_url = open(os.path.join(os.path.expanduser('~'), ".bitcoinlib/.bitcoind_connection_string")).read() | ||
bcc = BitcoindClient(base_url=bitcoind_url) | ||
lastblock = bcc.proxy.getblockcount() | ||
print("Connected to bitcoind, last block: " + str(lastblock)) | ||
|
||
# | ||
# Create Wallets | ||
# | ||
|
||
|
||
|
||
|
||
# | ||
# Using wallets | ||
# | ||
|