You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+97-36
Original file line number
Diff line number
Diff line change
@@ -4,50 +4,111 @@ This application extracts transactions from the Ethereum blockchain and exports
4
4
5
5
## Run
6
6
* You'll need an Ethereum node in order to execute API requests. If you don't have your own net yet, then you can start a local Ethereum node as a Docker container with this command:
:warning: It might take some time, until your Ethereum node synchronized enough blocks to respond to API requests for those blocks. You can also set the flag `--start` to `0`. But, keep in mind that about the first 46.000 blocks of the Ethereum blockchain contain any transactions.
24
+
# create directory for log and CSV files
25
+
mkdir ./output/
26
+
27
+
docker run \
28
+
--network host \
29
+
-v $(pwd)/output:/output \
30
+
-e LOGXI="*" \
31
+
-e START_BLOCK_HEIGHT="46147" \
32
+
-e BLOCK_COUNT="10" \
33
+
ethereum-blockchain-transaction-csv-export
34
+
```
35
+
36
+
This demo should fetch the blocks 46147 through 46157. These blocks contain only one transaction, the first transaction that was ever made on the Ethereum blockchain.
37
+
38
+
* The resulting CSV export is stored in the file `./output/geth_tx_export_<yyyy-MM-dd-HH-mm-ss>.csv`. The CSV file contains the following columns:
| tx_nonce | The number of transactions made by the sender prior to this one. |
44
+
| tx_block_hash | 32 Bytes hash of the block where this transaction was in. |
45
+
| tx_block_number | Block number where this transaction was in. `null` when its pending. |
46
+
| tx_index | Integer of the transaction's index position in the block. `null` when its pending. |
47
+
| tx_from | 20 Bytes address of the sender |
48
+
| tx_to | 20 Bytes address of the receiver. `null` when its a contract creation transaction. |
49
+
| tx_value | Value transferred in Wei. |
50
+
| tx_gas | Gas provided by the sender. |
51
+
| tx_gas_price | Gas price provided by the sender in Wei. |
52
+
| tx_input | The data send along with the transaction. |
53
+
| tx_timestamp | Integer of the unix timestamp when the transaction was sent. |
54
+
55
+
56
+
:warning: It might take some time, until your Ethereum node synchronized enough blocks to respond to API requests for those blocks. You can also set the environment variable `START_BLOCK_HEIGHT` to `0`. But, keep in mind that about the first 46.000 blocks of the Ethereum blockchain don't contain any transactions.
21
57
22
58
**Another example:**
23
59
24
-
This command exports all transactions contained in the first 4 million blocks (estimated time to completion: 11 hours):
60
+
This command exports all transactions contained in the first 4 million blocks (this process might take several hours):
0 commit comments