mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 01:02:05 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3cb50cb26a | ||
|
|
453aba8af0 | ||
|
|
a61c7c2c8f | ||
|
|
874b60e647 | ||
|
|
ec8d64171b | ||
|
|
f233b14271 | ||
|
|
34918eb8bb | ||
|
|
afce237885 | ||
|
|
62618ea666 | ||
|
|
6bd136d9cd | ||
|
|
cf1e8e5134 | ||
|
|
960092bfe5 | ||
|
|
36921680e0 | ||
|
|
98a33413d7 | ||
|
|
840d09980e | ||
|
|
4e50a2e4b8 | ||
|
|
7b5eba9d45 |
@@ -17,6 +17,8 @@ test-fullstack-main.sh
|
||||
start-fullstack-main.sh
|
||||
start-fullstack-test.sh
|
||||
start-free-main.sh
|
||||
free-bch-api-main.sh
|
||||
free-bch-api-test.sh
|
||||
start-local-mainnet.sh.save
|
||||
start-local-testnet.sh.save
|
||||
temp.sh
|
||||
|
||||
@@ -18,6 +18,7 @@ USER safeuser
|
||||
WORKDIR /home/safeuser
|
||||
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api
|
||||
WORKDIR /home/safeuser/bch-api
|
||||
RUN git checkout free
|
||||
RUN npm install --silent
|
||||
|
||||
# Generate documentation
|
||||
|
||||
@@ -15,12 +15,13 @@ USER safeuser
|
||||
WORKDIR /home/safeuser
|
||||
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api
|
||||
WORKDIR /home/safeuser/bch-api
|
||||
RUN git checkout free
|
||||
RUN npm install --silent
|
||||
|
||||
# Generate documentation
|
||||
RUN npm run docs
|
||||
|
||||
EXPOSE 3000
|
||||
EXPOSE 4000
|
||||
|
||||
COPY start-local-testnet.sh start-local-testnet.sh
|
||||
CMD ["./start-local-testnet.sh"]
|
||||
|
||||
@@ -6,9 +6,9 @@ bch-api-test:
|
||||
links:
|
||||
- redis-test
|
||||
ports:
|
||||
- "4000:3000"
|
||||
- "4000:4000"
|
||||
volumes:
|
||||
- ../../logs:/home/safeuser/bch-api/logs
|
||||
- ../../logs:/home/safeuser/bch-api/logs
|
||||
restart: always
|
||||
|
||||
redis-test:
|
||||
|
||||
@@ -178,7 +178,7 @@ class RateLimits {
|
||||
// Calculates the points consumed, based on the jwt information and the route
|
||||
// requested.
|
||||
calcPoints (jwtInfo) {
|
||||
let retVal = 300 // By default, use anonymous tier.
|
||||
let retVal = 33 // By default, use anonymous tier.
|
||||
|
||||
try {
|
||||
// console.log(`jwtInfo: ${JSON.stringify(jwtInfo, null, 2)}`)
|
||||
@@ -197,12 +197,12 @@ class RateLimits {
|
||||
if (level40Routes.includes(resource)) {
|
||||
if (apiLevel >= 40) retVal = 10
|
||||
// else if (apiLevel >= 10) retVal = 10
|
||||
else retVal = 100
|
||||
else retVal = 33
|
||||
|
||||
// Normal indexer routes
|
||||
} else if (level30Routes.includes(resource)) {
|
||||
if (apiLevel >= 30) retVal = 10
|
||||
else retVal = 100
|
||||
else retVal = 33
|
||||
|
||||
// Full node tier
|
||||
} else if (apiLevel >= 20) {
|
||||
@@ -210,7 +210,7 @@ class RateLimits {
|
||||
|
||||
// Free tier, full node only.
|
||||
} else {
|
||||
retVal = 100
|
||||
retVal = 33
|
||||
}
|
||||
}
|
||||
|
||||
@@ -218,7 +218,7 @@ class RateLimits {
|
||||
} catch (err) {
|
||||
wlogger.error('Error in route-ratelimit.js/calcPoints()')
|
||||
// throw err
|
||||
retVal = 300
|
||||
retVal = 33
|
||||
}
|
||||
|
||||
return retVal
|
||||
|
||||
Reference in New Issue
Block a user