Skip to content

Instantly share code, notes, and snippets.

View chimera-defi's full-sized avatar

Chimera chimera-defi

View GitHub Profile
@chimera-defi
chimera-defi / GethBEHAVE.md
Created August 10, 2022 21:59 — forked from yorickdowne/GethBEHAVE.md
Pruning Geth 1.10.x

Overview

Geth (Go-Ethereum) as of July 2022 takes about 650 GiB of space on a fast/snap sync, and then grows by ~ 14 GiB/week with default cache, ~ 8 GiB/week with more cache.

This will fill a 1TB SSD in a few months, to the point where space usage should be brought down again with an offline prune.

There is an odd behavior with Geth 1.10.20 where initial DB size is large after sync until Geth has been restarted twice. This is expected to be fixed soon, possibly as soon as 1.10.21.

Happily, Geth 1.10.x introduces "snapshot offline prune", which brings it back down to about its original size. It takes roughly 4-6 hours to prune the Geth database, and this has to be done while Geth is not running.

Caveat that while several folx have used offline pruning successfully, there is risk associated with it. The two failure mode

@chimera-defi
chimera-defi / nft_owners.py
Created November 1, 2021 18:31 — forked from zhongfu/nft_owners.py
dumps a csv of owners of an nft collection (with sequential ids), and how many nfts they own
#!/usr/bin/env python3.8
import brownie
from brownie import Contract
import csv
def main():
brownie.network.connect('mainnet')
# lobsterdao, or plop your contract addr here
nft_contract = Contract('0x026224a2940bfe258d0dbe947919b62fe321f042')