Compare commits

...
23 Commits
Author SHA1 Message Date
Chris Troutner 449bd500c2 Merge pull request #38 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-coord): Updating bootstrap peers. v6.6.8
2021-09-27 12:52:00 -07:00
Chris Troutner ea295f2f41 linting 2021-09-27 12:47:10 -07:00
Chris Troutner 9175b8abe8 Fixing merge conflicts 2021-09-27 12:44:59 -07:00
Chris Troutner 9d4a61ea99 Merge pull request #45 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-coord): Updating bootstrap peers. v6.6.8
2021-09-27 12:40:53 -07:00
Chris Troutner cb50fdc70d fix(ipfs-coord): Updating bootstrap peers. v6.6.8 2021-09-27 12:39:10 -07:00
Chris Troutner cf488e1440 Merge pull request #37 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-coord): Updating to v6.6.7
2021-09-20 10:41:57 -07:00
Chris Troutner 4fc6def1cd Merge branch 'master' of https://github.com/Permissionless-Software-Foundation/ipfs-service-provider into ct-unstable 2021-09-20 10:34:59 -07:00
Chris Troutner e0b2fd2525 Merge pull request #44 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-coord): Updating to v6.6.7
2021-09-20 10:21:12 -07:00
Chris Troutner 8e08201b16 fix(ipfs-coord): Updating to v6.6.7 2021-09-20 10:19:33 -07:00
Chris Troutner c347a2d99a Merge pull request #36 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-service-provider): Syncing with upstream repo
2021-09-18 11:37:16 -07:00
Chris Troutner 5b7d8d4db4 fix(ipfs-service-provider): Syncing with upstream repo 2021-09-18 11:34:23 -07:00
Chris Troutner dd0692e91f Merge pull request #43 from Permissionless-Software-Foundation/ct-unstable
fix(ipfs-coord): Bumping to v6.6.6
2021-09-18 11:23:26 -07:00
Chris Troutner 576da66194 fix(ipfs-coord): Bumping to v6.6.6 2021-09-18 11:20:11 -07:00
Chris Troutner f4851d6771 Merge pull request #42 from Permissionless-Software-Foundation/ct-unstable
Minor tweeks
2021-09-17 17:43:33 -07:00
Chris Troutner 96abb0d56e fix(ipfs-coord): Updating to v6.6.5 2021-09-17 17:41:08 -07:00
Chris Troutner fdf3141c91 fix(reset): Restarting app after 4 hours, not 8 2021-09-17 16:23:47 -07:00
Chris Troutner 6692d234da Adding link to video in readme 2021-09-17 16:23:04 -07:00
Chris Troutner b8655e31ca Fixing typo in shell script 2021-09-17 12:22:05 -07:00
Chris Troutner e118fe4d6e Merge pull request #41 from Permissionless-Software-Foundation/ct-unstable
fix(startup script): Added startup script
2021-09-17 11:20:39 -07:00
Chris Troutner 86283195c5 slight tweek to README 2021-09-17 11:18:26 -07:00
Chris Troutner a037646aca fix(startup script): Added startup script 2021-09-17 11:17:10 -07:00
Chris Troutner ae6bdcdd5f Merge pull request #35 from Permissionless-Software-Foundation/ct-unstable
fix(bch-js): Selecting custom server when not using JWT token
2021-09-08 14:02:25 -07:00
Chris Troutner 9fe822024c fix(bch-js): Selecting custom server when not using JWT token 2021-09-08 14:00:00 -07:00
6 changed files with 60 additions and 18 deletions
+22 -2
View File
@@ -29,14 +29,34 @@ This repository is one step in a longer path. Here are the major milestones of t
## Installation
### Development Environment
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)
- [Step-by-step installation instructions](https://gist.github.com/christroutner/3304a71d4c12a3a3e1664a438f64d9d0)
```bash
git clone https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service
cd ipfs-bch-wallet-service
sudo npm install -g node-pre-gyp
./install-mongo-sh
npm install
npm start
./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.
```
docker-compose build --no-cache
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.
## 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).
+2 -2
View File
@@ -100,12 +100,12 @@ class Server {
// Attach the other IPFS controllers
await controllers.attachControllers(app)
// ipfs-coord has a memory leak. This app shuts down after 8 hours. It
// 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
// the app.
setTimeout(function () {
process.exit(0)
}, 60000 * 60 * 8)
}, 60000 * 60 * 2) // 2 hours
return app
} catch (err) {
+18
View File
@@ -0,0 +1,18 @@
#!/bin/bash
# Ports
export PORT=5001 # REST API port
export IPFS_TCP_PORT=5268
export IPFS_WS_PORT=5269
#export ENABLE_CIRCUIT_RELAY=1
# Production database connection string.
#export DBURL=mongodb://localhost:27017/bch-service-dev
export COORD_NAME=ipfs-service-provider-generic
export MNEMONIC="churn aisle shield silver ladder swear hunt slim pen demand spoil veteran"
export DEBUG_LEVEL=1
npm start
+14 -12
View File
@@ -10,11 +10,11 @@
"license": "MIT",
"dependencies": {
"@chris.troutner/ipfs": "2.0.2",
"@psf/bch-js": "^4.20.3",
"@psf/bch-js": "^4.20.13",
"axios": "^0.21.1",
"bcryptjs": "^2.4.3",
"glob": "^7.1.6",
"ipfs-coord": "^6.6.4",
"ipfs-coord": "^6.6.8",
"jsonrpc-lite": "^2.2.0",
"jsonwebtoken": "^8.5.1",
"jwt-bch-lib": "^1.3.0",
@@ -2131,8 +2131,9 @@
"integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
},
"node_modules/@psf/bch-js": {
"version": "4.20.10",
"integrity": "sha512-qDrJ3OTPwTJoRf8nryMRmd5ed9aAcnnskcv1+Tdd1Iu47n2jXhtFzI9v2Fc/FswECclmzwwjRVAfNB/LGNhsfw==",
"version": "4.20.13",
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-4.20.13.tgz",
"integrity": "sha512-BY2nFQofeynJLQm1qZNDBBLEAlCr8Sz6DwBtkD5pofM5ABX9njXFf3Ndwbhko6xcnjHl++hR88A8dPC/Bi4Q8A==",
"dependencies": {
"@psf/bip21": "^2.0.1",
"@psf/bip32-utils": "^1.0.0",
@@ -9472,9 +9473,9 @@
}
},
"node_modules/ipfs-coord": {
"version": "6.6.4",
"resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.6.4.tgz",
"integrity": "sha512-0rrfunCMvC9Oiw+MCCUZ5/J2VSY1Z3Wdq6qph2VN+ibdhxeRFtDcfZbVT7VrlWnGo/Q4lbGE+nDAPRro/pgitg==",
"version": "6.6.8",
"resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.6.8.tgz",
"integrity": "sha512-nnWgdB9zXnR8FPqAHd7XKJ8zSEq//XHxZAG8rB2BJ/KU/fJINW6x7PG5bIpeLTVRvyd0XfaWmbaAfEFgly+dpQ==",
"dependencies": {
"bch-encrypt-lib": "^2.0.0",
"orbit-db": "^0.26.1"
@@ -25606,8 +25607,9 @@
"integrity": "sha1-p3c2C1s5oaLlEG+OhY8v0tBgxXA="
},
"@psf/bch-js": {
"version": "4.20.10",
"integrity": "sha512-qDrJ3OTPwTJoRf8nryMRmd5ed9aAcnnskcv1+Tdd1Iu47n2jXhtFzI9v2Fc/FswECclmzwwjRVAfNB/LGNhsfw==",
"version": "4.20.13",
"resolved": "https://registry.npmjs.org/@psf/bch-js/-/bch-js-4.20.13.tgz",
"integrity": "sha512-BY2nFQofeynJLQm1qZNDBBLEAlCr8Sz6DwBtkD5pofM5ABX9njXFf3Ndwbhko6xcnjHl++hR88A8dPC/Bi4Q8A==",
"requires": {
"@psf/bip21": "^2.0.1",
"@psf/bip32-utils": "^1.0.0",
@@ -31269,9 +31271,9 @@
}
},
"ipfs-coord": {
"version": "6.6.4",
"resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.6.4.tgz",
"integrity": "sha512-0rrfunCMvC9Oiw+MCCUZ5/J2VSY1Z3Wdq6qph2VN+ibdhxeRFtDcfZbVT7VrlWnGo/Q4lbGE+nDAPRro/pgitg==",
"version": "6.6.8",
"resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.6.8.tgz",
"integrity": "sha512-nnWgdB9zXnR8FPqAHd7XKJ8zSEq//XHxZAG8rB2BJ/KU/fJINW6x7PG5bIpeLTVRvyd0XfaWmbaAfEFgly+dpQ==",
"requires": {
"bch-encrypt-lib": "^2.0.0",
"orbit-db": "^0.26.1"
+2 -2
View File
@@ -23,12 +23,12 @@
},
"repository": "Permissionless-Software-Foundation/ipfs-bch-wallet-service",
"dependencies": {
"@psf/bch-js": "^4.20.3",
"@psf/bch-js": "^4.20.13",
"axios": "^0.21.1",
"bcryptjs": "^2.4.3",
"glob": "^7.1.6",
"@chris.troutner/ipfs": "2.0.2",
"ipfs-coord": "^6.6.4",
"ipfs-coord": "^6.6.8",
"jsonrpc-lite": "^2.2.0",
"jsonwebtoken": "^8.5.1",
"jwt-bch-lib": "^1.3.0",
+2
View File
@@ -43,6 +43,8 @@ class Adapters {
await this.fullStackJwt.getJWT()
// Instantiate bch-js with the JWT token, and overwrite the placeholder for bch-js.
this.bchjs = await this.fullStackJwt.instanceBchjs()
} else {
this.bchjs = new BCHJS({ restURL: this.config.apiServer })
}
// Start the IPFS node.