From e4c2ee44c1a528d9b3edf2403c2a5ae1c38b1f67 Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 28 Oct 2023 11:24:40 -0700 Subject: [PATCH 1/3] fix(production): Updating docker container --- config/env/common.js | 2 +- production/docker/Dockerfile | 2 +- production/docker/docker-compose.yml | 32 +-------------------------- production/docker/start-production.sh | 6 ++++- 4 files changed, 8 insertions(+), 34 deletions(-) diff --git a/config/env/common.js b/config/env/common.js index c1aca4f..1f2e65f 100644 --- a/config/env/common.js +++ b/config/env/common.js @@ -89,7 +89,7 @@ export default { debugLevel: process.env.DEBUG_LEVEL ? parseInt(process.env.DEBUG_LEVEL) : 2, // Settings for production, using external go-ipfs node. - isProduction: process.env.SVC_ENV === 'production' ? true : false, + isProduction: process.env.SVC_ENV === 'prod' ? true : false, ipfsHost: process.env.IPFS_HOST ? process.env.IPFS_HOST : 'localhost', ipfsApiPort: process.env.IPFS_API_PORT ? parseInt(process.env.IPFS_API_PORT) diff --git a/production/docker/Dockerfile b/production/docker/Dockerfile index 7766679..5ee12e5 100644 --- a/production/docker/Dockerfile +++ b/production/docker/Dockerfile @@ -34,7 +34,7 @@ WORKDIR /home/safeuser # Update to the latest version of npm. #RUN npm install -g npm@7.23.0 -RUN npm install -g npm +#RUN npm install -g npm # npm mirror to prevent direct dependency on npm. RUN npm set registry http://94.130.170.209:4873/ diff --git a/production/docker/docker-compose.yml b/production/docker/docker-compose.yml index 4727adf..edce087 100644 --- a/production/docker/docker-compose.yml +++ b/production/docker/docker-compose.yml @@ -13,38 +13,9 @@ services: command: mongod --logpath=/dev/null # -- quiet restart: always - ipfs: - # https://github.com/christroutner/trickle-ipfs - image: christroutner/trickle-ipfs:v1.0.1 - #build: - # context: ./ - # dockerfile: Dockerfile - container_name: ipfs - environment: - IPFS_DAEMON_ARGUMENTS: '--enable-pubsub-experiment --migrate=true --agent-version-suffix=docker --routing=dhtclient' - UPLOAD_KBPS: '1000' - DOWNLOAD_KBPS: '1000' - logging: - driver: 'json-file' - options: - max-size: '10m' - max-file: '10' - mem_limit: 2000mb - ports: - - 4001:4001 - - 4003:4003 - - 172.17.0.1:5001:5001 - - 172.17.0.1:8080:8080 - command: [ - './start-ipfs.sh' - ] - volumes: - - ../data/go-ipfs/data:/root/.ipfs - restart: always - ipfs-service: #build: . - image: christroutner/ipfs-service-provider:v2.2.13 + image: christroutner/ipfs-service-provider:v5.0.1 container_name: ipfs-service logging: driver: 'json-file' @@ -54,7 +25,6 @@ services: mem_limit: 500mb links: - mongo-ipfs-service - - ipfs ports: - '5010:5010' # : volumes: diff --git a/production/docker/start-production.sh b/production/docker/start-production.sh index 4303889..5535a3e 100755 --- a/production/docker/start-production.sh +++ b/production/docker/start-production.sh @@ -29,10 +29,14 @@ export DBURL=mongodb://172.17.0.1:5555/ipfs-service-prod export PORT=5010 # Production settings using external go-ipfs node. -export SVC_ENV=production +export SVC_ENV=prod export IPFS_HOST=172.17.0.1 export IPFS_API_PORT=5001 export IPFS_TCP_PORT=4001 export IPFS_WS_PORT=4003 +# Set the debug level for helia-coord. 0-3. +# 0 = no debug logs. 3 = maximum debug logs. +export DEBUG_LEVEL=0 + npm start From 41b76967f5c7471ba9a794ab05332fafaebca1be Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 28 Oct 2023 11:27:06 -0700 Subject: [PATCH 2/3] Adding production section back to README --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 09b215f..751bf2e 100644 --- a/README.md +++ b/README.md @@ -46,6 +46,18 @@ This web server spins up an embedded IPFS ([Helia](https://github.com/ipfs/helia ## Installation +### Production Environment + +The [docker](./production/docker) directory contains a Dockerfile for building a production deployment. + +``` +docker-compose pull +docker-compose up -d +``` + +- You can bring the containers down with `docker-compose down` +- You can bring the containers back up with `docker-compose up -d`. + ### Development Environment A development environment will allow you modify the code on-the-fly and contribute to the code base of this repository. Ubuntu v20 is the recommended OS for creating a dev environment. Other operating systems may cause issues. From 82b594360145fffaa8897259eef3c53939300c3a Mon Sep 17 00:00:00 2001 From: Chris Troutner Date: Sat, 28 Oct 2023 11:30:57 -0700 Subject: [PATCH 3/3] Adding collaborative coinjoin project to README --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 751bf2e..8299733 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,7 @@ This is a 'boilerplate' repository. It's intended to be forked to start new proj - [pay-to-write database (P2WDB)](https://p2wdb.com/) - [ipfs-bch-wallet-consumer](https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-consumer) - [ipfs-bch-wallet-service](https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service) +- [colab-coinjoin-api](https://github.com/bch-coinjoin/colab-coinjoin-api) In addition to being forked as a boilerpalte, it can also be run as a stand-alone application to create a [Circuit Relay](https://cashstack.info/docs/local-back-end/circuit-relay), which can support the [PSF](https://psfoundation.info) IPFS network. It can also be used for experimenting with [helia-coord](https://github.com/Permissionless-Software-Foundation/helia-coord) and the [psf-bch-wallet](https://github.com/Permissionless-Software-Foundation/psf-bch-wallet) command-line wallet. @@ -31,6 +32,7 @@ If you are interested in creating your own service provider on the IPFS network, - [P2WDB](https://github.com/Permissionless-Software-Foundation/ipfs-p2wdb-service) - the [pay-to-write database](https://p2wdb.com) is a censorship-resistent, p2p database for storing data and pinning files to the IPFS network. - [ipfs-bch-wallet-consumer](https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-consumer) and [ipfs-bch-wallet-service](https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service) creates a web3, censorship-resistent API for apps to communicate with a blockchain. This software is documented in [the Cash Stack](https://cashstack.info). +- [colab-coinjoin-api](https://github.com/bch-coinjoin/colab-coinjoin-api) is part of the [Collaborative CoinJoin](https://ccoinjoin.com) framework to allow wallets to easily integrate CoinJoin transaction forming, to create financial privacy. ## IPFS node This web server spins up an embedded IPFS ([Helia](https://github.com/ipfs/helia)) node. This node can be controlled and interrogated via the REST API. [psf-bch-wallet](https://github.com/Permissionless-Software-Foundation/psf-bch-wallet) is a command-line app (CLI) that can easily tap into this REST API in order to interact with the embedded IPFS node.