1. 块组成
存档节点执行所有块并保留所有历史数据,包括:
- 区块
- 状态
- 交易收据
https://www.odaily.news/post/5175298
2. 删除块
bash
[root@eth_new snapeth]# tree -L 1 /data/coin/snapETH/geth
/data/coin/snapETH/geth
├── chaindata
|
ancient
├── ethash
├── jwtsecret
├── LOCK
├── nodekey
├── nodes
└── transactions.rlp
[root@eth_new snapeth]# tree -L 1 /data/coin/snapETH/geth
/data/coin/snapETH/geth
├── chaindata
|
ancient
├── ethash
├── jwtsecret
├── LOCK
├── nodekey
├── nodes
└── transactions.rlp
2.1 removedb
这种方式会 重新下载区块,但不会存储所有历史状态
geth removedb
#This is useful for deleting an old chain and sync’ing to a new one. It only affects data directories that can be re-created on synchronisation and does not touch the keystore
geth removedb
#This is useful for deleting an old chain and sync’ing to a new one. It only affects data directories that can be re-created on synchronisation and does not touch the keystore
2.2 rmdb
#删除chaindata即可,排除ancient
rsync --delete-before -d test/ hantest/
#删除chaindata即可,排除ancient
rsync --delete-before -d test/ hantest/
3. prune
https://geth.ethereum.org/docs/fundamentals/pruning
- 关闭主服务
bash
kill -15 pid
kill -15 pid
bash
geth snapshot prune-state
geth snapshot prune-state
这个方法会清理状态数据,但不会删除旧区块