Compare commits

...
7 Commits
Author SHA1 Message Date
Chris Troutner 71452f4834 Merge pull request #96 from Permissionless-Software-Foundation/ct-unstable
fix(bch-js): Updating to v4.15.2 to test rate limit idea
2021-02-24 13:37:57 -08:00
Chris Troutner 96f1cb6ad4 fix(bch-js): Updating to v4.15.2 to test rate limit idea 2021-02-24 13:36:21 -08:00
Chris Troutner 36dd64db22 Updating docker example shell script 2021-02-11 13:54:00 -08:00
Chris Troutner 05de04a569 Merge branch 'ct-unstable' 2021-02-11 12:56:49 -08:00
Chris Troutner c661799095 Commenting out debugging line 2021-02-11 12:56:35 -08:00
Chris Troutner 4f416d6423 Merge pull request #94 from Permissionless-Software-Foundation/ct-unstable
fix(slp): Fixing typo with whitelist env var
2021-02-11 12:51:46 -08:00
Chris Troutner 58dc4da92c fix(slp): Fixing typo with whitelist env var 2021-02-11 12:50:39 -08:00
4 changed files with 347 additions and 1232 deletions
+8 -1
View File
@@ -16,9 +16,10 @@ export RPC_USERNAME=bitcoin
export RPC_PASSWORD=password
# SLPDB
export SLPDB_PASS_GP=somelongpassword
export SLPDB_URL=http://172.17.0.1:12300/
export SLPDB_PASS=somelongpassword
# Use the same address as SLPDB_URL if you don't have a separate whitelist server.
export SLPDB_PASS_WL=somelongpassword
export SLPDB_WHITELIST_URL=http://172.17.0.1:12300/
# slp-api alternative SLP validator using slp-validate:
# https://github.com/Permissionless-Software-Foundation/slp-api
@@ -54,4 +55,10 @@ export ANON_RATE_LIMIT=50
# 10 = 100 RPM
export WHITELIST_RATE_LIMIT=10
# Set logging parameters
#1m means no more than 1 megabyte
export LOG_MAX_SIZE=1m
#5d means store no more than 5 days
export LOG_MAX_FILES=5d
npm start
+330 -1225
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -29,7 +29,7 @@
"node": ">=10.15.1"
},
"dependencies": {
"@psf/bch-js": "^4.11.1",
"@psf/bch-js": "^4.15.2",
"apidoc": "^0.26.0",
"axios": "^0.21.1",
"bitcore-lib-cash": "^8.23.1",
@@ -69,7 +69,7 @@
"nock": "^13.0.5",
"nyc": "^15.0.0",
"prettier": "^2.0.0",
"semantic-release": "^17.3.1",
"semantic-release": "^17.3.9",
"sinon": "^9.0.0",
"standard": "^14.3.1"
},
+7 -4
View File
@@ -38,7 +38,7 @@ util.inspect.defaultOptions = { depth: 5 }
// Password for General Purpose (GP) SLPDB.
const SLPDB_PASS_GP = process.env.SLPDB_PASS_GP ? process.env.SLPDB_PASS_GP : 'BITBOX'
// Password for Whitelist (WL) SLPDB.
const SLPDB_PASS_WL = process.env.SLPDB_PASS_GP ? process.env.SLPDB_PASS_GP : 'BITBOX'
const SLPDB_PASS_WL = process.env.SLPDB_PASS_WL ? process.env.SLPDB_PASS_WL : 'BITBOX'
// const rawtransactions = require('./full-node/rawtransactions')
const RawTransactions = require('./full-node/rawtransactions')
@@ -46,9 +46,9 @@ const rawTransactions = new RawTransactions()
// Setup REST and TREST URLs used by slpjs
// Dev note: this allows for unit tests to mock the URL.
if (!process.env.REST_URL) process.env.REST_URL = 'https://rest.bitcoin.com/v2/'
if (!process.env.REST_URL) process.env.REST_URL = 'https://bchn.fullstack.cash/v4/'
if (!process.env.TREST_URL) {
process.env.TREST_URL = 'https://trest.bitcoin.com/v2/'
process.env.TREST_URL = 'https://testnet.fullstack.cash/v4/'
}
let _this
@@ -1979,6 +1979,9 @@ class Slp {
try {
const utxos = req.body.utxos
console.log(`req._remoteAddress: ${req._remoteAddress}`)
const origin = req._remoteAddress
// Validate inputs
if (!Array.isArray(utxos)) {
res.status(422)
@@ -2013,7 +2016,7 @@ class Slp {
const theseUtxos = utxos[i].utxos
// Get SLP token details.
const details = await _this.bchjs.SLP.Utils.tokenUtxoDetails(theseUtxos)
const details = await _this.bchjs.SLP.Utils.tokenUtxoDetails(theseUtxos, origin)
// console.log('details: ', details)
// Replace the original UTXO data with the hydrated data.