9 Commits
8 changed files with 1028 additions and 989 deletions
+1 -1
View File
@@ -161,7 +161,7 @@ class Server {
// Endpoint logging middleware
app.use((req, res, next) => {
console.log(`Endpoint called: ${req.method} ${req.path}`)
console.log(`Endpoint called: ${req.method} ${req.path} by ${req.ip}`)
res.on('finish', () => {
console.log(`Endpoint responded: ${req.method} ${req.path} - ${res.statusCode}`)
})
+1012 -967
View File
File diff suppressed because it is too large Load Diff
+3 -3
View File
@@ -15,17 +15,17 @@
"license": "MIT",
"description": "REST API proxy to Bitcoin Cash infrastructure",
"dependencies": {
"@psf/bch-js": "7.1.2",
"@psf/bch-js": "7.1.4",
"axios": "1.7.7",
"cors": "2.8.5",
"dotenv": "16.3.1",
"express": "5.1.0",
"minimal-slp-wallet": "7.0.2",
"minimal-slp-wallet": "7.0.5",
"psffpp": "1.2.1",
"slp-token-media": "1.2.10",
"winston": "3.11.0",
"winston-daily-rotate-file": "4.7.1",
"x402-bch-express": "1.1.1"
"x402-bch-express": "2.0.0"
},
"devDependencies": {
"apidoc": "1.2.0",
+8 -6
View File
@@ -22,14 +22,16 @@ LOCAL_RESTURL=http://172.17.0.1:5942/v6
PORT=5942
# x402 payments required to access this API?
X402_ENABLED=true
SERVER_BCH_ADDRESS=bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d
FACILITATOR_URL=http://localhost:4345/facilitator
X402_PRICE_SAT=200
X402_ENABLED=false
#X402_ENABLED=true
#SERVER_BCH_ADDRESS=bitcoincash:qqlrzp23w08434twmvr4fxw672whkjy0py26r63g3d
#FACILITATOR_URL=http://localhost:4345/facilitator
#X402_PRICE_SAT=200
# Basic Authentication required to access this API?
USE_BASIC_AUTH=true
BASIC_AUTH_TOKEN=some-random-token
USE_BASIC_AUTH=false
#USE_BASIC_AUTH=true
#BASIC_AUTH_TOKEN=some-random-token
# END ACCESS CONTROL
+3 -1
View File
@@ -51,6 +51,8 @@ RUN git clone https://github.com/Permissionless-Software-Foundation/psf-bch-api
# and `stage` has the most up-to-date changes.
WORKDIR /home/safeuser/psf-bch-api
RUN git checkout ct-unstable
# Install dependencies
RUN npm install
RUN npm install minimal-slp-wallet
@@ -58,7 +60,7 @@ RUN npm install minimal-slp-wallet
# Generate the API docs
RUN npm run docs
COPY .env-local .env
COPY .env .env
CMD ["npm", "start"]
-3
View File
@@ -1,3 +0,0 @@
#!/bin/bash
npm start
-7
View File
@@ -1,7 +0,0 @@
// Simple Node.js app that prints 'hello world' every 10 seconds
setInterval(() => {
console.log('hello world')
}, 10000)
console.log('Timer started. Printing "hello world" every 10 seconds...')
+1 -1
View File
@@ -6,7 +6,7 @@ import wlogger from '../adapters/wlogger.js'
import BCHJS from '@psf/bch-js'
import config from '../config/index.js'
const bchjs = new BCHJS({
const bchjs = new BCHJS({
restURL: config.restURL,
bearerToken: config.basicAuth.token
})