diff --git a/README.md b/README.md
index 3153606..64b3822 100644
--- a/README.md
+++ b/README.md
@@ -15,6 +15,7 @@ This repository contains the back end code. The user interface is contained in t
## Media
- [High-level Overview of bch-dex](https://youtu.be/LVX8CLi4sHw) (Video)
- [Developer walk-through for installing and hacking on bch-dex](https://youtu.be/T5XI43-SWJo) (Video)
+ - This video is out of date. Follow the instructions below.
## Participate
This is an open source project, and we encourage other JavaScript developers to participate in its creation and maintenance. We have two chat rooms for the community:
@@ -31,39 +32,42 @@ Running the DEX requires composition of these different software packages:
The above software is orchestrated using [Docker](https://www.docker.com/) and Docker Compose. The target operating system is Ubuntu 20+, and the target hardware is amd64 (normal desktop PCs) and the arm64 (Raspberry Pi 4). Trying to operate this software on other operating systems or hardware is possible, but not supported.
+The Raspberry Pi 4 is the primary hardware target, because this software functions best when it is always running. The Pi 4 makes a great appliance for monitoring trade signals and finalizing trades.
+
Instructions for setting up Node.js, Docker, and Docker Compose can be found in [this Gist](https://gist.github.com/christroutner/a39f656850dc022b60f25c9663dd1cdd). Walk-through videos can also be found on the [PSF Videos page](https://psfoundation.cash/video/).
-Building the Docker containers and getting the app working involve these steps:
+Here are the steps involved in setting up bch-dex:
1. Follow the direction in [this Gist](https://gist.github.com/christroutner/a39f656850dc022b60f25c9663dd1cdd) to install Node.js, Docker, and Docker Compose.
1. Clone the repository with `git clone https://github.com/Permissionless-Software-Foundation/bch-dex` and enter it with `cd bch-dex`.
1. Install dependencies by running `npm install`
-1. Create a wallet by executing the [create-wallet.js script](./production/scripts/create-wallet.js) with `node create-wallet.js`
-1. Move the `wallet.json` file to the `bch-dex` folder in either the [x86 Docker folder](./production/docker/bch-dex) or the [RPi Docker folder](./production/rpi-docker/bch-dex/) depending on your hardware target.
-1. Change directory to the `docker` or `rpi-docker` folder depending on your hardware target.
-1. Build the Docker containers with `docker-compose build --no-cache`.
+1. Create a wallet:
+ - `cd production/scripts`
+ - `node create-wallet.js`
+1. Change directory to the `production/docker` or `production/rpi-docker` folder depending on your hardware target.
+1. Pull the Docker images down from Docker Hub: `docker-compose pull`
1. Start the Docker containers with `docker-compose up -d`
-1. Wait for the containers to run for about a minute, then bring them down with `docker-compose down`. That will create the needed folders in `production/data`.
-1. Copy the `swarm.key` into the `production/data/go-ipfs/data/` directory. This will allow the IPFS node to connect to the PSF private network.
-1. Bring the containers back up with `docker-compose up -d`.
1. Wait for the P2WDB to sync and populate bch-dex with trade data. You can monitor it with `docker logs --tail 20 -f p2wdb`.
1. Open a web browser and navigate the `http://localhost:4500`. You'll be able to see new Offers as they come in and are detected by bch-dex.
1. To take the other side of the trade, click the `Take` button in the UI.
1. You can add the 12-word mnemonic from the `wallet.json` file to the the web wallet, which will mirror your wallet in the UI, and allow you to perform basic wallet functions (send and receive BCH and tokens).
+## Blockchain Infrastructure
+
+The P2WDB and bch-dex containers requires a 'Global Back End' (as described in [CashStack.info](https://cashstack.info)) in order to connect to the blockchain. By default, the Docker containers connect to [free-bch.fullstack.cash](https://free-bch.fullstack.cash/). Several community-provided Global Back End servers are provided and can be [viewed here](https://gist.github.com/christroutner/63c5513782181f8b8ea3eb89f7cadeb6). The back end can be changed by setting the `CONSUMER_URL` environment variable in the `docker-compose.yml` file.
### Applying Software Updates
As this is an active project, software updates will happen frequently. To apply a software update, perform these steps.
-
- - Enter the `docker` or `rpi-docker` folder, depending on your hardware target.
-- Bring down the Docker containers with `docker-compose down`.
-- Pull in the software updates with `git pull`
-- Update dependencies with `npm install`
-- Rebuild the Docker containers with `docker-compose build --no-cache`
-- Clean up disk space by deleting old Docker images with `./cleanup-images.sh`
-- Start the Docker containers with `docker-compose up -d`
-
+
+1. Enter the `docker` or `rpi-docker` folder, depending on your hardware target.
+1. Bring down the Docker containers with `docker-compose down`.
+1. Pull in the software updates with `git pull`
+1. Update dependencies with `npm install`
+1. Pull new Docker images with `docker-compose pull`
+1. Clean up disk space by deleting old Docker images with `./cleanup-images.sh`
+1. Start the Docker containers with `docker-compose up -d`
+
Sometimes it may be necessary to delete the databases before applying a software update. This can be done by stopping the Docker containers and deleting the `production/data` directory. When the Docker containers are restarted, they will recreate that directory. The P2WDB will re-sync and bch-dex will be populated with fresh trade data.
diff --git a/config/env/common.js b/config/env/common.js
index 0066fe0..e2ae8c3 100644
--- a/config/env/common.js
+++ b/config/env/common.js
@@ -35,8 +35,8 @@ module.exports = {
useFullStackCash: process.env.USE_FULLSTACKCASH ? true : false,
consumerUrl: process.env.CONSUMER_URL
? process.env.CONSUMER_URL
- // : 'https://free-bch.fullstack.cash',
- : 'https://wa-usa-bch-consumer.fullstackcash.nl',
+ : 'https://free-bch.fullstack.cash',
+ // : 'https://wa-usa-bch-consumer.fullstackcash.nl',
// P2WDB URL that will accept API calls from the p2wdb npm library.
p2wdbUrl: process.env.P2WDB_URL ? process.env.P2WDB_URL : 'https://p2wdb.fullstack.cash',
diff --git a/production/docker/docker-compose.yml b/production/docker/docker-compose.yml
index 3c7cf48..9a7c112 100644
--- a/production/docker/docker-compose.yml
+++ b/production/docker/docker-compose.yml
@@ -43,10 +43,13 @@ services:
restart: always
p2wdb:
- build:
- context: ./p2wdb/
- dockerfile: Dockerfile
+ #build:
+ # context: ./p2wdb/
+ # dockerfile: Dockerfile
+ image: christroutner/p2wdb-bch-dex:v1.6.2
container_name: p2wdb
+ environment:
+ CONSUMER_URL: 'https://free-bch.fullstack.cash'
logging:
driver: 'json-file'
options:
@@ -65,10 +68,13 @@ services:
restart: always
bch-dex:
- build:
- context: ./bch-dex/
- dockerfile: Dockerfile
+ #build:
+ # context: ./bch-dex/
+ # dockerfile: Dockerfile
+ image: christroutner/bch-dex:v1.6.2
container_name: bch-dex
+ environment:
+ CONSUMER_URL: 'https://free-bch.fullstack.cash'
logging:
driver: 'json-file'
options:
@@ -85,9 +91,10 @@ services:
restart: always
dex-ui:
- build:
- context: ./bch-dex-ui/
- dockerfile: Dockerfile
+ #build:
+ # context: ./bch-dex-ui/
+ # dockerfile: Dockerfile
+ image: christroutner/bch-dex-ui:v1.6.2
container_name: dex-ui
environment:
SERVER: 'http://192.168.2.3'
diff --git a/production/rpi-docker/bch-dex/Dockerfile b/production/rpi-docker/bch-dex/Dockerfile
index 434c43e..77ed09e 100644
--- a/production/rpi-docker/bch-dex/Dockerfile
+++ b/production/rpi-docker/bch-dex/Dockerfile
@@ -64,7 +64,7 @@ RUN npm install
RUN npm run docs
# Copy the wallet files
-COPY wallet.json wallet.json
+#COPY wallet.json wallet.json
#VOLUME /home/safeuser/keys
diff --git a/production/rpi-docker/docker-compose.yml b/production/rpi-docker/docker-compose.yml
index e1b1de6..f017852 100644
--- a/production/rpi-docker/docker-compose.yml
+++ b/production/rpi-docker/docker-compose.yml
@@ -31,7 +31,7 @@ services:
- 172.17.0.1:8080:8080
volumes:
- ../data/go-ipfs/data:/data/ipfs
- - ../data/go-ipfs/export:/export
+ - ../../swarm.key:/data/ipfs/swarm.key
# https://docs.docker.com/compose/compose-file/compose-file-v3/#command
# https://github.com/ipfs/go-ipfs/blob/91c52657166bcf86f2476926e4fe56694dc26562/Dockerfile#L115
command:
@@ -44,10 +44,13 @@ services:
restart: always
p2wdb:
- build:
- context: ./p2wdb/
- dockerfile: Dockerfile
+ #build:
+ # context: ./p2wdb/
+ # dockerfile: Dockerfile
+ image: christroutner/pwd-bch-dex-rpi:v1.6.2
container_name: p2wdb
+ environment:
+ CONSUMER_URL: 'https://free-bch.fullstack.cash'
logging:
driver: 'json-file'
options:
@@ -66,10 +69,13 @@ services:
restart: always
bch-dex:
- build:
- context: ./bch-dex/
- dockerfile: Dockerfile
+ #build:
+ # context: ./bch-dex/
+ # dockerfile: Dockerfile
+ image: christroutner/bch-dex-rpi:v1.6.2
container_name: bch-dex
+ environment:
+ CONSUMER_URL: 'https://free-bch.fullstack.cash'
logging:
driver: 'json-file'
options:
@@ -81,14 +87,15 @@ services:
- p2wdb
ports:
- '5700:5700' # :
- # volumes:
- # - ../data/ipfsdata:/home/safeuser/ipfs-service-provider/.ipfsdata
+ volumes:
+ - ../scripts/wallet.json:/home/safeuser/bch-dex/wallet.json
restart: always
dex-ui:
- build:
- context: ./bch-dex-ui/
- dockerfile: Dockerfile
+ #build:
+ # context: ./bch-dex-ui/
+ # dockerfile: Dockerfile
+ image: christroutner/bch-dex-ui-rpi:v1.6.2
container_name: dex-ui
logging:
driver: 'json-file'