Comments (5)
Between major versions the database is not automatically updated unfortunately.
What you can do is copy the private keys and recreate the wallets. In tools/import_database.py you can find an example of a very basic automated script to import a bunch of wallets.
Make sure you backup the database before you run any scripts, but you already knew that...
from bitcoinlib.
I don't see an import_database.py anywhere in this repo
from bitcoinlib.
I think I can figure this out by looking at the source for clw though
from bitcoinlib.
Here's a quick and dirty script I wrote to migrate my wallets from an old database to a new one:
#!/usr/bin/env python3
"""Pretty hacky, but it works. Move the database from
~/.bitcoinlib/database/bitcoinlib.sqlite to
database-bitcoinlib.sqlite, then run this script
"""
import subprocess
from bitcoinlib.config.config import DEFAULT_DATABASE
from bitcoinlib.wallets import Wallet, wallets_list
print(f"database: {DEFAULT_DATABASE}")
# learned how to do this from clw
for w in wallets_list(db_uri='database-backup.sqlite'):
if 'parent_id' in w and w['parent_id']:
continue
wlt = Wallet(w['name'], db_uri='database-backup.sqlite')
print(f"[{w['id']}] {w['name']} ({w['network']}) {w['owner']}")
subprocess.run(['clw', '-c', wlt.main_key.wif, w['name']], check=True)
try:
subprocess.run(['clw', '--update-transactions', w['name']], check=True)
except subprocess.CalledProcessError:
pass # we'll just try again later
from bitcoinlib.
I'm sorry, I saw the tools/import_database.py was only available in the latest version and not in the current branch.
https://github.com/1200wd/bitcoinlib/blob/release-v07/bitcoinlib/tools/import_database.py
But your script seems to do the same...
from bitcoinlib.
Related Issues (20)
- BRC20 HOT 1
- Using BIP38 encrypted Private Key throw error HOT 2
- Sending transaction in WSL2 Ubuntu + BTC Node on local network = TXID but nothing is sent HOT 1
- error when parse a raw transation
- Error parsing bitcoin testnet transaction HOT 1
- Asynchronous Version? HOT 1
- Error in transaction parsing: Incorrect pubkeyhash length HOT 8
- Send BTC
- Error creating wallet from wif HOT 1
- I am encountering an issue with retrieving UTXO and balance values. Please help. HOT 1
- Error in transaction (sign and send): Please help. HOT 4
- Payment gateway for my marketplace
- Return failed transaction
- Getting error "non-mandatory-script-verify-flag (Witness program hash mismatch)" when trying to send raw signed transaction HOT 2
- local bitcoind provider, getting error "No wallet is loaded."
- Invalid Addresses? HOT 1
- bitcoinlib.scripts.ScriptError: Expected a sequence of 69 bytes, got 70 HOT 3
- sighash problems HOT 3
- Add a Electrum rivate server service
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bitcoinlib.