taler-docs

Documentation for GNU Taler components, APIs and protocols
Log | Files | Refs | README | LICENSE

commit d9cb83110b44a4f23cdb697a37137a46bf311335
parent a7c3ed706f11ae405cfda7501577812a07ef8213
Author: Antoine A <>
Date:   Tue, 29 Jul 2025 23:40:46 +0200

depolymerizer-bitcoin: improve manual

Diffstat:
Mdepolymerization/bitcoin-manual.rst | 250++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-----
1 file changed, 236 insertions(+), 14 deletions(-)

diff --git a/depolymerization/bitcoin-manual.rst b/depolymerization/bitcoin-manual.rst @@ -50,39 +50,261 @@ Navigate into the *depolymerization* local repository, and from top-level run: .. code-block:: console $ ./bootstrap + +Install deb package +~~~~~~~~~~~~~~~~~~~ + +To install the depolymerizer as a Debian/Ubuntu package with an automated secure setup and systemd services: + +.. code-block:: console + + $ cargo install cargo-deb + $ make deb + $ sudo dpkg -i target/debian/depolymerizer-bitcoin/*.deb + +If the previous steps succeeded, the ``depolymerizer-bitcoin`` command should be found in the $PATH. + +Install binaries +~~~~~~~~~~~~~~~~ + +To install the depolymerizer binaries and default configuration localy run: + +.. code-block:: console + $ ./configure --prefix=$PREFIX $ make install If the previous steps succeeded, the ``depolymerizer-bitcoin`` command should be found in the $PATH. - Database setup ============== -The configuration file must include a connection string that -tells Bitcoin Depolymerizer how it should connect to the database. The default +Using package script +-------------------- + +The configuration file must include a connection string that tells the depolymerizer how it should connect to the database. The default +is: + +.. code-block:: ini + :caption: /etc/depolymerizer-bitcoin/secrets/depolymerizer-bitcoin-db.secret.conf + + [depolymerizer-bitcoindb-postgres] + config = postgres:///depolymerizer-bitcoin + +If the database is run on a different host, please follow the instructions +from the PostgreSQL manual for configuring remote access. + +Assuming the configuration is correct, the following +command initializes (or upgrades) the database schema using: +You can then use a script to automate a secure database setup: + +.. code-block:: console + + $ sudo depolymerizer-bitcoin-dbconfig + +Minimal setup +------------- + +The configuration file must include a connection string that tells the depolymerizer how it should connect to the database. The default is: .. code-block:: ini + :caption: $CONFIG_FILE [depolymerizer-bitcoindb-postgres] config = postgres:///depolymerizer-bitcoin You must make sure that this database exists and is accessible to the user -running Bitcoin Depolymerizer before continuing. Then, the Bitcoin -Depolymerizer database schema must be created (or updated) to the current -Bitcoin Depolymerizer version using the following command: +running the depolymerizer before continuing. If the database is run on a different host, please follow the instructions from the PostgreSQL manual for configuring remote access. + +Assuming that the configuration file exists at ``$CONFIG_FILE``, the following +command initializes (or upgrades) the database schema: + +.. code-block:: console + + $ depolymerizer-bitcoin -c "$CONFIG_FILE" dbinit + +Worker setup +============ + +Note that bitcoind & bitcoin-cli should already be in $PATH, you can install them from the `Bitcoin Core website <https://bitcoincore.org/en/download/>`_. + +.. code-block:: console + + $ curl -L https://bitcoincore.org/bin/bitcoin-core-29.0/bitcoin-29.0-x86_64-linux-gnu.tar.gz | tar xz + +Using systemd services +---------------------- + +Start the node service: + +.. code-block:: console + + $ sudo systemctl start depolymerizer-bitcoin-node + +Then check if the node is running: + +.. code-block:: console + + $ sudo -u depolymerizer-bitcoin-node bitcoin-cli -conf=/etc/bitcoind/bitcoin.conf -datadir=/var/lib/bitcoind getblockchaininfo + +You will need a bitcoin wallet to sync, you can either create: + +.. code-block:: console + + $ sudo -u depolymerizer-bitcoin-node bitcoin-cli -conf=/etc/bitcoind/bitcoin.conf -datadir=/var/lib/bitcoind createwallet $WALLET false false $PASSWORD + +Or use an existing one: + +.. code-block:: console + + $ sudo -u depolymerizer-bitcoin-node bitcoin-cli -conf=/etc/bitcoind/bitcoin.conf -datadir=/var/lib/bitcoind loadwallet $WALLET + +You also need to choose an address from you wallet to use as it's unique Taler identifier. You can generate a new address using: + +.. code-block:: console + + $ sudo -u depolymerizer-bitcoin-node bitcoin-cli -conf=/etc/bitcoind/bitcoin.conf -datadir=/var/lib/bitcoind -rpcwallet=$WALLET getnewaddress + +Update the configuration files: + +.. code-block:: ini + :caption: /etc/depolymerizer-bitcoin/depolymerizer-bitcoin.conf + + [depolymerizer-bitcoin] + CURRENCY = BTC + WALLET = $ADDRESS + NAME = John Smith S.A. + +.. code-block:: ini + :caption: /etc/depolymerizer-bitcoin/conf.d/depolymerizer-bitcoin-worker.conf + + [depolymerizer-bitcoin-worker] + WALLET_NAME = $WALLET + +.. code-block:: ini + :caption: /etc/depolymerizer-bitcoin/secrets/depolymerizer-bitcoin-worker.secret.conf + + [depolymerizer-bitcoin-worker] + PASSWORD = $PASSWORD + +And finaly run the setup process: + +.. code-block:: console + + $ sudo -u depolymerizer-bitcoin-worker depolymerizer-bitcoin setup + +You can then start the worker service: + +.. code-block:: console + + $ sudo systemctl start depolymerizer-bitcoin-worker + +Minimal setup +------------- + +You need to edit bitcoind default configuration: + +.. code-block:: ini + :caption: $HOME/.bitcoin/bitcoin.conf + + txindex=1 # Enable full transaction indexes + rpcservertimeout=0 # Disable RPC timeout + +Start the node daemon: + +.. code-block:: console + + $ bitcoind + +In another terminal check if the node is running: + +.. code-block:: console + + $ bitcoin-cli getblockchaininfo + +You will need a bitcoin wallet to sync, you can either create: + +.. code-block:: console + + $ bitcoin-cli createwallet $WALLET false false $PASSWORD + +Or use an existing one: .. code-block:: console - $ depolymerizer-bitcoin-dbinit -c "$CONFIG_FILE" + $ bitcoin-cli loadwallet $WALLET -where ``$CONFIG_FILE`` is again the path to a configuration that contains at -least the above ``[depolymerizer-bitcoindb-postgres]`` section. +You also need to choose an address from you wallet to use as it's unique Taler identifier. You can generate a new address using: -Setting up a local bitcoin node -=============================== +.. code-block:: console -Note that bitcoind & bitcoin-cli should already be in $PATH. + $ bitcoin-cli -rpcwallet=$WALLET getnewaddress + +Update the configuration files: + +.. code-block:: ini + :caption: $CONFIG_FILE + + [depolymerizer-bitcoin] + CURRENCY = BTC + WALLET = $ADDRESS + NAME = John Smith S.A. + + [depolymerizer-bitcoin-worker] + WALLET_NAME = $WALLET + PASSWORD = $PASSWORD + +And finaly run the setup process and the worker: + +.. code-block:: console + + $ depolymerizer-bitcoin -c "$CONFIG_FILE" setup + $ depolymerizer-bitcoin -c "$CONFIG_FILE" worker + +The worker will start working, you can enter another terminal. + +API setup +========= + +Using systemd services +---------------------- + +Update the configuration files: + +.. code-block:: ini + :caption: /etc/depolymerizer-bitcoin/conf.d/depolymerizer-bitcoin-httpd.conf + + [depolymerizer-bitcoin-httpd-wire-gateway-api] + ENABLED = YES + +.. code-block:: ini + :caption: /etc/depolymerizer-bitcoin/secrets/depolymerizer-bitcoin-httpd.secret.conf + + [depolymerizer-bitcoin-httpd-wire-gateway-api] + AUTH_METHOD = bearer + TOKEN = $SECRET_TOKEN + +Then start the service: + +.. code-block:: console + + $ sudo systemctl start depolymerizer-bitcoin-httpd + +Minimal setup +------------- + +Update the configuration files: + +.. code-block:: ini + :caption: $CONF_FILE + + [depolymerizer-bitcoin-httpd-wire-gateway-api] + AUTH_METHOD = bearer + TOKEN = $SECRET_TOKEN + +Then start the server: + +.. code-block:: console -TODO -\ No newline at end of file + $ depolymerizer-bitcoin -c "$CONF_FILE" serve +\ No newline at end of file