mirror of
https://github.com/Xahau/Validation-Ledger-Tx-Store-to-xPOP.git
synced 2025-11-20 11:45:51 +00:00
Allow for less verbose logging from env
This commit is contained in:
@@ -9,3 +9,7 @@ UNLURL="https://vl.altnet.rippletest.net"
|
||||
UNLKEY="ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860"
|
||||
|
||||
FIELDSREQUIRED="Fee,Account,OperationLimit"
|
||||
|
||||
# Less logging:
|
||||
# NOVALIDATIONLOG="true"
|
||||
# NOELIGIBLEFULLTXLOG="true"
|
||||
|
||||
@@ -28,13 +28,15 @@ const onTransaction = async ({
|
||||
lastSeenTransactions.length = 3000
|
||||
|
||||
const validTx = hasRequiredFields(tx)
|
||||
if (!process.env?.NOELIGIBLEFULLTXLOG) {
|
||||
console.log('TX', tx.hash, validTx)
|
||||
}
|
||||
|
||||
if (validTx && transaction?.ledger_index) {
|
||||
const relativeStorDir = 'store/' + networkId + '/' + ledgerIndexToFolders(transaction.ledger_index)
|
||||
const storeDir = new URL('../' + relativeStorDir, import.meta.url).pathname
|
||||
|
||||
console.log('xPOP eligible', relativeStorDir, transaction)
|
||||
console.log('xPOP eligible', relativeStorDir, process.env?.NOELIGIBLEFULLTXLOG ? tx.hash : tx)
|
||||
|
||||
if (await dirExists(storeDir)) {
|
||||
writeFile(storeDir + '/tx_' + tx.hash + '.json', Buffer.from(JSON.stringify(transaction), 'utf8'), err => {
|
||||
|
||||
@@ -48,6 +48,7 @@ const onValidation = async ({
|
||||
/**
|
||||
* Debug output
|
||||
*/
|
||||
if (!process.env?.NOVALIDATIONLOG) {
|
||||
console.log(
|
||||
networkId,
|
||||
validation.ledger_index,
|
||||
@@ -57,6 +58,7 @@ const onValidation = async ({
|
||||
validation.ledger_hash, // ledger_hash
|
||||
connectionUrl,
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Create validation file
|
||||
|
||||
Reference in New Issue
Block a user