mirror of
https://github.com/Permissionless-Software-Foundation/ipfs-bch-wallet-consumer.git
synced 2026-09-22 01:02:04 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a9f1427fd | ||
|
|
5c9539373c | ||
|
|
79484f706d | ||
|
|
6f6b5874d9 | ||
|
|
d0ef1a8669 | ||
|
|
9cff05311b | ||
|
|
986d843360 | ||
|
|
4670bd22af | ||
|
|
b3e7c63e61 | ||
|
|
c352c3d6d1 | ||
|
|
5bd425a3d3 | ||
|
|
1fcc92e10d | ||
|
|
f332aece98 | ||
|
|
89f24e9940 | ||
|
|
25a75dc369 | ||
|
|
f36ce14087 | ||
|
|
df45792f47 | ||
|
|
9e71e33ccd | ||
|
|
c7b0b0c1d5 | ||
|
|
e475e5f4c3 |
+4
-4
@@ -68,6 +68,10 @@ class Server {
|
||||
app.use(passport.initialize())
|
||||
app.use(passport.session())
|
||||
|
||||
// Enable CORS for testing
|
||||
// THIS IS A SECURITY RISK. COMMENT OUT FOR PRODUCTION
|
||||
app.use(cors({ origin: '*' }))
|
||||
|
||||
// Attach REST API and JSON RPC controllers to the app.
|
||||
const Controllers = require('../src/controllers')
|
||||
const controllers = new Controllers()
|
||||
@@ -75,10 +79,6 @@ class Server {
|
||||
|
||||
app.controllers = controllers
|
||||
|
||||
// Enable CORS for testing
|
||||
// THIS IS A SECURITY RISK. COMMENT OUT FOR PRODUCTION
|
||||
app.use(cors({ origin: '*' }))
|
||||
|
||||
// MIDDLEWARE END
|
||||
|
||||
console.log(`Running server in environment: ${config.env}`)
|
||||
|
||||
Generated
+81
-29
@@ -9,12 +9,12 @@
|
||||
"version": "1.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",
|
||||
"ipfs-coord": "6.8.5",
|
||||
"ipfs-coord": "6.8.10",
|
||||
"ipfs-http-client": "55.0.0",
|
||||
"jsonrpc-lite": "2.2.0",
|
||||
"jsonwebtoken": "8.5.1",
|
||||
@@ -60,6 +60,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",
|
||||
@@ -2198,9 +2231,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",
|
||||
@@ -3578,12 +3611,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": {
|
||||
@@ -7544,9 +7577,9 @@
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/follow-redirects": {
|
||||
"version": "1.14.6",
|
||||
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.6.tgz",
|
||||
"integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A==",
|
||||
"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",
|
||||
@@ -9735,9 +9768,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/ipfs-coord": {
|
||||
"version": "6.8.5",
|
||||
"resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-6.8.5.tgz",
|
||||
"integrity": "sha512-IQR++uPZuHKOxrT49raHho/CwQe1tKe2Q1Ed0hGDfarXJTtfmMmNH3jGSecyd5BYZNeugL67BnGuvoYrZFY7AA==",
|
||||
"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",
|
||||
@@ -12066,6 +12099,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",
|
||||
@@ -27347,9 +27389,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",
|
||||
@@ -28413,11 +28455,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": {
|
||||
@@ -31354,9 +31396,9 @@
|
||||
"integrity": "sha1-kV4tbQI8Q9UiStn20qPEFW9XEvU="
|
||||
},
|
||||
"follow-redirects": {
|
||||
"version": "1.14.6",
|
||||
"resolved": "http://94.130.170.209:4873/follow-redirects/-/follow-redirects-1.14.6.tgz",
|
||||
"integrity": "sha512-fhUl5EwSJbbl8AR+uYL2KQDxLkdSjZGR36xy46AO7cOMTrCMON6Sa28FmAnC2tRTDbd/Uuzz3aJBv7EBN7JH8A=="
|
||||
"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",
|
||||
@@ -32906,9 +32948,9 @@
|
||||
}
|
||||
},
|
||||
"ipfs-coord": {
|
||||
"version": "6.8.5",
|
||||
"resolved": "http://94.130.170.209:4873/ipfs-coord/-/ipfs-coord-6.8.5.tgz",
|
||||
"integrity": "sha512-IQR++uPZuHKOxrT49raHho/CwQe1tKe2Q1Ed0hGDfarXJTtfmMmNH3jGSecyd5BYZNeugL67BnGuvoYrZFY7AA==",
|
||||
"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",
|
||||
@@ -34686,6 +34728,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
@@ -23,12 +23,12 @@
|
||||
},
|
||||
"repository": "Permissionless-Software-Foundation/ipfs-bch-wallet-consumer",
|
||||
"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",
|
||||
"ipfs-coord": "6.8.5",
|
||||
"ipfs-coord": "6.8.10",
|
||||
"ipfs-http-client": "55.0.0",
|
||||
"jsonrpc-lite": "2.2.0",
|
||||
"jsonwebtoken": "8.5.1",
|
||||
|
||||
@@ -198,8 +198,9 @@ class BchAdapter {
|
||||
|
||||
// Wait for data to come back from the wallet service.
|
||||
const data = await this.waitForRPCResponse(rpcId)
|
||||
// console.log(`data: ${JSON.stringify(data, null, 2)}`)
|
||||
|
||||
return data[0]
|
||||
return data
|
||||
} catch (err) {
|
||||
// console.log('createUser() error: ', err)
|
||||
wlogger.error('Error in use-cases/bch.js/getUtxos()')
|
||||
@@ -400,6 +401,9 @@ class BchAdapter {
|
||||
dataFound = true
|
||||
// console.log('data was found in the queue')
|
||||
|
||||
// console.log(
|
||||
// `rawData.payload: ${JSON.stringify(rawData.payload, null, 2)}`
|
||||
// )
|
||||
data = rawData.payload.result.value
|
||||
|
||||
// Remove the data from the queue
|
||||
|
||||
@@ -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