mirror of
https://github.com/Xahau/Validation-Ledger-Tx-Store-to-xPOP.git
synced 2025-11-19 19:25:52 +00:00
Allow for less verbose logging from env
This commit is contained in:
@@ -8,4 +8,8 @@ NETWORKID="1"
|
||||
UNLURL="https://vl.altnet.rippletest.net"
|
||||
UNLKEY="ED264807102805220DA0F312E71FC2C69E1552C9C5790F6C25E3729DEB573D5860"
|
||||
|
||||
FIELDSREQUIRED="Fee,Account,OperationLimit"
|
||||
FIELDSREQUIRED="Fee,Account,OperationLimit"
|
||||
|
||||
# Less logging:
|
||||
# NOVALIDATIONLOG="true"
|
||||
# NOELIGIBLEFULLTXLOG="true"
|
||||
|
||||
@@ -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 => {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user