Blockchain copy guide (#172)

* SSH Setup Guide Touchups

* Guide for copying the blockchain from one embassy to another.

* Update blockchain-copy.rst

* break out bitcoin pages and touch up copy guide

Co-authored-by: kn0wmad <39687477+kn0wmad@users.noreply.github.com>
This commit is contained in:
gStart9
2022-09-26 19:17:22 +00:00
committed by GitHub
parent 72a75f1aeb
commit 6eb09af479
7 changed files with 165 additions and 62 deletions

View File

@@ -0,0 +1,26 @@
.. _bitcoin-cli:
===========
Bitcoin CLI
===========
Instructions for accessing the bitcoind service in order to issue commands directly.
.. warning:: This is an advanced feature and should be used with caution. Start9 is not responsible for any damage you might cause through SSH access.
#. First, you will need SSH access. Please see the :ref:`setup instructions <ssh>` for details.
#. Access your Embassy and then you can interact with the bitcoind docker container using the following syntax:
.. code-block:: bash
sudo docker exec -ti bitcoind.embassy bitcoin-cli COMMAND
.. tip:: For example ``sudo docker exec -ti bitcoind.embassy bitcoin-cli getnetworkinfo``
A list of possible commands can be found `here <https://developer.bitcoin.org/reference/rpc/>`__.
You can also drop into a shell using::
sudo docker exec -ti bitcoind.embassy bash
and then enter ``bitcoin-cli`` commands. When you are finished, simply type ``exit``...

View File

@@ -1,8 +1,8 @@
.. _bitcoin-service:
.. _bitcoin-integrations:
=======
Bitcoin
=======
====================
Bitcoin Integrations
====================
.. contents::
:depth: 2
@@ -145,30 +145,3 @@ Trezor Suite
**Instructions**
Follow the `guide <https://github.com/Start9Labs/electrs-wrapper/blob/master/docs/integrations/trezor/guide.md>`__.
.. _bitcoin-cli:
Bitcoin-Cli
-----------
Instructions for accessing the bitcoind service in order to issue commands directly.
.. warning:: This is an advanced feature and should be used with caution. Start9 is not responsible for any damage you might cause through SSH access.
#. First, you will need SSH access. Please see the :ref:`setup instructions <ssh>` for details.
#. Access your Embassy and then you can interact with the bitcoind docker container using the following syntax:
.. code-block:: bash
sudo docker exec -ti bitcoind.embassy bitcoin-cli COMMAND
.. tip:: For example ``sudo docker exec -ti bitcoind.embassy bitcoin-cli getnetworkinfo``
A list of possible commands can be found `here <https://chainquery.com/bitcoin-cli>`__.
You can also drop into a shell using::
sudo docker exec -ti bitcoind.embassy bash
and then enter ``bitcoin-cli`` commands. When you are finished, simply type ``exit``...

View File

@@ -0,0 +1,53 @@
.. _blockchain-copy:
====================
Blockchain Migration
====================
.. contents::
:depth: 2
:local:
If you have already synced the Bitcoin blockchain to the tip on one Embassy, and would like to skip IBD on another Embassy, follow this guide.
.. note:: The following guide requires that you have already :ref:`setup SSH on both Embassies<ssh>`.
In this guide, we will refer to your synced Embassy as embassy-AAAAAAA.local and the Embassy with no Bitcoin synced as embassy-BBBBBBB.local. Of course, please replace AAAAAAA and BBBBBBB with your appropriate Embassies' names.
**Log into Embassy with synced blockchain**
#. Stop the Bitcoin Core service on `https://embassy-AAAAAAA.local` (Services > Bitcoin Core > Stop)
#. :ref:`Open an ssh session <connecting-via-ssh>` to your Embassy with the synced chain (embassy-AAAAAAAA.local)
#. Once at the shell, perform the following commands
.. code-block:: bash
sudo -i
ssh-keygen -t ed25519 -N '' -f .ssh/embassy2.key
chmod 600 .ssh/embassy2.key*
cat .ssh/embassy2.key.pub
#. Copy the output from the cat command into embassy-BBBBBBB's **Embassy -> SSH -> Add New Key** text field:
.. figure:: /_static/images/walkthrough/ssh_key_add.jpg
#. Back on the shell of embassy-AAAAAAA.local, do the following (don't forget to replace embassy-BBBBBBB.local in the rsync command before you perform it):
.. code-block:: bash
cd /embassy-data/package-data/volumes/bitcoind/data/main/
rsync -e "ssh -i ~/.ssh/embassy2.key" -povgr --append-verify --rsync-path="sudo mkdir -p /embassy-data/package-data/volumes/bitcoind/data/main ; sudo rsync" ./{blocks,chainstate} start9@embassy-BBBBBBB.local:/embassy-data/package-data/volumes/bitcoind/data/main/
#. Wait some hours until the copy is complete. On a gigabit network, the limiting factor will be the write speed of your SSD on the receiving Embassy. When it is complete, clean up a bit:
.. code-block:: bash
rm .ssh/embassy2.key*
exit
#. Log into `https://embassy-BBBBBBB.local` and install, configure, and then start your Bitcoin Core service. You should see it begin at 99%+ pre-synced.
#. You can now restart your Bitcoin Core service on `https://embassy-AAAAAAA.local` (Services > Bitcoin Core > Start)
.. _bitcoin-service:

View File

@@ -0,0 +1,14 @@
.. _bitcoin-service:
=======
Bitcoin
=======
These guides will help you to setup external tools to connect or interact with :ref:`Bitcoin<bitcoin>`, such as a wallet.
.. toctree::
:maxdepth: 1
bitcoin-integrations
bitcoin-cli
blockchain-copy

View File

@@ -9,7 +9,7 @@ These guides will help you to setup external tools to connect or interact with s
.. toctree::
:maxdepth: 1
bitcoin
bitcoin/index
lightning
matrix
vaultwarden

View File

@@ -61,6 +61,8 @@ Registering an SSH Key
You are now ready to SSH into your Embassy!
.. _connecting-via-ssh:
Connecting via CLI (Linux/Mac)
------------------------------