mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-service.git
synced 2026-09-22 01:02:03 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ec4c61f38e | ||
|
|
9ed610e3a4 | ||
|
|
a9e7fc616e | ||
|
|
9d5ffbe26e | ||
|
|
3829e90844 | ||
|
|
f181d8b095 | ||
|
|
a2270e70af | ||
|
|
34604d53b0 | ||
|
|
6257b96bc3 | ||
|
|
1d8912f60d | ||
|
|
3c9b63d009 | ||
|
|
e6f9f64b4a | ||
|
|
a8ad4149e0 | ||
|
|
3924812985 | ||
|
|
fef0f3a987 | ||
|
|
1c012322fd | ||
|
|
545e8aa670 |
Vendored
+2
@@ -50,6 +50,8 @@ module.exports = {
|
||||
|
||||
// IPFS settings.
|
||||
isCircuitRelay: process.env.ENABLE_CIRCUIT_RELAY ? true : false,
|
||||
// SSL domain used for websocket connection via browsers.
|
||||
crDomain: process.env.CR_DOMAIN ? process.env.CR_DOMAIN : '',
|
||||
|
||||
// Information passed to other IPFS peers about this node.
|
||||
apiInfo: 'https://ipfs-bch-wallet-service.fullstack.cash/',
|
||||
|
||||
Generated
+99
-11
@@ -14,7 +14,7 @@
|
||||
"axios": "^0.21.1",
|
||||
"bcryptjs": "^2.4.3",
|
||||
"glob": "^7.1.6",
|
||||
"ipfs-coord": "^6.6.8",
|
||||
"ipfs-coord": "^6.7.1",
|
||||
"jsonrpc-lite": "^2.2.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"jwt-bch-lib": "^1.3.0",
|
||||
@@ -34,6 +34,7 @@
|
||||
"node-fetch": "npm:@achingbrain/node-fetch@^2.6.7",
|
||||
"nodemailer": "^6.4.17",
|
||||
"passport-local": "^1.0.0",
|
||||
"public-ip": "^4.0.4",
|
||||
"winston": "^3.3.3",
|
||||
"winston-daily-rotate-file": "^4.5.0"
|
||||
},
|
||||
@@ -56,6 +57,38 @@
|
||||
"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.26.1"
|
||||
},
|
||||
"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": {
|
||||
"@chris.troutner/ipfs": "^2.0.2"
|
||||
}
|
||||
},
|
||||
"node_modules/@assemblyscript/loader": {
|
||||
"version": "0.9.4",
|
||||
"integrity": "sha512-HazVq9zwTVwGmqdwYzu7WyQ6FQVZ7SwET0KKQuKm55jD0IfUpZgN0OPIiZG3zV1iSrVYcN0bdwLRXI/VNCYsUA=="
|
||||
@@ -959,6 +992,7 @@
|
||||
},
|
||||
"node_modules/@ethersproject/bignumber": {
|
||||
"version": "5.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.2.tgz",
|
||||
"integrity": "sha512-fJhdxqoQNuDOk6epfM7yD6J8Pol4NUCy1vkaGAkuujZm0+lNow//MKu1hLhRiYV4BsOHyBv5/lsTjF+7hWwhJg==",
|
||||
"funding": [
|
||||
{
|
||||
@@ -3955,6 +3989,7 @@
|
||||
},
|
||||
"node_modules/axios": {
|
||||
"version": "0.21.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
|
||||
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
||||
"dependencies": {
|
||||
"follow-redirects": "^1.10.0"
|
||||
@@ -5895,6 +5930,17 @@
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/dns-socket": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/dns-socket/-/dns-socket-4.2.2.tgz",
|
||||
"integrity": "sha512-BDeBd8najI4/lS00HSKpdFia+OvUMytaVjfzR9n5Lq8MlZRSvtbI+uLtx1+XmQFls5wFU9dssccTmQQ6nfpjdg==",
|
||||
"dependencies": {
|
||||
"dns-packet": "^5.2.4"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
}
|
||||
},
|
||||
"node_modules/doctrine": {
|
||||
"version": "3.0.0",
|
||||
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
|
||||
@@ -7007,6 +7053,7 @@
|
||||
},
|
||||
"node_modules/ethers": {
|
||||
"version": "5.4.6",
|
||||
"resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.7.tgz",
|
||||
"integrity": "sha512-F7LXARyB/Px3AQC6/QKedWZ8eqCkgOLORqL4B/F0Mag/K+qJSFGqsR36EaOZ6fKg3ZonI+pdbhb4A8Knt/43jQ==",
|
||||
"funding": [
|
||||
{
|
||||
@@ -7025,7 +7072,7 @@
|
||||
"@ethersproject/address": "5.4.0",
|
||||
"@ethersproject/base64": "5.4.0",
|
||||
"@ethersproject/basex": "5.4.0",
|
||||
"@ethersproject/bignumber": "5.4.1",
|
||||
"@ethersproject/bignumber": "5.4.2",
|
||||
"@ethersproject/bytes": "5.4.0",
|
||||
"@ethersproject/constants": "5.4.0",
|
||||
"@ethersproject/contracts": "5.4.1",
|
||||
@@ -9473,10 +9520,11 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ipfs-coord": {
|
||||
"version": "6.6.8",
|
||||
"resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.6.8.tgz",
|
||||
"integrity": "sha512-nnWgdB9zXnR8FPqAHd7XKJ8zSEq//XHxZAG8rB2BJ/KU/fJINW6x7PG5bIpeLTVRvyd0XfaWmbaAfEFgly+dpQ==",
|
||||
"version": "6.7.1",
|
||||
"resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.7.1.tgz",
|
||||
"integrity": "sha512-II0z1fNeWIHmEkRC9b2bNyMt0qJXH8+XNH7352iF7V/5hn7ix8+gNfmgDtno+C8DDy3kk6voQntf0v/WSzC45Q==",
|
||||
"dependencies": {
|
||||
"axios": "^0.21.4",
|
||||
"bch-encrypt-lib": "^2.0.0",
|
||||
"orbit-db": "^0.26.1"
|
||||
},
|
||||
@@ -18200,9 +18248,9 @@
|
||||
},
|
||||
"node_modules/orbit-db-access-controllers": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/orbit-db-access-controllers/-/orbit-db-access-controllers-0.3.2.tgz",
|
||||
"integrity": "sha512-H7xfgpcyAx9ToFYMvpP7StCt269uaqM33lnMdY9T1o3gbP8IYe0wPurkPQwg6IVZHrDeeBvTDA7kbOqShf9vJw==",
|
||||
"dependencies": {
|
||||
"orbit-db-io": "^0.3.0",
|
||||
"p-map-series": "^1.0.0"
|
||||
}
|
||||
},
|
||||
@@ -20055,6 +20103,7 @@
|
||||
},
|
||||
"node_modules/protocol-buffers-schema": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
||||
"integrity": "sha512-LPzSaBYp/TcbuSlpGwqT5jR9kvJ3Zp5ic2N5c2ybx6XB/lSfEHq2D7ja8AgoxHoMD91wXFALJoXsvshKPuXyew=="
|
||||
},
|
||||
"node_modules/protons": {
|
||||
@@ -20095,6 +20144,22 @@
|
||||
"integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==",
|
||||
"dev": true
|
||||
},
|
||||
"node_modules/public-ip": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/public-ip/-/public-ip-4.0.4.tgz",
|
||||
"integrity": "sha512-EJ0VMV2vF6Cu7BIPo3IMW1Maq6ME+fbR0NcPmqDfpfNGIRPue1X8QrGjrg/rfjDkOsIkKHIf2S5FlEa48hFMTA==",
|
||||
"dependencies": {
|
||||
"dns-socket": "^4.2.2",
|
||||
"got": "^9.6.0",
|
||||
"is-ip": "^3.1.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
}
|
||||
},
|
||||
"node_modules/pump": {
|
||||
"version": "3.0.0",
|
||||
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
|
||||
@@ -24743,6 +24808,7 @@
|
||||
},
|
||||
"@ethersproject/bignumber": {
|
||||
"version": "5.4.1",
|
||||
"resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.4.2.tgz",
|
||||
"integrity": "sha512-fJhdxqoQNuDOk6epfM7yD6J8Pol4NUCy1vkaGAkuujZm0+lNow//MKu1hLhRiYV4BsOHyBv5/lsTjF+7hWwhJg==",
|
||||
"requires": {
|
||||
"@ethersproject/bytes": "^5.4.0",
|
||||
@@ -27051,6 +27117,7 @@
|
||||
},
|
||||
"axios": {
|
||||
"version": "0.21.1",
|
||||
"resolved": "https://registry.npmjs.org/axios/-/axios-0.21.4.tgz",
|
||||
"integrity": "sha512-dKQiRHxGD9PPRIUNIWvZhPTPpl1rf/OxTYKsqKUDjBwYylTvV7SjSHJb9ratfyzM6wCdLCOYLzs73qpg5c4iGA==",
|
||||
"requires": {
|
||||
"follow-redirects": "^1.10.0"
|
||||
@@ -28574,6 +28641,14 @@
|
||||
"@leichtgewicht/ip-codec": "^2.0.1"
|
||||
}
|
||||
},
|
||||
"dns-socket": {
|
||||
"version": "4.2.2",
|
||||
"resolved": "https://registry.npmjs.org/dns-socket/-/dns-socket-4.2.2.tgz",
|
||||
"integrity": "sha512-BDeBd8najI4/lS00HSKpdFia+OvUMytaVjfzR9n5Lq8MlZRSvtbI+uLtx1+XmQFls5wFU9dssccTmQQ6nfpjdg==",
|
||||
"requires": {
|
||||
"dns-packet": "^5.2.4"
|
||||
}
|
||||
},
|
||||
"doctrine": {
|
||||
"version": "3.0.0",
|
||||
"integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==",
|
||||
@@ -29423,6 +29498,7 @@
|
||||
},
|
||||
"ethers": {
|
||||
"version": "5.4.6",
|
||||
"resolved": "https://registry.npmjs.org/ethers/-/ethers-5.4.7.tgz",
|
||||
"integrity": "sha512-F7LXARyB/Px3AQC6/QKedWZ8eqCkgOLORqL4B/F0Mag/K+qJSFGqsR36EaOZ6fKg3ZonI+pdbhb4A8Knt/43jQ==",
|
||||
"requires": {
|
||||
"@ethersproject/abi": "5.4.1",
|
||||
@@ -29431,7 +29507,7 @@
|
||||
"@ethersproject/address": "5.4.0",
|
||||
"@ethersproject/base64": "5.4.0",
|
||||
"@ethersproject/basex": "5.4.0",
|
||||
"@ethersproject/bignumber": "5.4.1",
|
||||
"@ethersproject/bignumber": "5.4.2",
|
||||
"@ethersproject/bytes": "5.4.0",
|
||||
"@ethersproject/constants": "5.4.0",
|
||||
"@ethersproject/contracts": "5.4.1",
|
||||
@@ -31271,10 +31347,11 @@
|
||||
}
|
||||
},
|
||||
"ipfs-coord": {
|
||||
"version": "6.6.8",
|
||||
"resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.6.8.tgz",
|
||||
"integrity": "sha512-nnWgdB9zXnR8FPqAHd7XKJ8zSEq//XHxZAG8rB2BJ/KU/fJINW6x7PG5bIpeLTVRvyd0XfaWmbaAfEFgly+dpQ==",
|
||||
"version": "6.7.1",
|
||||
"resolved": "https://registry.npmjs.org/ipfs-coord/-/ipfs-coord-6.7.1.tgz",
|
||||
"integrity": "sha512-II0z1fNeWIHmEkRC9b2bNyMt0qJXH8+XNH7352iF7V/5hn7ix8+gNfmgDtno+C8DDy3kk6voQntf0v/WSzC45Q==",
|
||||
"requires": {
|
||||
"axios": "^0.21.4",
|
||||
"bch-encrypt-lib": "^2.0.0",
|
||||
"orbit-db": "^0.26.1"
|
||||
}
|
||||
@@ -38017,9 +38094,9 @@
|
||||
},
|
||||
"orbit-db-access-controllers": {
|
||||
"version": "0.3.0",
|
||||
"resolved": "https://registry.npmjs.org/orbit-db-access-controllers/-/orbit-db-access-controllers-0.3.2.tgz",
|
||||
"integrity": "sha512-H7xfgpcyAx9ToFYMvpP7StCt269uaqM33lnMdY9T1o3gbP8IYe0wPurkPQwg6IVZHrDeeBvTDA7kbOqShf9vJw==",
|
||||
"requires": {
|
||||
"orbit-db-io": "^0.3.0",
|
||||
"p-map-series": "^1.0.0"
|
||||
}
|
||||
},
|
||||
@@ -39370,6 +39447,7 @@
|
||||
},
|
||||
"protocol-buffers-schema": {
|
||||
"version": "3.5.2",
|
||||
"resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz",
|
||||
"integrity": "sha512-LPzSaBYp/TcbuSlpGwqT5jR9kvJ3Zp5ic2N5c2ybx6XB/lSfEHq2D7ja8AgoxHoMD91wXFALJoXsvshKPuXyew=="
|
||||
},
|
||||
"protons": {
|
||||
@@ -39412,6 +39490,16 @@
|
||||
"integrity": "sha512-77DZwxQmxKnu3aR542U+X8FypNzbfJ+C5XQDk3uWjWxn6151aIMGthWYRXTqT1E5oJvg+ljaa2OJi+VfvCOQ8w==",
|
||||
"dev": true
|
||||
},
|
||||
"public-ip": {
|
||||
"version": "4.0.4",
|
||||
"resolved": "https://registry.npmjs.org/public-ip/-/public-ip-4.0.4.tgz",
|
||||
"integrity": "sha512-EJ0VMV2vF6Cu7BIPo3IMW1Maq6ME+fbR0NcPmqDfpfNGIRPue1X8QrGjrg/rfjDkOsIkKHIf2S5FlEa48hFMTA==",
|
||||
"requires": {
|
||||
"dns-socket": "^4.2.2",
|
||||
"got": "^9.6.0",
|
||||
"is-ip": "^3.1.0"
|
||||
}
|
||||
},
|
||||
"pump": {
|
||||
"version": "3.0.0",
|
||||
"integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==",
|
||||
|
||||
+3
-2
@@ -23,12 +23,12 @@
|
||||
},
|
||||
"repository": "Permissionless-Software-Foundation/ipfs-bch-wallet-service",
|
||||
"dependencies": {
|
||||
"@chris.troutner/ipfs": "2.0.2",
|
||||
"@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.8",
|
||||
"ipfs-coord": "^6.7.1",
|
||||
"jsonrpc-lite": "^2.2.0",
|
||||
"jsonwebtoken": "^8.5.1",
|
||||
"jwt-bch-lib": "^1.3.0",
|
||||
@@ -48,6 +48,7 @@
|
||||
"node-fetch": "npm:@achingbrain/node-fetch@^2.6.7",
|
||||
"nodemailer": "^6.4.17",
|
||||
"passport-local": "^1.0.0",
|
||||
"public-ip": "^4.0.4",
|
||||
"winston": "^3.3.3",
|
||||
"winston-daily-rotate-file": "^4.5.0"
|
||||
},
|
||||
|
||||
@@ -51,7 +51,7 @@ WORKDIR /home/safeuser/ipfs-bch-wallet-service
|
||||
RUN git checkout ct-unstable
|
||||
|
||||
# Install dependencies
|
||||
RUN npm install -g @mapbox/node-pre-gyp
|
||||
#RUN npm install -g @mapbox/node-pre-gyp
|
||||
RUN npm install
|
||||
|
||||
# Generate the API docs
|
||||
|
||||
@@ -20,6 +20,7 @@ services:
|
||||
options:
|
||||
max-size: '10m'
|
||||
max-file: '10'
|
||||
mem_limit: 500mb
|
||||
links:
|
||||
- bch-wallet-mongodb
|
||||
ports:
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
|
||||
# This mnemonic is used to set up persistent public key for e2ee
|
||||
# Replace this with your own 12-word mnemonic.
|
||||
# You can get one at https://wallet.fullstack.cash.
|
||||
export MNEMONIC="olive two muscle bottom coral ancient wait legend bronze useful process session"
|
||||
|
||||
# The human readable name this IPFS node identifies as.
|
||||
@@ -11,6 +12,9 @@ export COORD_NAME=bch-wallet-service-generic
|
||||
|
||||
# Allow this node to function as a circuit relay. It must not be behind a firewall.
|
||||
#export ENABLE_CIRCUIT_RELAY=true
|
||||
# For browsers to use your circuit realy, you must set up a domain, SSL certificate,
|
||||
# and you must forward that subdomain to the IPFS_WS_PORT.
|
||||
#export CR_DOMAIN=subdomain.yourdomain.com
|
||||
|
||||
# Debug level. 0 = minimal info. 2 = max info.
|
||||
export DEBUG_LEVEL=1
|
||||
|
||||
@@ -1,18 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script is an example for running a generic ipfs-service-provider instance.
|
||||
|
||||
# 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
|
||||
|
||||
# The human-readible name that is used when displaying data about this node.
|
||||
export COORD_NAME=ipfs-service-provider-generic
|
||||
|
||||
# This is used for end-to-end encryption (e2ee).
|
||||
export MNEMONIC="churn aisle shield silver ladder swear hunt slim pen demand spoil veteran"
|
||||
|
||||
# 0 = less verbose. 3 = most verbose
|
||||
export DEBUG_LEVEL=1
|
||||
|
||||
# MongoDB connection string.
|
||||
#export DBURL=mongodb://localhost:27017/bch-service-dev
|
||||
|
||||
npm start
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script is an example for running a generic ipfs-service-provider instance.
|
||||
|
||||
# Ports
|
||||
export PORT=5001 # REST API port
|
||||
export IPFS_TCP_PORT=5268
|
||||
export IPFS_WS_PORT=5269
|
||||
|
||||
# The human-readible name that is used when displaying data about this node.
|
||||
export COORD_NAME=ipfs-service-provider-generic
|
||||
|
||||
# This is used for end-to-end encryption (e2ee).
|
||||
export MNEMONIC="churn aisle shield silver ladder swear hunt slim pen demand spoil veteran"
|
||||
|
||||
# 0 = less verbose. 3 = most verbose
|
||||
export DEBUG_LEVEL=1
|
||||
|
||||
# MongoDB connection string.
|
||||
#export DBURL=mongodb://localhost:27017/bch-service-dev
|
||||
|
||||
npm start
|
||||
Executable
+31
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script is an example for running a ipfs-service-provider as a Circuit Relay.
|
||||
# Circuit Relays are help other nodes on the network communicate. They are
|
||||
# critical for reliable functioning of the network, and for circumventing
|
||||
# censorship.
|
||||
|
||||
# Ports
|
||||
export PORT=5001 # REST API port
|
||||
export IPFS_TCP_PORT=5268
|
||||
export IPFS_WS_PORT=5269
|
||||
|
||||
# The human-readible name that is used when displaying data about this node.
|
||||
export COORD_NAME=ipfs-service-provider-generic
|
||||
|
||||
# This is used for end-to-end encryption (e2ee).
|
||||
export MNEMONIC="churn aisle shield silver ladder swear hunt slim pen demand spoil veteran"
|
||||
|
||||
# 0 = less verbose. 3 = most verbose
|
||||
export DEBUG_LEVEL=1
|
||||
|
||||
# MongoDB connection string.
|
||||
#export DBURL=mongodb://localhost:27017/bch-service-dev
|
||||
|
||||
# Comment to disable circuit relay functionality. Or set to 1 to enable.
|
||||
export ENABLE_CIRCUIT_RELAY=1
|
||||
# For browsers to use your circuit realy, you must set up a domain, SSL certificate,
|
||||
# and you must forward that subdomain to the IPFS_WS_PORT.
|
||||
#export CR_DOMAIN=subdomain.yourdomain.com
|
||||
|
||||
npm start
|
||||
@@ -7,6 +7,7 @@
|
||||
// Global npm libraries
|
||||
const IpfsCoord = require('ipfs-coord')
|
||||
// const BCHJS = require('@psf/bch-js')
|
||||
const publicIp = require('public-ip')
|
||||
|
||||
// Local libraries
|
||||
const config = require('../../../config')
|
||||
@@ -43,7 +44,23 @@ class IpfsCoordAdapter {
|
||||
}
|
||||
|
||||
async start (localConfig = {}) {
|
||||
// console.log('this.config.announceJsonLd: ', this.config.announceJsonLd)
|
||||
const circuitRelayInfo = {}
|
||||
|
||||
// If configured as a Circuit Relay, get the public IP addresses for this node.
|
||||
if (this.config.isCircuitRelay) {
|
||||
try {
|
||||
const ip4 = await publicIp.v4()
|
||||
// const ip6 = await publicIp.v6()
|
||||
|
||||
circuitRelayInfo.ip4 = ip4
|
||||
circuitRelayInfo.tcpPort = this.config.ipfsTcpPort
|
||||
|
||||
// Domain used by browser-based secure websocket connections.
|
||||
circuitRelayInfo.crDomain = this.config.crDomain
|
||||
} catch (err) {
|
||||
/* exit quietly */
|
||||
}
|
||||
}
|
||||
|
||||
this.ipfsCoord = new this.IpfsCoord({
|
||||
ipfs: this.ipfs,
|
||||
@@ -52,6 +69,7 @@ class IpfsCoordAdapter {
|
||||
bchjs: this.bchjs,
|
||||
privateLog: console.log, // Default to console.log
|
||||
isCircuitRelay: this.config.isCircuitRelay,
|
||||
circuitRelayInfo,
|
||||
apiInfo: this.config.apiInfo,
|
||||
announceJsonLd: this.config.announceJsonLd,
|
||||
mnemonic: this.config.mnemonic,
|
||||
|
||||
@@ -36,7 +36,7 @@ class IpfsAdapter {
|
||||
relay: {
|
||||
enabled: true, // enable circuit relay dialer and listener
|
||||
hop: {
|
||||
enabled: true // enable circuit relay HOP (make this node a relay)
|
||||
enabled: config.isCircuitRelay // enable circuit relay HOP (make this node a relay)
|
||||
}
|
||||
},
|
||||
pubsub: true, // enable pubsub
|
||||
@@ -61,6 +61,10 @@ class IpfsAdapter {
|
||||
// Set the 'server' profile so the node does not scan private networks.
|
||||
await this.ipfs.config.profiles.apply('server')
|
||||
|
||||
// Debugging: Display IPFS config settings.
|
||||
// const configSettings = await this.ipfs.config.getAll()
|
||||
// console.log(`configSettings: ${JSON.stringify(configSettings, null, 2)}`)
|
||||
|
||||
// Signal that this adapter is ready.
|
||||
this.isReady = true
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
// Public npm libraries
|
||||
const BCHJS = require('@psf/bch-js')
|
||||
const IpfsCoord = require('ipfs-coord')
|
||||
const IPFS = require('ipfs')
|
||||
const IPFS = require('@chris.troutner/ipfs')
|
||||
const EventEmitter = require('events')
|
||||
const { v4: uid } = require('uuid')
|
||||
const jsonrpc = require('jsonrpc-lite')
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"uutAddr": "/ip4/127.0.0.1/tcp/5701/p2p/QmWkjYRRTaxVEuGK8ip2X3trVyJShFs6U9g1h9x6fK5mZ2",
|
||||
"uutId": "QmWkjYRRTaxVEuGK8ip2X3trVyJShFs6U9g1h9x6fK5mZ2"
|
||||
"uutAddr": "/ip4/127.0.0.1/tcp/5268/p2p/QmdBGB8S6sEr19gaAxJYjhRbz5ZmMiH5a1JyyMmaxcRKnY",
|
||||
"uutId": "QmdBGB8S6sEr19gaAxJYjhRbz5ZmMiH5a1JyyMmaxcRKnY"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user