mirror of
https://github.com/Xahau/Validation-Ledger-Tx-Store-to-xPOP.git
synced 2025-11-20 03:35:52 +00:00
Add health + stats endpoint
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user