Skip to main content

Using an On-disk Transaction Pool

Each instance of Cardano Node uses a temporary, local storage area to store unconfirmed submitted transactions prior to validation and inclusion in a block on the chain. By default, Cardano Node stores pending transactions in memory.

Note
Note

In general, the storage area may be referred to as the mempool.

Continuing a committment to provide long-term support for smaller, less costly computers, Cardano Node includes functionality to store the pool of pending transactions on disk. While using an on-disk transaction pool significantly reduces memory requirements for Cardano Node, performance is slightly slower.

To enable Cardano Node to use an on-disk transaction pool:

  1. To stop the Cardano Node instance on the computer where you want to enable an on-disk transaction pool, type the following command using a terminal window:
    sudo systemctl stop cardano-node.service
  2. Using a text editor, open the $NODE_HOME/config*.json node configuration file.
  3. In the node configuration file, add or edit the following lines, where <DatabasePath> is the absolute path to the directory where you want Cardano Node to store the live transaction pool on disk:
    "LedgerDB": {
    "Backend": "V2LSM",
    "lsmDatabasePath": "<DatabasePath>",
    "QueryBatchSize": 100000,
    "FlushFrequency": 100,
    "Snapshots": {
    "NumOfDiskSnapshots": 2,
    "SlotOffset": 0,
    "SnapshotInterval": 86400
    }
    },
  4. Save and close the config*.json file.
  5. To create the directory where Cardano Node stores the live transaction pool, type:
    mkdir -p <DatabasePath>
  6. To back up and remove existing ledger snapshots from the copy of the blockchain residing on the local computer, type:
    cd $NODE_HOME
    mkdir ./ledger.bak
    mv ./db/ledger/* ./ledger.bak
  7. To restart the Cardano Node instance, type:
    sudo systemctl start cardano-node.service

Note
Note

Enabling an on-disk transaction pool may require replaying the copy of the blockchain ledger residing on the local computer.

For more details, see the High Level Overview of UTxO-HD.