Ethereum output sorting
================================================================== ==== ====================
If you use the “Listranschation” command on Blockchain Ethereum, you often want to sort out the output data to remove duplicates. Here is a step -Sy -step guideline how it works.
Method 1: Use the “-S” option
With the “-S” option, you can specify many keys in the output. By default, the output data contains all transactions with a “key” of more than 0, including duplicates.
`Bash
./bitcoind -dadir = 1 list transactions -s "*" | Sort
This displays a sorted output with deleted double transactions.
Method 2: Use the “-B” option
With the “-b” option you can determine the binary key file with transaction keys. By default, the “Listransacja” command uses the “Key” field as a sort key. Instead, you can use a binary key file by specifying it in this format:
`Bash
./bitcoind -dadir = 1 Listtransactions -b ścieżka/do/key.bin *
Replace the path/to/key.bin ‘in the real path to the binary key file.
Method 3: Use the option “-p”
With the “-p” option, you can determine the priority field, which determines the order of the sorting. If the priority is not determined, the output data are sorted according to “key”.
`Bash
./bitcoind -dadir = 1 Listtransactions -p "*" | Sort
It should be noted that this method only sorts transactions with a key value of a “priority” of more than 0.
Examples of use
Suppose you develop a simple intelligent Ethereum contract and want to test the transaction edition before it is implemented. You can use these methods to remove duplicates from the “Listransactions” issue:
`Bash
./bitcoind -dadir = 1 list transactions -s "*" | sort> transactions.log
This creates a new file called ‘transactions
Tips and variants
————————
- To remove double key from a certain transaction type (e.g. accounts or addresses), you can use additional sorting options such as “-k
for binary touch files”.
- If you want to work on a large data record and improve performance, you should use the “Sorting” option “with” Sort “such as” Sort format ” %K %V” Transactions.log “. in this case transaction names) sorted before they are displayed.