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
We want to migrate this crate into a direction
where we provide out-of-the-box all of the
ways in which a header and / or block could
be analyzed. The user can then switch these
analyses on or off. For this functionality,
we don't need the overkill flexibility of
trait objects.
The goal is to provide a much more authoritative
block analysis tool, closer to an enhanced block
explorer than the ad-hoc analyses implemented before.
[10:29:19] INFO - parser: Done. Processed 639626 blocks in 266.43 minutes. (avg: 40 blocks/sec)
69
-
[10:32:01] INFO - callback: Done.
70
-
Dumped all 639626 blocks:
71
-
-> transactions: 549390991
72
-
-> inputs: 1347165535
73
-
-> outputs: 1359449320
74
-
[10:32:01] INFO - main: Fin.
75
-
```
76
44
77
45
78
46
## Installing
@@ -108,63 +76,6 @@ It is important to build with `--release`, otherwise you will get a horrible per
108
76
Bitcoin and Bitcoin Testnet transactions are parsed using [rust-bitcoin](https://github.com/rust-bitcoin/rust-bitcoin),
109
77
this includes transactions of type P2SH, P2PKH, P2PK, P2WSH, P2WPKH, P2TR, OP_RETURN and SegWit.
110
78
111
-
112
-
## Memory Usage
113
-
The required memory usage depends on the used callback:
114
-
115
-
* simplestats: ~100MB
116
-
* unspentcsvdump: ~18GB
117
-
* balances: ~18GB
118
-
119
-
NOTE: Those values are taken from parsing to block height 639631 (17.07.2020).
120
-
121
-
## Callbacks
122
-
123
-
Callbacks are built on top of the core parser. They can be implemented to extract specific types of information.
124
-
125
-
*`balances`: dumps all addresses with a non-zero balance.
126
-
The csv file is in the following format:
127
-
```
128
-
balances.csv
129
-
address ; balance
130
-
```
131
-
132
-
* `unspentcsvdump`: dumps all UTXOs along with the address balance.
133
-
The csv file is in the following format:
134
-
```
135
-
unspent.csv
136
-
txid ; indexOut ; height ; value ; address
137
-
```
138
-
NOTE: The total size of the csv dump is at least 8 GiB (height 635000).
139
-
140
-
* `opreturn`: shows transactions with embedded OP_RETURN data that is representable as UTF8.
141
-
142
-
See [Usage](#Usage) for an example. I chose CSV dumps instead of an active db-connection because `LOAD DATA INFILE` is the most performant way for bulk inserts.
If unclear what some of these fields are, see the [block](https://en.bitcoin.it/wiki/Protocol_documentation#block) and [transaction](https://en.bitcoin.it/wiki/Protocol_documentation#tx) specifications.
161
-
162
-
163
-
* `simplestats`: prints some blockchain statistics like block count, transaction count, avg transactions per block, largest transaction, transaction types etc.
164
-
165
-
You can also define custom callbacks. A callback gets called at startup, on each block and at the end. See [src/callbacks/mod.rs](src/callbacks/mod.rs) for more information.
166
-
167
-
168
79
## Contributing
169
80
170
81
Use the issue tracker to report problems, suggestions and questions. You may also contribute by submitting pull requests.
0 commit comments