Add health + stats endpoint

This commit is contained in:
Wietse Wind
2023-10-06 01:42:24 +02:00
parent e405e4d561
commit 9d1b9557d4
4 changed files with 40 additions and 0 deletions

View File

@@ -6,6 +6,8 @@ import { waitForLedgerReady } from './events/ledgerReady.mjs'
import { emit } from '../bin/webserver.mjs'
import 'dotenv/config'
let txCount = 0
const xpopBinaryDir = new URL('../store/xpop', import.meta.url).pathname
const lastSeenTransactions = []
@@ -81,6 +83,8 @@ const onTransaction = async ({
if (xpopWritten) {
console.log(' ### EMIT XPOP READY FOR', tx?.Account, Number(tx.Sequence), tx.hash)
txCount++
return await emit({
account: tx?.Account,
sequence: tx.Sequence,
@@ -116,4 +120,5 @@ const onTransaction = async ({
export {
onTransaction,
txCount,
}