From b96a82353679cdf02e3456d298bb840aad215987 Mon Sep 17 00:00:00 2001 From: Cryptoguard <cryptoguard@protonmail.com> Date: Fri, 9 Feb 2024 11:25:05 -0500 Subject: [PATCH 1/2] Update .env Update install.md Update install.md Update install.md Update upgrade.md Update upgrade.md --- doc/install.md | 20 +++++++------------- doc/upgrade.md | 3 --- docker/.env | 2 +- 3 files changed, 8 insertions(+), 17 deletions(-) diff --git a/doc/install.md b/doc/install.md index 168527d..2dd5592 100644 --- a/doc/install.md +++ b/doc/install.md @@ -30,12 +30,15 @@ Without this step you will need to preface each `docker-compose` command with `s https://docs.docker.com/engine/install/linux-postinstall/ +#### (Optional) Set custom coin data path: + +Coin-related files, such as blockchain and wallet files, are stored in `/var/data/coinswaps` by default. To use a different location, simply modify the target path in your `.env` file found within the `/docker` sub-folder. + + cd basicswap/docker + nano .env + #### Create the images: -COINDATA_PATH can be set to your preference but must be exported each time you launch Basicswap.<br> -Consider adding COINDATA_PATH to the `.env` file in the docker directory file so it's always set. - - export COINDATA_PATH=/var/data/coinswaps cd basicswap/docker docker-compose build @@ -57,14 +60,12 @@ Append `--usebtcfastsync` to the below command to optionally initialise the Bitc Setup with a local Monero daemon (recommended): - export COINDATA_PATH=/var/data/coinswaps docker run --rm -t --name swap_prepare -v $COINDATA_PATH:/coindata i_swapclient basicswap-prepare --datadir=/coindata --withcoins=monero --htmlhost="0.0.0.0" --wshost="0.0.0.0" --xmrrestoreheight=$CURRENT_XMR_HEIGHT To instead use Monero public nodes and not run a local Monero daemon<br>(it can be difficult to find reliable public nodes): Set XMR_RPC_HOST and BASE_XMR_RPC_PORT to a public XMR node. - export COINDATA_PATH=/var/data/coinswaps docker run --rm -e XMR_RPC_HOST="node.xmr.to" -e BASE_XMR_RPC_PORT=18081 -t --name swap_prepare -v $COINDATA_PATH:/coindata i_swapclient basicswap-prepare --datadir=/coindata --withcoins=monero --htmlhost="0.0.0.0" --wshost="0.0.0.0" --xmrrestoreheight=$CURRENT_XMR_HEIGHT @@ -72,10 +73,6 @@ To instead use Monero public nodes and not run a local Monero daemon<br>(it can **Mnemonics should be stored encrypted and/or air-gapped.** And the output of `echo $CURRENT_XMR_HEIGHT` for use if you need to later restore your wallet. -#### Make COINDATA_PATH permanent (optional): - -Edit the `.env` file in the docker directory and uncomment COINDATA_PATH line by deleting the hashtag. - #### Set the timezone (optional): Edit the `.env` file in the docker directory, set TZ to your local timezone. @@ -84,7 +81,6 @@ Valid options can be listed with: `timedatectl list-timezones` #### Start the container: - export COINDATA_PATH=/var/data/coinswaps docker-compose up Open in browser: `http://localhost:12700` @@ -94,7 +90,6 @@ Open in browser: `http://localhost:12700` ### Add a coin docker-compose stop - export COINDATA_PATH=/var/data/coinswaps docker run --rm -t --name swap_prepare -v $COINDATA_PATH:/coindata i_swapclient basicswap-prepare --datadir=/coindata --addcoin=bitcoin --usebtcfastsync You can copy an existing pruned datadir (excluding bitcoin.conf and any wallets) over to `$COINDATA_PATH/bitcoin` @@ -103,7 +98,6 @@ Remove any existing wallets after copying over a pruned chain or the Bitcoin dae With Encryption - export COINDATA_PATH=/var/data/coinswaps docker run -e WALLET_ENCRYPTION_PWD=passwordhere --rm -t --name swap_prepare -v $COINDATA_PATH:/coindata i_swapclient basicswap-prepare --datadir=/coindata --addcoin=bitcoin --usebtcfastsync diff --git a/doc/upgrade.md b/doc/upgrade.md index db8a563..9e1bae7 100644 --- a/doc/upgrade.md +++ b/doc/upgrade.md @@ -12,8 +12,6 @@ Update only the code (prepend sudo to each docker command if necessary): basicswap]$ git pull cd docker - export COINDATA_PATH=[PATH_TO] - (Probably export COINDATA_PATH=/var/data/coinswaps) docker-compose build docker-compose up @@ -21,7 +19,6 @@ If the dependencies have changed the container must be built with `--no-cache`: basicswap]$ git pull cd docker - export COINDATA_PATH=[PATH_TO] docker-compose build --no-cache docker-compose up diff --git a/docker/.env b/docker/.env index 2f40959..85b78cf 100644 --- a/docker/.env +++ b/docker/.env @@ -1,5 +1,5 @@ HTML_PORT=127.0.0.1:12700:12700 WS_PORT=127.0.0.1:11700:11700 -#COINDATA_PATH=/var/data/coinswaps +COINDATA_PATH=/var/data/coinswaps TOR_PROXY_HOST=172.16.238.200 TZ=UTC From 2793ee00dd587b63c46d7e3dc18c2789d933103f Mon Sep 17 00:00:00 2001 From: tecnovert <tecnovert@tecnovert.net> Date: Mon, 12 Feb 2024 21:49:24 +0200 Subject: [PATCH 2/2] doc: Rename docker/.env to example.env --- .gitignore | 1 + doc/install.md | 6 ++++++ doc/upgrade.md | 3 +-- docker/{.env => example.env} | 0 4 files changed, 8 insertions(+), 2 deletions(-) rename docker/{.env => example.env} (100%) diff --git a/.gitignore b/.gitignore index cbb1a75..b91cf81 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ __pycache__ # geckodriver.log *.log +docker/.env diff --git a/doc/install.md b/doc/install.md index 2dd5592..c49f029 100644 --- a/doc/install.md +++ b/doc/install.md @@ -30,6 +30,12 @@ Without this step you will need to preface each `docker-compose` command with `s https://docs.docker.com/engine/install/linux-postinstall/ +#### Copy the default environment file: + + cd basicswap/docker + cp example.env .env + + #### (Optional) Set custom coin data path: Coin-related files, such as blockchain and wallet files, are stored in `/var/data/coinswaps` by default. To use a different location, simply modify the target path in your `.env` file found within the `/docker` sub-folder. diff --git a/doc/upgrade.md b/doc/upgrade.md index 9e1bae7..41031d1 100644 --- a/doc/upgrade.md +++ b/doc/upgrade.md @@ -27,8 +27,7 @@ If the dependencies have changed the container must be built with `--no-cache`: After updating the code and rebuilding the container run: - basicswap/docker]$ export COINDATA_PATH=[PATH_TO] - $ docker-compose run --rm swapclient \ + basicswap/docker]$ docker-compose run --rm swapclient \ basicswap-prepare --datadir=/coindata --preparebinonly --withcoins=monero,bitcoin diff --git a/docker/.env b/docker/example.env similarity index 100% rename from docker/.env rename to docker/example.env