mirror of
https://github.com/basicswap/basicswap.git
synced 2025-11-05 10:28:10 +01:00
preparescript: Fix missing btc wallet with --addcoin=bitcoin and --usebtcfastsync
doc: Fetch latest xmr chain height
This commit is contained in:
@@ -1,14 +1,14 @@
|
||||
|
||||
## Source code
|
||||
|
||||
$ git clone https://github.com/tecnovert/basicswap.git
|
||||
git clone https://github.com/tecnovert/basicswap.git
|
||||
|
||||
|
||||
## Run Using Docker
|
||||
|
||||
Docker must be installed and started:
|
||||
|
||||
$ docker -v
|
||||
docker -v
|
||||
|
||||
Should return a line containing `Docker version`...
|
||||
|
||||
@@ -20,19 +20,23 @@ It's recommended to setup docker to work without sudo:
|
||||
|
||||
#### Create the images:
|
||||
|
||||
$ cd basicswap/docker
|
||||
$ docker-compose build
|
||||
cd basicswap/docker
|
||||
docker-compose build
|
||||
|
||||
|
||||
#### Prepare the datadir:
|
||||
|
||||
Set XMR_RPC_HOST and BASE_XMR_RPC_PORT to a public XMR node or exclude to run a local node.
|
||||
|
||||
Set xmrrestoreheight to the current xmr chain height.
|
||||
|
||||
CURRENT_XMR_HEIGHT=$(curl https://localmonero.co/blocks/api/get_stats | jq .height)
|
||||
|
||||
Adjust `--withcoins` and `--withoutcoins` as desired, eg: `--withcoins=monero,bitcoin`. By default only Particl is loaded.
|
||||
|
||||
$ 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" --xmrrestoreheight=2485205
|
||||
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" --xmrrestoreheight=$CURRENT_XMR_HEIGHT
|
||||
|
||||
**Record the mnemonic from the output of the above command.**
|
||||
|
||||
@@ -51,8 +55,8 @@ Valid options can be listed with: `timedatectl list-timezones`
|
||||
|
||||
#### Start the container:
|
||||
|
||||
$ export COINDATA_PATH=/var/data/coinswaps
|
||||
$ docker-compose up
|
||||
export COINDATA_PATH=/var/data/coinswaps
|
||||
docker-compose up
|
||||
|
||||
Open in browser: `http://localhost:12700`
|
||||
|
||||
@@ -60,9 +64,9 @@ 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
|
||||
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
|
||||
|
||||
You can copy an existing pruned datadir (excluding bitcoin.conf and any wallets) over to `$COINDATA_PATH/bitcoin`
|
||||
Remove any existing wallets after copying over a pruned chain or the Bitcoin daemon won't start.
|
||||
@@ -81,14 +85,14 @@ Windows key + R -> "wsl" -> Enter
|
||||
|
||||
Install Git:
|
||||
|
||||
$ sudo apt update
|
||||
$ sudo apt install git
|
||||
sudo apt update
|
||||
sudo apt install git
|
||||
|
||||
|
||||
Download the BasicSwap code:
|
||||
|
||||
$ git clone https://github.com/tecnovert/basicswap.git
|
||||
$ cd basicswap/docker/
|
||||
git clone https://github.com/tecnovert/basicswap.git
|
||||
cd basicswap/docker/
|
||||
|
||||
|
||||
It's significantly faster to set COINDATA_PATH in the linux filesystem.
|
||||
@@ -102,61 +106,72 @@ Continue from the [Run Using Docker](#run-using-docker) section.
|
||||
|
||||
### Ubuntu Setup:
|
||||
|
||||
$ apt-get install -y wget python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config
|
||||
apt-get install -y wget python3-pip gnupg unzip protobuf-compiler automake libtool pkg-config curl jq
|
||||
|
||||
### OSX Setup:
|
||||
|
||||
Install Homebrew:
|
||||
Install Homebrew (See https://brew.sh/):
|
||||
|
||||
https://brew.sh/
|
||||
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
|
||||
|
||||
Command Line Tools:
|
||||
|
||||
$ xcode-select --install
|
||||
xcode-select --install
|
||||
|
||||
Dependencies:
|
||||
|
||||
$ brew install wget unzip python git protobuf gnupg automake libtool pkg-config
|
||||
brew install wget unzip python3 git protobuf gnupg automake libtool pkg-config curl jq
|
||||
|
||||
Install python SSL Certificates:
|
||||
|
||||
sudo "/Applications/Python 3.9/Install Certificates.command"
|
||||
|
||||
|
||||
### Basicswap:
|
||||
|
||||
$ export SWAP_DATADIR=/Users/$USER/coinswaps
|
||||
$ mkdir -p "$SWAP_DATADIR/venv"
|
||||
$ python3 -m venv "$SWAP_DATADIR/venv"
|
||||
$ . $SWAP_DATADIR/venv/bin/activate && python -V
|
||||
$ cd $SWAP_DATADIR
|
||||
$ wget -O coincurve-anonswap.zip https://github.com/tecnovert/coincurve/archive/anonswap.zip
|
||||
$ unzip coincurve-anonswap.zip
|
||||
$ cd $SWAP_DATADIR/coincurve-anonswap
|
||||
$ pip3 install .
|
||||
export SWAP_DATADIR=/Users/$USER/coinswaps
|
||||
mkdir -p "$SWAP_DATADIR/venv"
|
||||
python3 -m venv "$SWAP_DATADIR/venv"
|
||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||
cd $SWAP_DATADIR
|
||||
wget -O coincurve-anonswap.zip https://github.com/tecnovert/coincurve/archive/anonswap.zip
|
||||
unzip coincurve-anonswap.zip
|
||||
cd $SWAP_DATADIR/coincurve-anonswap
|
||||
pip3 install .
|
||||
|
||||
|
||||
$ cd $SWAP_DATADIR
|
||||
$ git clone https://github.com/tecnovert/basicswap.git
|
||||
$ cd $SWAP_DATADIR/basicswap
|
||||
$ protoc -I=basicswap --python_out=basicswap basicswap/messages.proto
|
||||
$ pip3 install .
|
||||
cd $SWAP_DATADIR
|
||||
git clone https://github.com/tecnovert/basicswap.git
|
||||
cd $SWAP_DATADIR/basicswap
|
||||
protoc -I=basicswap --python_out=basicswap basicswap/messages.proto
|
||||
pip3 install .
|
||||
|
||||
Prepare the datadir:
|
||||
|
||||
XMR_RPC_HOST="node.xmr.to" BASE_XMR_RPC_PORT=18081 basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --xmrrestoreheight=2245107
|
||||
CURRENT_XMR_HEIGHT=$(curl https://localmonero.co/blocks/api/get_stats | jq .height)
|
||||
|
||||
XMR_RPC_HOST="node.xmr.to" BASE_XMR_RPC_PORT=18081 basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --xmrrestoreheight=$CURRENT_XMR_HEIGHT
|
||||
|
||||
OR using a local XMR daemon:
|
||||
basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --xmrrestoreheight=2245107
|
||||
basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero --xmrrestoreheight=$CURRENT_XMR_HEIGHT
|
||||
|
||||
Record the mnemonic from the output of the above command.
|
||||
|
||||
Start the app
|
||||
Start Basicswap:
|
||||
|
||||
$ basicswap-run --datadir=$SWAP_DATADIR
|
||||
basicswap-run --datadir=$SWAP_DATADIR
|
||||
|
||||
Open in browser: `http://localhost:12700`
|
||||
It may take a few minutes to start as the coin daemons are started before the http interface.
|
||||
|
||||
|
||||
Add a coin:
|
||||
export SWAP_DATADIR=/Users/$USER/coinswaps
|
||||
basicswap-prepare --usebtcfastsync --datadir=/$SWAP_DATADIR --addcoin=bitcoin
|
||||
|
||||
|
||||
Start after installed:
|
||||
|
||||
$ export SWAP_DATADIR=/Users/$USER/coinswaps
|
||||
$ . $SWAP_DATADIR/venv/bin/activate && python -V
|
||||
$ basicswap-run --datadir=$SWAP_DATADIR
|
||||
export SWAP_DATADIR=/Users/$USER/coinswaps
|
||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||
basicswap-run --datadir=$SWAP_DATADIR
|
||||
|
||||
Reference in New Issue
Block a user