Projects : gbw-node : gbw-node_memoryview_replacement
| 1 | About |
| 2 | ----- |
| 3 | |
| 4 | This is gbw-node, the online database component of Gales Bitcoin Wallet as described at: |
| 5 | |
| 6 | http://fixpoint.welshcomputing.com/2019/gales-bitcoin-wallet-spec-and-battle-plan/ |
| 7 | http://fixpoint.welshcomputing.com/2019/draft-gbw-node-schema/ |
| 8 | |
| 9 | It indexes and formats data as needed for the offline counterpart, gbw-signer. |
| 10 | |
| 11 | Written by Jacob Welsh for JWRD Computing. |
| 12 | |
| 13 | Prerequisites |
| 14 | ------------- |
| 15 | |
| 16 | - sqlite 3.7.0 or newer including the sqlite3 shell |
| 17 | - python 2.7.x including the sqlite3 module (2.5+ might suffice, but untested) |
| 18 | - Bitcoin node including at least the dumpblock fix ( http://fixpoint.welshcomputing.com/2021/alert-dumpblock-flaw-in-bitcoind-can-cause-gbw-node-to-incorrectly-report-transactions/ ) |
| 19 | |
| 20 | Installation |
| 21 | ------------ |
| 22 | |
| 23 | This software ignores some historical Unix conventions in favor of a simplified variant of Bernstein's /package scheme ( http://cr.yp.to/slashpackage.html ). Installation paths and command names are not configurable, which amounts to a global namespace claim, such that people and programs can count on finding components at known paths if they are to be found at all. User commands are symlinked into /usr/bin and will replace prior files in case of conflict; see "package/commands" for the list. |
| 24 | |
| 25 | You will need root privileges to install. |
| 26 | |
| 27 | 1. Create the top-level /package directory if necessary and place the tree at its fully version-qualified path: |
| 28 | |
| 29 | mkdir -p /package |
| 30 | cp -r /YOUR/PATH/TO/gbw-node /package/gbw-node-2 |
| 31 | |
| 32 | 2. Run the install script from the above directory: |
| 33 | |
| 34 | cd /package/gbw-node-2 |
| 35 | sh package/install |
| 36 | |
| 37 | To revert to this version after installing a different one, simply repeat step 2. |
| 38 | |
| 39 | Operation |
| 40 | --------- |
| 41 | |
| 42 | The main program is "gbw-node", which provides a number of subcommands. Run "gbw-node help" for details. |
| 43 | |
| 44 | The database is initialized automatically on first run. It can then be queried directly using the SQLite shell : |
| 45 | |
| 46 | sqlite3 ~/.gbw/db |
| 47 | |
| 48 | When doing so, the following settings are recommended to include in ~/.sqliterc : |
| 49 | |
| 50 | PRAGMA foreign_keys=ON; |
| 51 | .headers on |
| 52 | .mode quote |
| 53 | |
| 54 | The first enables enforcement of the declared referential constraints, which SQLite disables by default for compatibility reasons. The rest make the output more readable; especially quote mode is essential for viewing address and txid fields which are packed as blobs. If your SQLite version doesn't support it, ".mode insert" is a more verbose alternative. |
| 55 | |
| 56 | RPC username and password for sending commands to the local bitcoind are read from ~/.bitcoin/bitcoin.conf. |
| 57 | |
| 58 | It's possible for bitcoind to get blocked on writing to a pipe if a scan process is interrupted during the dumpblock call. To recover, allow the write to complete: |
| 59 | |
| 60 | cat ~/.gbw/blockpipe >/dev/null |