<p>Bitcoin JSON RPC has <code>savemempool</code> command for saving mempool data to the disk. However, it seems like saved file is binary. How can I read this file in human readable format?</p>
<p><a href="https://developer.bitcoin.org/reference/rpc/savemempool.html" rel="nofollow noreferrer">https://developer.bitcoin.org/reference/rpc/savemempool.html</a></p>

CC BY-SA 4.0
2023-03-30T14:44:05.710Z
Does this answer your question? [DumpMempool() and LoadMempool() in src/validation.cpp](https://bitcoin.stackexchange.com/questions/99602/dumpmempool-and-loadmempool-in-src-validation-cpp)
Vojtěch Strnad
CC BY-SA 4.0
2023-03-30T15:24:35.490Z
You can also check how this is implemented in  https://github.com/bitcoin/bitcoin/blob/master/src/kernel/mempool_persist.cpp written in C++, where DumpMempool() function is responsible for dumping the contents of a transaction mempool to a file and LoadMempool() function is responsible for loading the contents of the mempool from a specified file on disk. To read the transactions, you would need to create a similar LoadMempool function in your chosen programming language and parse the structured objects: uint64_t version ... up to unbroadcast_txids.
deyw
CC BY-SA 4.0
2023-03-30T19:08:30.437Z
Is there any Python code that can read mempool.data file?
xor
<bitcoin-core>
Bitcoin core savemempool
xor
# Bitcoin core savemempool

(Asked by: username_0 on 2023-03-30)

Bitcoin JSON RPC has `savemempool` command for saving mempool data to the disk. However, it seems like saved file is binary. How can I read this file in human readable format?

<https://developer.bitcoin.org/reference/rpc/savemempool.html>

**Tags:** bitcoin-core

> **Comments:**
> **username_1**: Does this answer your question? [DumpMempool() and LoadMempool() in src/validation.cpp](https://bitcoin.stackexchange.com/questions/99602/dumpmempool-and-loadmempool-in-src-validation-cpp)  
> **username_2**: You can also check how this is implemented in  https://github.com/bitcoin/bitcoin/blob/master/src/kernel/mempool_persist.cpp written in C++, where DumpMempool() function is responsible for dumping the contents of a transaction mempool to a file and LoadMempool() function is responsible for loading the contents of the mempool from a specified file on disk. To read the transactions, you would need to create a similar LoadMempool function in your chosen programming language and parse the structured objects: uint64_t version ... up to unbroadcast_txids.  
> **username_0**: Is there any Python code that can read mempool.data file?  

---

## 0 answers

