Compare commits

...
35 Commits
Author SHA1 Message Date
Chris Troutner 67d80056ff Merge pull request #58 from Permissionless-Software-Foundation/ct-unstable
New version. Syncing with upstream ipfs-service-provider
2022-01-18 12:32:55 -08:00
Chris Troutner 199677e4c6 synced with upstream ipfs-service-provider 2022-01-18 12:14:51 -08:00
Chris Troutner 86ea5c6354 fix(version): Bumping to v2.0.0 2022-01-18 12:08:36 -08:00
Chris Troutner fe5c573291 Merge pull request #74 from Permissionless-Software-Foundation/ct-unstable
fix(tests): Skipping IPFS stuff in test environment
2022-01-09 11:54:41 -08:00
Chris Troutner 463d7df582 fix(tests): Skipping IPFS stuff in test environment 2022-01-09 11:51:15 -08:00
Chris Troutner 5a1ec640a4 Merge pull request #73 from Permissionless-Software-Foundation/ct-unstable
Adding swarm.key
2022-01-03 11:39:57 -08:00
Chris Troutner 8bb8dbcd23 Updating READMe 2022-01-03 11:35:26 -08:00
Chris Troutner ba212b0997 fix(ipfs): Adding swarm.key file for joining network 2022-01-03 11:22:15 -08:00
Chris Troutner 803496fbc3 Merge pull request #57 from Permissionless-Software-Foundation/ct-unstable
Syncing upstream ipfs-service-provider
2022-01-02 19:15:52 -08:00
Chris Troutner c49ab4f58b Merge branch 'master' of https://github.com/Permissionless-Software-Foundation/ipfs-service-provider into ct-unstable 2022-01-02 19:14:28 -08:00
Chris Troutner 4670bd22af Merge pull request #72 from Permissionless-Software-Foundation/ct-unstable
fix(pubsub): Applying fix for pubsub in external node
2022-01-02 19:13:44 -08:00
Chris Troutner b3e7c63e61 fix(pubsub): Applying fix for pubsub in external node 2022-01-02 19:00:50 -08:00
Chris Troutner 421ca359f2 Merge pull request #56 from Permissionless-Software-Foundation/ct-unstable
Syncing with upstream ipfs-service-provider
2022-01-01 21:06:35 -08:00
Chris Troutner 4e6559ac96 Merge branch 'master' of https://github.com/Permissionless-Software-Foundation/ipfs-service-provider into ct-unstable 2022-01-01 21:04:33 -08:00
Chris Troutner 1fcc92e10d Merge pull request #71 from Permissionless-Software-Foundation/ct-unstable
fix(ipsf-coord): Updating to v6.8.10
2022-01-01 21:01:14 -08:00
Chris Troutner f332aece98 fix(ipsf-coord): Updating to v6.8.10 2022-01-01 20:58:56 -08:00
Chris Troutner 4112b34205 Merge pull request #55 from Permissionless-Software-Foundation/ct-unstable
Syncing with upstream ipfs-service-provider
2022-01-01 20:47:11 -08:00
Chris Troutner 30d0a62455 Merge branch 'master' of https://github.com/Permissionless-Software-Foundation/ipfs-service-provider into ct-unstable 2022-01-01 20:44:41 -08:00
Chris Troutner 89f24e9940 Merge pull request #70 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-coord): Switching to private network. Updating ipfs-coord
2022-01-01 20:40:23 -08:00
Chris Troutner 25a75dc369 fix(ipfs-coord): Switching to private network. Updating ipfs-coord to v6.8.9 2022-01-01 20:25:40 -08:00
Chris Troutner f36ce14087 fix(ipfs-coord): Updating v6.8.8 2022-01-01 18:58:47 -08:00
Chris Troutner df45792f47 fix(ipfs-coord): Updating to v6.8.7 2022-01-01 18:43:24 -08:00
Chris Troutner 9e71e33ccd Merge pull request #69 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-coord): Updating to v6.8.6
2022-01-01 18:20:30 -08:00
Chris Troutner c7b0b0c1d5 fix(ipfs-coord): Updating to v6.8.6 2022-01-01 18:19:07 -08:00
Chris Troutner e475e5f4c3 Downgrading ipfs-http-client 2022-01-01 16:41:56 -08:00
Chris Troutner 7fff41b702 fix(production): Fixing typo in docker-compose.yml 2022-01-01 06:51:54 -08:00
Chris Troutner a7f7fc4e14 Merge pull request #54 from Permissionless-Software-Foundation/ct-unstable
Syncing with upstream ipfs-service-provider
2022-01-01 06:48:33 -08:00
Chris Troutner 83ad0d8bfa Merge branch 'master' into ct-unstable 2022-01-01 06:44:04 -08:00
Chris Troutner ac4aaca66e fix(production): Explictly using ipfs v0.11.0 docker container 2022-01-01 06:43:16 -08:00
Chris Troutner 0748106637 Merge pull request #68 from Permissionless-Software-Foundation/ct-unstable
fix(production): using explcit v0.11.0 ipfs docker container
2022-01-01 06:41:36 -08:00
Chris Troutner 27dcc219b9 fix(production): using explcit v0.11.0 ipfs docker container 2022-01-01 06:40:15 -08:00
Chris Troutner 1362e64c42 Merge pull request #53 from Permissionless-Software-Foundation/ct-unstable
Syncing with upstream ipfs-service-provider
2021-12-31 18:44:59 -08:00
Chris Troutner 7aad5db594 Merge branch 'master' of https://github.com/Permissionless-Software-Foundation/ipfs-service-provider into ct-unstable 2021-12-31 18:42:36 -08:00
Chris Troutner b231686a64 Merge pull request #67 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-coord): Updating to v6.8.5
2021-12-31 18:40:55 -08:00
Chris Troutner 60668430f5 fix(ipfs-coord): Updating to v6.8.5 2021-12-31 18:38:17 -08:00
7 changed files with 72 additions and 17 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
+40 -7
View File
@@ -14,7 +14,7 @@
"bcryptjs": "2.4.3",
"glob": "7.1.6",
"ipfs": "0.60.0",
"ipfs-coord": "6.8.4",
"ipfs-coord": "6.8.10",
"ipfs-http-client": "55.0.0",
"jsonrpc-lite": "2.2.0",
"jsonwebtoken": "8.5.1",
@@ -58,6 +58,39 @@
"uuid": "8.3.2"
}
},
"../ipfs-coord": {
"version": "6.0.0",
"extraneous": true,
"license": "MIT",
"dependencies": {
"axios": "0.21.4",
"bch-encrypt-lib": "2.0.0",
"orbit-db": "0.28.0"
},
"devDependencies": {
"@psf/bch-js": "4.20.10",
"apidoc": "0.25.0",
"chai": "4.2.0",
"coveralls": "3.1.0",
"eslint": "7.17.0",
"eslint-config-prettier": "7.1.0",
"eslint-config-standard": "16.0.2",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-prettier": "3.3.1",
"eslint-plugin-standard": "4.0.0",
"husky": "4.3.6",
"lodash.clonedeep": "4.5.0",
"mocha": "8.4.0",
"nyc": "15.1.0",
"semantic-release": "17.4.4",
"sinon": "9.2.2",
"standard": "16.0.3"
},
"peerDependencies": {
"ipfs": "0.60.0",
"ipfs-http-client": "55.0.0"
}
},
"node_modules/@assemblyscript/loader": {
"version": "0.9.4",
"resolved": "http://94.130.170.209:4873/@assemblyscript%2floader/-/loader-0.9.4.tgz",
@@ -10388,9 +10421,9 @@
}
},
"node_modules/ipfs-coord": {
"version": "6.8.4",
"resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-6.8.4.tgz",
"integrity": "sha512-FqYTfl0rXgD5ycdSDWT3fha2fEHgrXlCnvxh8xHgmQKlGqfEL1fts53xLtIIWeLAcmsdqe2WUYF1L6FUw1xBeg==",
"version": "6.8.10",
"resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-6.8.10.tgz",
"integrity": "sha512-04nlX4AkfqLuuLzpMcHnpv++iOETLRkzFA2GfAmY90r99HynfHt3DypP6loVdAnD34iWgD+tLhKNQ7QQM7cgfQ==",
"license": "MIT",
"dependencies": {
"axios": "0.21.4",
@@ -33891,9 +33924,9 @@
}
},
"ipfs-coord": {
"version": "6.8.4",
"resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-6.8.4.tgz",
"integrity": "sha512-FqYTfl0rXgD5ycdSDWT3fha2fEHgrXlCnvxh8xHgmQKlGqfEL1fts53xLtIIWeLAcmsdqe2WUYF1L6FUw1xBeg==",
"version": "6.8.10",
"resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-6.8.10.tgz",
"integrity": "sha512-04nlX4AkfqLuuLzpMcHnpv++iOETLRkzFA2GfAmY90r99HynfHt3DypP6loVdAnD34iWgD+tLhKNQ7QQM7cgfQ==",
"requires": {
"axios": "0.21.4",
"bch-encrypt-lib": "2.0.0",
+2 -2
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": {
@@ -28,7 +28,7 @@
"bcryptjs": "2.4.3",
"glob": "7.1.6",
"ipfs": "0.60.0",
"ipfs-coord": "6.8.4",
"ipfs-coord": "6.8.10",
"ipfs-http-client": "55.0.0",
"jsonrpc-lite": "2.2.0",
"jsonwebtoken": "8.5.1",
+1 -1
View File
@@ -14,7 +14,7 @@ services:
restart: always
ipfs-bch-wallet:
image: ipfs/go-ipfs:latest
image: ipfs/go-ipfs:v0.11.0
container_name: ipfs-bch-wallet
environment:
MY_ENV_VAR: 'placeholder'
+3 -1
View File
@@ -14,6 +14,7 @@
const IPFSembedded = require('ipfs')
const IPFSexternal = require('ipfs-http-client')
const fs = require('fs')
const http = require('http')
// Local libraries
const config = require('../../../config')
@@ -74,7 +75,8 @@ class IpfsAdapter {
const ipfsOptionsExternal = {
host: this.config.ipfsHost,
port: this.config.ipfsApiPort
port: this.config.ipfsApiPort,
agent: http.Agent({ keepAlive: true, maxSockets: 2000 })
}
let ipfsOptions = ipfsOptionsEmbedded
+3
View File
@@ -0,0 +1,3 @@
/key/swarm/psk/1.0.0/
/base16/
bbd935b70105b03ebd0c6a3c2d2730cd22fc0d18c490ccf689b6c8a22e1bed2a