Compare commits

..
10 Commits
5 changed files with 72 additions and 33 deletions
+18 -4
View File
@@ -24,13 +24,17 @@ This repository is one step in a longer path. Here are the major milestones of t
## Requirements
- node **^14.17.0**
- npm **^7.13.0**
- node **^14.18.2**
- npm **^8.3.0**
- Docker **^20.10.8**
- Docker Compose **^1.27.4**
## Installation
### Development Environment
**Note:** This software now uses an external go-ipfs IPFS node. The instructions below have not been updated to reflect this.
A development environment will allow you modify the code on-the-fly and contribute to the code base of this repository. [PM2](https://www.npmjs.com/package/pm2) is recommended for running this code base as an IPFS Circuit Relay.
- [Video: Installing ipfs-service-provider](https://youtu.be/Z0NsboIVN44)
@@ -41,23 +45,33 @@ git clone https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-
cd ipfs-bch-wallet-service
./install-mongo.sh
npm install
cd shell-scripts
cd shell-scripts
./ipfs-bch-wallet-service.sh
```
### Production Environment
The [docker](./production/docker) directory contains a Dockerfile for building a production deployment. However, there is currently [a bug](https://github.com/Permissionless-Software-Foundation/ipfs-service-provider/issues/38) preventing the Docker container from being used as a Circuit Relay.
The [docker](./production/docker) directory contains a Dockerfile for building a production deployment.
```
docker-compose build --no-cache
docker-compose up -d
```
- Bring the containers up once, then take them back down with `docker-compose down`.
- Copy the [swarm.key](./swarm.key) file to `ipfs-service-provider/production/data/go-ipfs/data/swarm.key`.
- Bring the containers back up with `docker-compose up -d`.
### Operation Notes
- There is a memory leak in the version of js-ipfs. The app is currently configured to shut down every 8 hours to flush memory. It relies on a process manager like pm2, Docker, or systemd to restart the app after it shuts down, in order to ensure continuous operation.
- The PSF network operates as a private network. It does not connect or interact with the wider PSF network, relying instead on gateways to bridge the two networks, when they need to share content. This improves the performance and experience for everyone in the PSF network. To join the network, you'll need to add the [swarm.key](./swarm.key) file to the IPFS data folder.
- [Instructions on setting up IPFS private networks.](https://github.com/ipfs/go-ipfs/blob/master/docs/experimental-features.md#private-networks)
- For external installations, the swarm.key file will typically go in `~/.ipfs/swarm.key`
- For production Docker containers, the key would go in `ipfs-service-provider/production/data/go-ipfs/data/swarm.key`
## Structure
The file layout of this repository differs from the koa-api-boilerplate. Instead, it follows the file layout of [Clean Architecture](troutsblog.com/blog/clean-architecture).
+5 -2
View File
@@ -97,8 +97,11 @@ class Server {
)
}
// Attach the other IPFS controllers
await controllers.attachControllers(app)
// Attach the other IPFS controllers.
// Skip if this is a test environment.
if (config.env !== 'test') {
await controllers.attachControllers(app)
}
// ipfs-coord has a memory leak. This app shuts down after 4 hours. It
// expects to be run by Docker or pm2, which can automatically restart
+43 -24
View File
@@ -1,16 +1,16 @@
{
"name": "ipfs-bch-wallet-service",
"version": "1.11.12",
"version": "2.0.0",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "ipfs-bch-wallet-service",
"version": "1.11.12",
"version": "2.0.0",
"license": "MIT",
"dependencies": {
"@psf/bch-js": "4.20.28",
"axios": "0.21.1",
"@psf/bch-js": "5.2.0",
"axios": "0.25.0",
"bcryptjs": "2.4.3",
"glob": "7.1.6",
"ipfs": "0.60.0",
@@ -2241,9 +2241,9 @@
"license": "BSD-3-Clause"
},
"node_modules/@psf/bch-js": {
"version": "4.20.28",
"resolved": "http://94.130.170.209:4873/@psf%2fbch-js/-/bch-js-4.20.28.tgz",
"integrity": "sha512-tlWfYTUnmAzrFZDHTuP2CccE6fp20j4XcCIJiJYlpaKzxB0ilH8CEVWBQaMY+Fb+eaTrlSdiaDC5MBWV4klpQg==",
"version": "5.2.0",
"resolved": "http://94.130.170.209:4873/@psf%2fbch-js/-/bch-js-5.2.0.tgz",
"integrity": "sha512-1QbKrdtww+nISvuwKe9X8/9GrqZWswjn0AChm0+UqobEV6WqGUXbsYL7621nvUaWzHz040evgOAiM6VaTtfNhg==",
"license": "MIT",
"dependencies": {
"@chris.troutner/bip32-utils": "1.0.5",
@@ -3541,12 +3541,12 @@
"license": "MIT"
},
"node_modules/axios": {
"version": "0.21.1",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.25.0",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.25.0.tgz",
"integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.7"
}
},
"node_modules/backo2": {
@@ -7842,9 +7842,9 @@
"license": "MIT"
},
"node_modules/follow-redirects": {
"version": "1.14.4",
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.4.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g==",
"version": "1.14.7",
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.7.tgz",
"integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==",
"funding": [
{
"type": "individual",
@@ -12824,6 +12824,15 @@
"axios": "^0.21.1"
}
},
"node_modules/jwt-bch-lib/node_modules/axios": {
"version": "0.21.4",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.14.0"
}
},
"node_modules/k-bucket": {
"version": "5.1.0",
"resolved": "http://94.130.170.209:4873/k-bucket/-/k-bucket-5.1.0.tgz",
@@ -27946,9 +27955,9 @@
"integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
},
"@psf/bch-js": {
"version": "4.20.28",
"resolved": "http://94.130.170.209:4873/@psf%2fbch-js/-/bch-js-4.20.28.tgz",
"integrity": "sha512-tlWfYTUnmAzrFZDHTuP2CccE6fp20j4XcCIJiJYlpaKzxB0ilH8CEVWBQaMY+Fb+eaTrlSdiaDC5MBWV4klpQg==",
"version": "5.2.0",
"resolved": "http://94.130.170.209:4873/@psf%2fbch-js/-/bch-js-5.2.0.tgz",
"integrity": "sha512-1QbKrdtww+nISvuwKe9X8/9GrqZWswjn0AChm0+UqobEV6WqGUXbsYL7621nvUaWzHz040evgOAiM6VaTtfNhg==",
"requires": {
"@chris.troutner/bip32-utils": "1.0.5",
"@psf/bip21": "2.0.1",
@@ -28953,11 +28962,11 @@
"integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA=="
},
"axios": {
"version": "0.21.1",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.21.1.tgz",
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
"version": "0.25.0",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.25.0.tgz",
"integrity": "sha512-cD8FOb0tRH3uuEe6+evtAbgJtfxr7ly3fQjYcMcuPlgkwVS9xboaVIpcDV+cYQe+yGykgwZCs1pzjntcGa6l5g==",
"requires": {
"follow-redirects": "^1.10.0"
"follow-redirects": "^1.14.7"
}
},
"backo2": {
@@ -32099,9 +32108,9 @@
"integrity": "sha1-kV4tbQI8Q9UiStn20qPEFW9XEvU="
},
"follow-redirects": {
"version": "1.14.4",
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.4.tgz",
"integrity": "sha512-zwGkiSXC1MUJG/qmeIFH2HBJx9u0V46QGUe3YR1fXG8bXQxq7fLj0RjLZQ5nubr9qNJUZrH+xUcwXEoXNpfS+g=="
"version": "1.14.7",
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.7.tgz",
"integrity": "sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ=="
},
"for-each": {
"version": "0.3.3",
@@ -35767,6 +35776,16 @@
"integrity": "sha512-CZs3jUHJlWvConvoTeLDogDEwUysKeojYJxfUhbwJKJrtDCSfi3ZWbsZZ8WN30Xs28aZPDB+qlHPJlTXQmup0w==",
"requires": {
"axios": "^0.21.1"
},
"dependencies": {
"axios": {
"version": "0.21.4",
"resolved": "http://94.130.170.209:4873/axios/-/axios-0.21.4.tgz",
"integrity": "sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==",
"requires": {
"follow-redirects": "^1.14.0"
}
}
}
},
"k-bucket": {
+3 -3
View File
@@ -1,6 +1,6 @@
{
"name": "ipfs-bch-wallet-service",
"version": "1.11.12",
"version": "2.0.0",
"description": "IPFS and REST service providing blockchain access needed by a wallet. ",
"main": "index.js",
"scripts": {
@@ -23,8 +23,8 @@
},
"repository": "Permissionless-Software-Foundation/ipfs-bch-wallet-service",
"dependencies": {
"@psf/bch-js": "4.20.28",
"axios": "0.21.1",
"@psf/bch-js": "5.2.0",
"axios": "0.25.0",
"bcryptjs": "2.4.3",
"glob": "7.1.6",
"ipfs": "0.60.0",
+3
View File
@@ -0,0 +1,3 @@
/key/swarm/psk/1.0.0/
/base16/
bbd935b70105b03ebd0c6a3c2d2730cd22fc0d18c490ccf689b6c8a22e1bed2a