diff --git a/.env.sample b/.env.sample index d10c152..9b67572 100644 --- a/.env.sample +++ b/.env.sample @@ -8,4 +8,8 @@ NETWORKID="1" UNLURL="https://vl.altnet.rippletest.net" UNLKEY="ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860" -FIELDSREQUIRED="Fee,Account,OperationLimit" \ No newline at end of file +FIELDSREQUIRED="Fee,Account,OperationLimit" + +# Less logging: +# NOVALIDATIONLOG="true" +# NOELIGIBLEFULLTXLOG="true" diff --git a/lib/onTransaction.mjs b/lib/onTransaction.mjs index 838d1ce..bcd35d6 100644 --- a/lib/onTransaction.mjs +++ b/lib/onTransaction.mjs @@ -28,13 +28,15 @@ const onTransaction = async ({ lastSeenTransactions.length = 3000 const validTx = hasRequiredFields(tx) - console.log('TX', tx.hash, validTx) + 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 => { diff --git a/lib/onValidation.mjs b/lib/onValidation.mjs index 7617c29..b058cc7 100644 --- a/lib/onValidation.mjs +++ b/lib/onValidation.mjs @@ -48,15 +48,17 @@ const onValidation = async ({ /** * Debug output */ - console.log( - networkId, - validation.ledger_index, - relativeStorDir, - validation.validation_public_key, - // validation.validated_hash, // parent hash - validation.ledger_hash, // ledger_hash - connectionUrl, - ) + if (!process.env?.NOVALIDATIONLOG) { + console.log( + networkId, + validation.ledger_index, + relativeStorDir, + validation.validation_public_key, + // validation.validated_hash, // parent hash + validation.ledger_hash, // ledger_hash + connectionUrl, + ) + } /** * Create validation file