Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nounder/daimo-tx-latency


https://github.com/nounder/daimo-tx-latency

Last synced: 6 days ago
JSON representation

Awesome Lists containing this project

README

        

Measure latency from broadcasting a transaction to its inclusion in a block:

```
(broadcast tx) -> (first appeareance of a block) -> (block timestamp)
```

Transaction is sent directly with `eth_sendRawTransaction` RPC call. All related
calls necessary to make a transaction (gas, block number, nonce) were done
outside of timing window for higher measurement accuracy.

# Configure

```sh
# setup dotenv file
cp .env.example .env

# edit the config according to comments inside
vim .env
```

Make sure you have `deno` and `duckdb` installed

# Usage

```sh
# start broadcasting and tracking transactions
deno run -A main.ts | tee /dev/tty | rg -r '' '\t' > out/events.jsonl

# dump stats
duckdb < events.sql
```