I want to get all the node IP addresses of ETH, so I need to parse the geth/nodes directory, but I can't find the specific data format and cannot parse it.
I found a same problem, but there is no solution: Format of LevelDB files in nodes directory? Trouble pulling contents with python leveldb API
import leveldb import rlp db = leveldb.LevelDB("../nodes") for k in db.RangeIter(): print(k) print(rlp.decode(k)) break
(bytearray(b'local:\xc6\x83\x00\xb8LX\xcc+\xcd\x98CDd\x96\x89R\x92\x1a\xaeV\xe1\x93\xfeV\x95)\t~$e\xfa|:seq'), bytearray(b'\x97\x08')) Traceback (most recent call last): File "temp.py", line 7, in <module> print(rlp.decode(k)) File "PATH/.local/lib/python3.6/site-packages/rlp/codec.py", line 235, in decode raise DecodingError(msg, rlp) rlp.exceptions.DecodingError: RLP string ends with 41 superfluous bytes
I searched a lot of information and found that rlp.sedes needs to be specified when decoding. I can't determine which kind of sedes it is. I am a newcomer to ETH and I need help. Examples of parsing in other programming languages are also available.