Skip to content

Commit

Permalink
some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
metachris committed Sep 4, 2023
1 parent 707eeba commit 6d7d924
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 19 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export BLX_AUTH_HEADER=""
export CLOUDFLARE_R2_ACCOUNT_ID=""
export CLOUDFLARE_R2_ACCOUNT_ID=""
export SRC_ALIASES="local=ws://localhost:8546" # comma-separated list of alias=url
26 changes: 17 additions & 9 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

Dump mempool transactions from EL nodes, and archive them in [Parquet](https://github.com/apache/parquet-format) and CSV format.

**The data is freely available at https://mempool-dumpster.flashbots.net**

Output files:

1. Raw transactions CSV (`timestamp_ms, tx_hash, rlp_hex`; about 800MB/day zipped)
Expand Down Expand Up @@ -34,6 +36,12 @@ Notes:

---

# FAQ

- What is a-pool? A-Pool is a regular geth node with some optimized peering settings, subscribed to over the network.

---

# Getting started

## Mempool Collector
Expand All @@ -42,7 +50,7 @@ Notes:
1. EL nodes via websocket (local (i.e. geth) or remote (i.e. Infura))
1. Can also connect to [bloXroute (need "Professional" plan or above)](https://docs.bloxroute.com/streams/newtxs-and-pendingtxs)
1. Writes `timestamp` + `hash` + `rawTx` to CSV file (one file per hour [by default](collector/consts.go))
1. Note: the collector can store transactions repeatedly, and only the summarizer will properly deduplicate them later
1. Note: the collector can store transactions repeatedly, and only the merger will properly deduplicate them later

**Default filenames:**

Expand Down Expand Up @@ -73,7 +81,7 @@ go run cmd/collector/main.go -out ./out -nodes ws://server1.com:8546,ws://server
- Deduplicates transactions, sorts them by timestamp

```bash
go run cmd/summarizer/main.go -h
go run cmd/merge/main.go -h
```


Expand All @@ -87,13 +95,13 @@ go run cmd/summarizer/main.go -h
- Vendor-agnostic (main flow should work on any server, independent of a cloud provider)
- Downtime-resilience to minimize any gaps in the archive
- Multiple collector instances can run concurrently, without getting into each others way
- Summarizer script produces the final archive (based on the input of multiple collector outputs)
- Merger produces the final archive (based on the input of multiple collector outputs)
- The final archive:
- Includes (1) parquet file with transaction metadata, and (2) compressed file of raw transaction CSV files
- Compatible with [Clickhouse](https://clickhouse.com/docs/en/integrations/s3) and [S3 Select](https://docs.aws.amazon.com/AmazonS3/latest/userguide/selecting-content-from-objects.html) (Parquet using gzip compression)
- Easily distributable as torrent

## Mempool Collector
## Collector

- `NodeConnection`
- One for each EL connection
Expand All @@ -102,7 +110,7 @@ go run cmd/summarizer/main.go -h
- Check if it already processed that tx
- Store it in the output directory

## Summarizer
## Merger

- Uses https://github.com/xitongsys/parquet-go to write Parquet format

Expand All @@ -115,7 +123,7 @@ go run cmd/summarizer/main.go -h

---

## Contributing
# Contributing

Install dependencies

Expand All @@ -136,19 +144,19 @@ make fmt

---

## Further notes
# Further notes

- See also: [discussion about compression](https://github.com/flashbots/mempool-dumpster/issues/2) and [storage](https://github.com/flashbots/mempool-dumpster/issues/1)

---

## License
# License

MIT

---

## Maintainers
# Maintainers

- [metachris](https://twitter.com/metachris)
- [0x416e746f6e](https://github.com/0x416e746f6e)
19 changes: 12 additions & 7 deletions website/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,26 @@
<link rel="manifest" href="/static/favicon/site.webmanifest">

<!-- HTML Meta Tags -->
<title>Mempool Dumpster</title>
<meta name="description" content="Mempool Archive">
<title>Mempool Dumpster 🗑️♻️</title>
<meta name="description" content="Free archive of mempool transactions, brought to you by ⚡️🤖">

<style>
body {
background-color: white;
font-size: large;
}

.header {
margin: 4em 6em;
margin: 4em 4em;
margin-bottom: 2em;
}

.content {
margin: 2em 6em;
margin: 2em 4em;
}

td.fn {
min-width: 320px;
/* min-width: 320px; */
}

td.fs {
Expand All @@ -46,6 +47,10 @@
tr:hover {
background: #f7faff;
}

ul.root-months li {
padding: 0.3em 0em;
}
</style>
<script type="text/javascript">
if (window.location.host.indexOf("r2.dev") > -1) {
Expand All @@ -59,11 +64,11 @@
<a href="https://collective.flashbots.net/">
<img style="float:right; background:white; margin-left: 64px; width: 100px; height: 100px;" src="https://d33wubrfki0l68.cloudfront.net/ae8530415158fbbbbe17fb033855452f792606c7/fe19f/img/logo.png">
</a>
<h1>Mempool Dumpster</h1>
<h1>Mempool Dumpster 🗑️♻️</h1>
<p>
<a href="https://github.com/flashbots/mempool-dumpster">https://github.com/flashbots/mempool-dumpster</a>
</p>
<p>Illuminate, Democratize, Distribute ⚡️🤖</p>
<p><i>Illuminate, Democratize, Distribute</i></p>
</div>
<div class="content">
{{ template "content" . }}
Expand Down
4 changes: 2 additions & 2 deletions website/templates/index_root.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

<hr>
<br>
Ethereum Mainnet
<ul>
<h2>Ethereum Mainnet</h2>
<ul class="root-months">
{{ range .EthMainnetMonths }}
<li><a href="/ethereum/mainnet/{{ . }}/index.html">{{ . }}</a></li>
{{ end }}
Expand Down
1 change: 1 addition & 0 deletions website/webserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (srv *Webserver) getRouter() http.Handler {
r := mux.NewRouter()
r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir("./website/static"))))

r.HandleFunc("/", srv.handleRoot).Methods(http.MethodGet)
r.HandleFunc("/index.html", srv.handleRoot).Methods(http.MethodGet)
r.HandleFunc("/ethereum/mainnet/{month}/index.html", srv.handleMonth).Methods(http.MethodGet)

Expand Down

0 comments on commit 6d7d924

Please sign in to comment.