mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service.git
synced 2026-09-21 16:52:03 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
803496fbc3 | ||
|
|
c49ab4f58b | ||
|
|
4670bd22af | ||
|
|
b3e7c63e61 | ||
|
|
421ca359f2 | ||
|
|
4e6559ac96 | ||
|
|
1fcc92e10d | ||
|
|
f332aece98 | ||
|
|
4112b34205 | ||
|
|
30d0a62455 | ||
|
|
89f24e9940 | ||
|
|
25a75dc369 | ||
|
|
f36ce14087 | ||
|
|
df45792f47 | ||
|
|
9e71e33ccd | ||
|
|
c7b0b0c1d5 | ||
|
|
e475e5f4c3 | ||
|
|
7fff41b702 | ||
|
|
a7f7fc4e14 | ||
|
|
83ad0d8bfa | ||
|
|
ac4aaca66e | ||
|
|
0748106637 | ||
|
|
27dcc219b9 | ||
|
|
1362e64c42 | ||
|
|
7aad5db594 | ||
|
|
b231686a64 | ||
|
|
60668430f5 | ||
|
|
cf0fb0f572 | ||
|
|
68b0117c3d | ||
|
|
e73440f342 | ||
|
|
b9680508db | ||
|
|
acebfdef09 | ||
|
|
c3ee71a54f | ||
|
|
0d9a32488e | ||
|
|
de7629c93d | ||
|
|
3979694109 | ||
|
|
ae888d094b | ||
|
|
9b8db2adaf | ||
|
|
c8539372ae | ||
|
|
e8a3234dcd | ||
|
|
fc717e0dcd | ||
|
|
02512a8183 |
Generated
+40
-7
@@ -14,7 +14,7 @@
|
||||
"bcryptjs": "2.4.3",
|
||||
"glob": "7.1.6",
|
||||
"ipfs": "0.60.0",
|
||||
"ipfs-coord": "6.8.1",
|
||||
"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.1",
|
||||
"resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-6.8.1.tgz",
|
||||
"integrity": "sha512-GxGc3oNHg5PvTuzeOqI4cpheo2tNlQ+lMnagFUhD3QzGSzvqxbVrhbggMhkRCwMm/LePOWlba4QAdOkBHuO5bQ==",
|
||||
"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.1",
|
||||
"resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-6.8.1.tgz",
|
||||
"integrity": "sha512-GxGc3oNHg5PvTuzeOqI4cpheo2tNlQ+lMnagFUhD3QzGSzvqxbVrhbggMhkRCwMm/LePOWlba4QAdOkBHuO5bQ==",
|
||||
"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",
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@
|
||||
"bcryptjs": "2.4.3",
|
||||
"glob": "7.1.6",
|
||||
"ipfs": "0.60.0",
|
||||
"ipfs-coord": "6.8.1",
|
||||
"ipfs-coord": "6.8.10",
|
||||
"ipfs-http-client": "55.0.0",
|
||||
"jsonrpc-lite": "2.2.0",
|
||||
"jsonwebtoken": "8.5.1",
|
||||
|
||||
@@ -0,0 +1,61 @@
|
||||
# Docker Containers
|
||||
|
||||
The 'production' environment is assumed to be a set of Docker containers orchestrated with Docker Compose. The files in this directory will stand up three Docker containers:
|
||||
|
||||
1 An instance of go-ipfs.
|
||||
2 An instance of MongoDB.
|
||||
3 The JavaScript software in this repository.
|
||||
|
||||
The software in this repository depends on the first two containers, so if they aren't running correctly, the application won't run correctly either.
|
||||
|
||||
## IPFS
|
||||
|
||||
IPFS can be a little tricky to set up. By default, the container uses the following ports:
|
||||
|
||||
- 4001 for TCP connections, exposed publicly.
|
||||
- 5001 for control by the application, exposed privately.
|
||||
- 8080 for an IPFS gateway, consumed by the application, exposed privately.
|
||||
|
||||
If you already have an IPFS node running on a the computer, you will need to change the ports to avaid a conflict. To change the ports from the default, you'll need to perform a series of steps, and the order of the steps matter.
|
||||
|
||||
1. Edit the `docker-compose.yml` file and change the ports. Then save the file. Here is an example:
|
||||
|
||||
```
|
||||
ports:
|
||||
- 4101:4101
|
||||
- 172.17.0.1:5101:5101
|
||||
- 172.17.0.1:8180:8180
|
||||
```
|
||||
|
||||
2. Bring the Docker containers up, and then back down. This will allow the IPFS container to create the config file that you'll need to edit.
|
||||
|
||||
- `docker-compose up -d`
|
||||
- Wait a few seconds.
|
||||
- `docker-compose down`
|
||||
|
||||
3. Update the generated config file at `../data/go-ipfs/data/config`, to update the ports in the config file, like this:
|
||||
|
||||
```
|
||||
"Addresses": {
|
||||
"API": "/ip4/0.0.0.0/tcp/5101",
|
||||
"Announce": [],
|
||||
"AppendAnnounce": [],
|
||||
"Gateway": "/ip4/0.0.0.0/tcp/8180",
|
||||
"NoAnnounce": [],
|
||||
"Swarm": [
|
||||
"/ip4/0.0.0.0/tcp/4101",
|
||||
"/ip6/::/tcp/4101",
|
||||
"/ip4/0.0.0.0/udp/4101/quic",
|
||||
"/ip6/::/udp/4101/quic"
|
||||
]
|
||||
},
|
||||
|
||||
```
|
||||
|
||||
4. Update the port changes in the `start-production.sh` shell script. This tells the application which ports to use, in order to control the IPFS node, are are used when signaling other nodes.
|
||||
|
||||
5. Quickly rebuild the containers, to add the modified `start-production.sh` shell script to the application Docker container:
|
||||
|
||||
- `docker-compose build`
|
||||
|
||||
6. Now start the containers, and the port changes to IPFS should be complete.
|
||||
@@ -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'
|
||||
@@ -26,8 +26,8 @@ services:
|
||||
mem_limit: 2000mb
|
||||
ports:
|
||||
- 4001:4001
|
||||
- 5001:5001
|
||||
- 8080:8080
|
||||
- 172.17.0.1:5001:5001
|
||||
- 172.17.0.1:8080:8080
|
||||
volumes:
|
||||
- ../data/go-ipfs/data:/data/ipfs
|
||||
- ../data/go-ipfs/export:/export
|
||||
@@ -58,3 +58,4 @@ services:
|
||||
- '5010:5010' # <host port>:<container port>
|
||||
volumes:
|
||||
- ../data/ipfsdata:/home/safeuser/ipfs-bch-wallet-service/.ipfsdata
|
||||
restart: always
|
||||
|
||||
@@ -17,7 +17,16 @@ export COORD_NAME=bch-wallet-service-generic
|
||||
#export CR_DOMAIN=subdomain.yourdomain.com
|
||||
|
||||
# Debug level. 0 = minimal info. 2 = max info.
|
||||
export DEBUG_LEVEL=1
|
||||
export DEBUG_LEVEL=2
|
||||
|
||||
# BCH Wallet Service Settings
|
||||
# Change APISERVER to point to your own installation of bch-api
|
||||
export APISERVER=https://api.fullstack.cash/v5/
|
||||
# These settings are used to proxy a subscription to FullStack.cash.
|
||||
export GET_JWT_AT_STARTUP=1
|
||||
export AUTHSERVER=https://auth.fullstack.cash
|
||||
export FULLSTACKLOGIN=demo@demo.com
|
||||
export FULLSTACKPASS=demo
|
||||
|
||||
# END: Optional configuration settings
|
||||
|
||||
@@ -25,18 +34,6 @@ export DEBUG_LEVEL=1
|
||||
# Production database connection string.
|
||||
export DBURL=mongodb://172.17.0.1:5555/ipfs-service-prod
|
||||
|
||||
# Customize these environment variables for your own installation.
|
||||
export GET_JWT_AT_STARTUP=1
|
||||
export AUTHSERVER=https://auth.fullstack.cash
|
||||
export APISERVER=https://api.fullstack.cash/v5/
|
||||
export FULLSTACKLOGIN=demo@demo.com
|
||||
export FULLSTACKPASS=demo
|
||||
|
||||
# Configure IPFS ports
|
||||
#export IPFS_TCP_PORT=5268
|
||||
#export IPFS_WS_PORT=5269
|
||||
|
||||
|
||||
# Configure REST API port
|
||||
export PORT=5010
|
||||
|
||||
@@ -44,5 +41,7 @@ export PORT=5010
|
||||
export SVC_ENV=production
|
||||
export IPFS_HOST=172.17.0.1
|
||||
export IPFS_API_PORT=5001
|
||||
export IPFS_TCP_PORT=4001
|
||||
#export IPFS_WS_PORT=4002
|
||||
|
||||
npm start
|
||||
|
||||
@@ -13,7 +13,7 @@ export COORD_NAME=ipfs-service-provider-generic
|
||||
export MNEMONIC="churn aisle shield silver ladder swear hunt slim pen demand spoil veteran"
|
||||
|
||||
# 0 = less verbose. 3 = most verbose
|
||||
export DEBUG_LEVEL=1
|
||||
export DEBUG_LEVEL=2
|
||||
|
||||
# Production settings that use external IPFS node.
|
||||
# https://github.com/christroutner/docker-ipfs
|
||||
@@ -22,6 +22,10 @@ export SVC_ENV=production
|
||||
export IPFS_HOST=172.17.0.1
|
||||
export IPFS_API_PORT=5001
|
||||
|
||||
# Configure IPFS ports
|
||||
export IPFS_TCP_PORT=4001
|
||||
#export IPFS_WS_PORT=5269
|
||||
|
||||
# MongoDB connection string.
|
||||
export DBURL=mongodb://localhost:27017/ipfs-service-dev
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user