mirror of
https://github.com/fullstack-cash/bch-api.git
synced 2026-09-22 09:12:05 -07:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bddff1f9bd | ||
|
|
9d5a0d9520 | ||
|
|
f146504ed0 | ||
|
|
03a4eb1b72 | ||
|
|
6286b4967b | ||
|
|
6bf86b29f8 | ||
|
|
0b180e02a4 | ||
|
|
a2267c9590 | ||
|
|
ed83f5eb3f | ||
|
|
91e5423dd2 | ||
|
|
de4cb8762a | ||
|
|
284e9a9ee7 | ||
|
|
ec2fb8e24f | ||
|
|
07fc05fa12 | ||
|
|
2bfad5d261 | ||
|
|
efe4cad08b | ||
|
|
b704707ded | ||
|
|
6c8a156f37 | ||
|
|
19d9153629 | ||
|
|
840e92e54c | ||
|
|
8e4592826f | ||
|
|
c4085fb929 | ||
|
|
c927763849 | ||
|
|
00e1840ca2 | ||
|
|
7e9a9bc635 | ||
|
|
41163096e3 | ||
|
|
1b3e1cc293 |
+4
-2
@@ -17,12 +17,14 @@ test-fullstack-main.sh
|
|||||||
start-fullstack-main.sh
|
start-fullstack-main.sh
|
||||||
start-fullstack-test.sh
|
start-fullstack-test.sh
|
||||||
start-free-main.sh
|
start-free-main.sh
|
||||||
free-bch-api-main.sh
|
|
||||||
free-bch-api-test.sh
|
|
||||||
start-local-mainnet.sh.save
|
start-local-mainnet.sh.save
|
||||||
start-local-testnet.sh.save
|
start-local-testnet.sh.save
|
||||||
temp.sh
|
temp.sh
|
||||||
test-fullstack-test.sh
|
test-fullstack-test.sh
|
||||||
|
start-sweet-main.sh
|
||||||
|
test-sweet-main.sh
|
||||||
|
test-fullstack-abc.sh
|
||||||
|
test-fullstack-bchn.sh
|
||||||
|
|
||||||
coverage
|
coverage
|
||||||
start-my-infra
|
start-my-infra
|
||||||
|
|||||||
+18
-9
@@ -1,17 +1,26 @@
|
|||||||
|
#!/bin/bash
|
||||||
# Triggers a webhook to update the staging server at staging.fullstack.cash.
|
# Triggers a webhook to update the staging server at staging.fullstack.cash.
|
||||||
|
|
||||||
#!/bin/bash
|
|
||||||
#echo $DEPLOY_SECRET
|
#echo $DEPLOY_SECRET
|
||||||
|
|
||||||
echo "Deploy to production...."
|
# This if statement will only deploy on Jenkins when its testing the master branch.
|
||||||
|
echo "-->$GIT_BRANCH<--"
|
||||||
|
if [[ $GIT_BRANCH =~ "master" ]]
|
||||||
|
then
|
||||||
|
|
||||||
export DATA="{\"ref\":\"$DEPLOY_SECRET\"}"
|
echo "Deploying to production...."
|
||||||
|
|
||||||
#echo $DATA
|
export DATA="{\"ref\":\"$DEPLOY_SECRET\"}"
|
||||||
|
|
||||||
curl -X POST http://fullstack.cash:9000/hooks/bch-api-mainnet -H "Content-Type: application/json" -d $DATA
|
#echo $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."
|
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
|
||||||
|
|||||||
@@ -18,7 +18,6 @@ USER safeuser
|
|||||||
WORKDIR /home/safeuser
|
WORKDIR /home/safeuser
|
||||||
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api
|
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api
|
||||||
WORKDIR /home/safeuser/bch-api
|
WORKDIR /home/safeuser/bch-api
|
||||||
RUN git checkout free
|
|
||||||
RUN npm install --silent
|
RUN npm install --silent
|
||||||
|
|
||||||
# Generate documentation
|
# Generate documentation
|
||||||
|
|||||||
@@ -15,13 +15,12 @@ USER safeuser
|
|||||||
WORKDIR /home/safeuser
|
WORKDIR /home/safeuser
|
||||||
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api
|
RUN git clone https://github.com/Permissionless-Software-Foundation/bch-api
|
||||||
WORKDIR /home/safeuser/bch-api
|
WORKDIR /home/safeuser/bch-api
|
||||||
RUN git checkout free
|
|
||||||
RUN npm install --silent
|
RUN npm install --silent
|
||||||
|
|
||||||
# Generate documentation
|
# Generate documentation
|
||||||
RUN npm run docs
|
RUN npm run docs
|
||||||
|
|
||||||
EXPOSE 4000
|
EXPOSE 3000
|
||||||
|
|
||||||
COPY start-local-testnet.sh start-local-testnet.sh
|
COPY start-local-testnet.sh start-local-testnet.sh
|
||||||
CMD ["./start-local-testnet.sh"]
|
CMD ["./start-local-testnet.sh"]
|
||||||
|
|||||||
@@ -6,9 +6,9 @@ bch-api-test:
|
|||||||
links:
|
links:
|
||||||
- redis-test
|
- redis-test
|
||||||
ports:
|
ports:
|
||||||
- "4000:4000"
|
- "4000:3000"
|
||||||
volumes:
|
volumes:
|
||||||
- ../../logs:/home/safeuser/bch-api/logs
|
- ../../logs:/home/safeuser/bch-api/logs
|
||||||
restart: always
|
restart: always
|
||||||
|
|
||||||
redis-test:
|
redis-test:
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ class RateLimits {
|
|||||||
// Calculates the points consumed, based on the jwt information and the route
|
// Calculates the points consumed, based on the jwt information and the route
|
||||||
// requested.
|
// requested.
|
||||||
calcPoints (jwtInfo) {
|
calcPoints (jwtInfo) {
|
||||||
let retVal = 33 // By default, use anonymous tier.
|
let retVal = 300 // By default, use anonymous tier.
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// console.log(`jwtInfo: ${JSON.stringify(jwtInfo, null, 2)}`)
|
// console.log(`jwtInfo: ${JSON.stringify(jwtInfo, null, 2)}`)
|
||||||
@@ -197,12 +197,12 @@ class RateLimits {
|
|||||||
if (level40Routes.includes(resource)) {
|
if (level40Routes.includes(resource)) {
|
||||||
if (apiLevel >= 40) retVal = 10
|
if (apiLevel >= 40) retVal = 10
|
||||||
// else if (apiLevel >= 10) retVal = 10
|
// else if (apiLevel >= 10) retVal = 10
|
||||||
else retVal = 33
|
else retVal = 100
|
||||||
|
|
||||||
// Normal indexer routes
|
// Normal indexer routes
|
||||||
} else if (level30Routes.includes(resource)) {
|
} else if (level30Routes.includes(resource)) {
|
||||||
if (apiLevel >= 30) retVal = 10
|
if (apiLevel >= 30) retVal = 10
|
||||||
else retVal = 33
|
else retVal = 100
|
||||||
|
|
||||||
// Full node tier
|
// Full node tier
|
||||||
} else if (apiLevel >= 20) {
|
} else if (apiLevel >= 20) {
|
||||||
@@ -210,7 +210,7 @@ class RateLimits {
|
|||||||
|
|
||||||
// Free tier, full node only.
|
// Free tier, full node only.
|
||||||
} else {
|
} else {
|
||||||
retVal = 33
|
retVal = 100
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -218,7 +218,7 @@ class RateLimits {
|
|||||||
} catch (err) {
|
} catch (err) {
|
||||||
wlogger.error('Error in route-ratelimit.js/calcPoints()')
|
wlogger.error('Error in route-ratelimit.js/calcPoints()')
|
||||||
// throw err
|
// throw err
|
||||||
retVal = 33
|
retVal = 300
|
||||||
}
|
}
|
||||||
|
|
||||||
return retVal
|
return retVal
|
||||||
|
|||||||
@@ -975,6 +975,7 @@ describe('#Raw-Transactions', () => {
|
|||||||
// Restore the saved URL.
|
// Restore the saved URL.
|
||||||
process.env.RPC_BASEURL = savedUrl2
|
process.env.RPC_BASEURL = savedUrl2
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should submit hex encoded transaction', async () => {
|
it('should submit hex encoded transaction', async () => {
|
||||||
// This is a difficult test to run as transaction hex is invalid after a
|
// 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'
|
// block confirmation. So the unit tests simulates what the output 'should'
|
||||||
|
|||||||
Reference in New Issue
Block a user