Compare commits

..
17 Commits
7 changed files with 21 additions and 31 deletions
+2 -4
View File
@@ -17,14 +17,12 @@ 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
test-fullstack-test.sh
start-sweet-main.sh
test-sweet-main.sh
test-fullstack-abc.sh
test-fullstack-bchn.sh
coverage
start-my-infra
+9 -18
View File
@@ -1,26 +1,17 @@
#!/bin/bash
# Triggers a webhook to update the staging server at staging.fullstack.cash.
#!/bin/bash
#echo $DEPLOY_SECRET
# This if statement will only deploy on Jenkins when its testing the master branch.
echo "-->$GIT_BRANCH<--"
if [[ $GIT_BRANCH =~ "master" ]]
then
echo "Deploy to production...."
echo "Deploying to production...."
export DATA="{\"ref\":\"$DEPLOY_SECRET\"}"
export DATA="{\"ref\":\"$DEPLOY_SECRET\"}"
#echo $DATA
#echo $DATA
curl -X POST http://fullstack.cash:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA
curl -X POST http://fullstack.cash:9000/hooks/bch-api-testnet -H "Content-Type: application/json" -d $DATA
curl -X POST http://$FREE_SERVER:9000/hooks/bch-api-testnet -H "Content-Type: application/json" -d $DATA
curl -X POST http://$FREE_SERVER:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA
curl -X POST http://fullstack.cash:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA
curl -X POST http://fullstack.cash:9000/hooks/bch-api-testnet -H "Content-Type: application/json" -d $DATA
curl -X POST http://$FREE_SERVER:9000/hooks/bch-api-testnet -H "Content-Type: application/json" -d $DATA
curl -X POST http://$FREE_SERVER:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA
echo "...Finished deploying to production."
else
echo "Not master, so not deploying."
fi
echo "...Finished deploying to production."
+1
View File
@@ -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
+2 -1
View File
@@ -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"]
+2 -2
View File
@@ -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:
+5 -5
View File
@@ -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
-1
View File
@@ -975,7 +975,6 @@ describe('#Raw-Transactions', () => {
// Restore the saved URL.
process.env.RPC_BASEURL = savedUrl2
})
it('should submit hex encoded transaction', async () => {
// This is a difficult test to run as transaction hex is invalid after a
// block confirmation. So the unit tests simulates what the output 'should'