Visit the repo 👇


https://github.com/erensanlier/optimistic-etl

About the project


Private fork of Ethereum ETL for ingesting EVM-based Layer 2 data, including 
traces, contract creations, transactions, blocks, logs, $ERC20, $ERC721, $ERC1155 
contract creations, and transfers.

We have extended the capabilities of $EthereumETL so that it can parse $Geth
traces in L2s.

Additionally, we have made the required changes to cover RPC-endpoint differences 
between $OP and $Ethereum 👇

	<https://community.optimism.io/docs/developers/build/differences/>

Try out the demo


1. Clone the repo

git clone <https://github.com/erensanlier/optimistic-etl.git>

2. Install the requirements

pip3 install ethereum-etl[streaming]

3. Run Optimistic ETL (streams trace related data between blocks 500000 and 500010)

python3 [ethereumetl.py](<http://ethereumetl.py/>) stream --start-block 500000 --end-block 500010 -e trace,contract,erc20_token,erc721_token,erc1155_token --provider-uri [<https://mainnet.optimism.io>](<https://mainnet.optimism.io/>) -B 50

4. Example output (for block 500000)

[
	{"type": "block", "number": 500000, "hash": "0x6ddf28733cdbb9a631f38163759d09058c08a7b3f226edb1d57755e2ea4da55b", "parent_hash": "0xf58f346bfa6f294a867bb3785766cec704e842106b86bdfcd6fd348ec823cbce", "nonce": "0x0000000000000000", "sha3_uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347", "logs_bloom": "0x00000000000000000000000000000000000000200000000000000000008000000000000000000000000000000000000000000000000001000000000000000000100000000100000000000000002000000000000001000000000000000000000000000000000000000000000000000000400000000400000000000082100000000000001000000000000000000000000000000000000000000008000000000000000000001080000000000000000000000a00000000000000080000000002000000000000000000000000000000000088040000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000", "transactions_root": "0x3883294028d0f3714e1a1eb219d3faff098eca3b7bac86491c86484b32ce6eef", "state_root": "0xfe1eff01d1e9abe134c02fd5978040ace3e129cc11c6ea0e8f33f5988cb8ed60", "receipts_root": "0x70267fa9ecdf829859aea0a2b2424b4bc20b3a5ac9de0922b3595e76fb7fda40", "miner": "0x0000000000000000000000000000000000000000", "difficulty": 2, "total_difficulty": 1000001, "size": 786, "extra_data": "0xd98301090a846765746889676f312e31352e3133856c696e757800000000000054747954647dc380b5a098a813e0e7387ea7a3f3a860524fba981a859251228202501dfd7f7d4aa1e838d3d63ea2d08286376597aed3f47c990b5279bd59eaa801", "gas_limit": 15000000, "gas_used": 202813, "timestamp": 1637958868, "transaction_count": 1, "base_fee_per_gas": null, "item_id": "block_0x6ddf28733cdbb9a631f38163759d09058c08a7b3f226edb1d57755e2ea4da55b", "item_timestamp": "2021-11-26T20:34:28Z"}
	{"type": "transaction", "hash": "0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754", "nonce": 298153, "transaction_index": 0, "from_address": "0xa6c37c771d81ceb7dda952cc5625e06444067e2f", "to_address": "0x25e1c58040f27ecf20bbd4ca83a09290326896b3", "value": 0, "gas": 500000, "gas_price": 1000000, "input": "0x202ee0ed000000000000000000000000000000000000000000000000000000000000da950000000000000000000000000000000000000000000000000000005f7a401acc", "block_timestamp": 1637958868, "block_number": 500000, "block_hash": "0x6ddf28733cdbb9a631f38163759d09058c08a7b3f226edb1d57755e2ea4da55b", "max_fee_per_gas": null, "max_priority_fee_per_gas": null, "transaction_type": null, "l1_timestamp": 1637958868, "l1_block_number": 13691899, "l1_tx_origin": "sequencer", "receipt_cumulative_gas_used": 202813, "receipt_gas_used": 202813, "receipt_contract_address": null, "receipt_root": null, "receipt_status": 1, "receipt_effective_gas_price": null, "l1_gas_used": 4850, "l1_gas_price": 88620343851, "l1_fee_scalar": 1.5, "l1_fee": 644713001516025, "item_id": "transaction_0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754", "item_timestamp": "2021-11-26T20:34:28Z"}
	{"type": "log", "log_index": 0, "transaction_hash": "0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754", "transaction_index": 0, "address": "0x25e1c58040f27ecf20bbd4ca83a09290326896b3", "data": "0x0000000000000000000000000000000000000000000000000000000061a144d4", "topics": ["0x0109fc6f55cf40689f02fbaad7af7fe7bbac8a3d2186600afc7d3e10cac60271", "0x000000000000000000000000000000000000000000000000000000000000da95", "0x000000000000000000000000a6c37c771d81ceb7dda952cc5625e06444067e2f"], "block_number": 500000, "block_timestamp": 1637958868, "block_hash": "0x6ddf28733cdbb9a631f38163759d09058c08a7b3f226edb1d57755e2ea4da55b", "item_id": "log_0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754_0", "item_timestamp": "2021-11-26T20:34:28Z"}
	{"type": "log", "log_index": 1, "transaction_hash": "0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754", "transaction_index": 0, "address": "0x25e1c58040f27ecf20bbd4ca83a09290326896b3", "data": "0x", "topics": ["0x92e98423f8adac6e64d0608e519fd1cefb861498385c6dee70d58fc926ddc68c", "0x0000000000000000000000000000000000000000000000000000005f7a401acc", "0x000000000000000000000000000000000000000000000000000000000000da95", "0x000000000000000000000000a6c37c771d81ceb7dda952cc5625e06444067e2f"], "block_number": 500000, "block_timestamp": 1637958868, "block_hash": "0x6ddf28733cdbb9a631f38163759d09058c08a7b3f226edb1d57755e2ea4da55b", "item_id": "log_0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754_1", "item_timestamp": "2021-11-26T20:34:28Z"}
	{"type": "log", "log_index": 2, "transaction_hash": "0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754", "transaction_index": 0, "address": "0x25e1c58040f27ecf20bbd4ca83a09290326896b3", "data": "0x", "topics": ["0xfe25c73e3b9089fac37d55c4c7efcba6f04af04cebd2fc4d6d7dbb07e1e5234f", "0x000000000000000000000000000000000000000000000070df6c1313fe0c8000"], "block_number": 500000, "block_timestamp": 1637958868, "block_hash": "0x6ddf28733cdbb9a631f38163759d09058c08a7b3f226edb1d57755e2ea4da55b", "item_id": "log_0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754_2", "item_timestamp": "2021-11-26T20:34:28Z"}
	{"type": "trace", "transaction_index": 0, "from_address": "0xa6c37c771d81ceb7dda952cc5625e06444067e2f", "to_address": "0x25e1c58040f27ecf20bbd4ca83a09290326896b3", "value": 0, "input": "0x202ee0ed000000000000000000000000000000000000000000000000000000000000da950000000000000000000000000000000000000000000000000000005f7a401acc", "output": "0x", "trace_type": "call", "call_type": "call", "reward_type": null, "gas": 478596, "gas_used": 181409, "subtraces": 1, "trace_address": [], "error": null, "status": 1, "transaction_hash": "0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754", "block_number": 500000, "trace_id": "call_0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754_", "trace_index": 0, "block_timestamp": 1637958868, "block_hash": "0x6ddf28733cdbb9a631f38163759d09058c08a7b3f226edb1d57755e2ea4da55b", "item_id": "trace_call_0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754_", "item_timestamp": "2021-11-26T20:34:28Z"}
	{"type": "trace", "transaction_index": 0, "from_address": "0x25e1c58040f27ecf20bbd4ca83a09290326896b3", "to_address": "0x971dc14055cbc313a536f9ffd048e07530bd75df", "value": null, "input": "0x202ee0ed000000000000000000000000000000000000000000000000000000000000da950000000000000000000000000000000000000000000000000000005f7a401acc", "output": "0x", "trace_type": "call", "call_type": "delegatecall", "reward_type": null, "gas": 465693, "gas_used": 175859, "subtraces": 0, "trace_address": [0], "error": null, "status": 1, "transaction_hash": "0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754", "block_number": 500000, "trace_id": "call_0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754_0", "trace_index": 1, "block_timestamp": 1637958868, "block_hash": "0x6ddf28733cdbb9a631f38163759d09058c08a7b3f226edb1d57755e2ea4da55b", "item_id": "trace_call_0xea3212f0b43e936becccd8d9f3c0deaacd85298830e3a34196ba40959405f754_0", "item_timestamp": "2021-11-26T20:34:28Z"}
]