Class H2FullPrunedBlockStore

  • All Implemented Interfaces:
    UTXOProvider, BlockStore, FullPrunedBlockStore

    public class H2FullPrunedBlockStore
    extends DatabaseFullPrunedBlockStore
    A full pruned block store using the H2 pure-java embedded database. Note that because of the heavy delete load on the database, during IBD, you may see the database files grow quite large (around 1.5G). H2 automatically frees some space at shutdown, so close()ing the database decreases the space usage somewhat (to only around 1.3G).
    • Constructor Detail

      • H2FullPrunedBlockStore

        public H2FullPrunedBlockStore​(NetworkParameters params,
                                      java.lang.String dbName,
                                      java.lang.String username,
                                      java.lang.String password,
                                      int fullStoreDepth)
                               throws BlockStoreException
        Creates a new H2FullPrunedBlockStore, with given credentials for H2 database
        Parameters:
        params - A copy of the NetworkParameters used
        dbName - The path to the database on disk
        username - The username to use in the database
        password - The username's password to use in the database
        fullStoreDepth - The number of blocks of history stored in full (something like 1000 is pretty safe)
        Throws:
        BlockStoreException - if the database fails to open for any reason
      • H2FullPrunedBlockStore

        public H2FullPrunedBlockStore​(NetworkParameters params,
                                      java.lang.String dbName,
                                      int fullStoreDepth)
                               throws BlockStoreException
        Creates a new H2FullPrunedBlockStore
        Parameters:
        params - A copy of the NetworkParameters used
        dbName - The path to the database on disk
        fullStoreDepth - The number of blocks of history stored in full (something like 1000 is pretty safe)
        Throws:
        BlockStoreException - if the database fails to open for any reason
      • H2FullPrunedBlockStore

        public H2FullPrunedBlockStore​(NetworkParameters params,
                                      java.lang.String dbName,
                                      int fullStoreDepth,
                                      int cacheSize)
                               throws BlockStoreException
        Creates a new H2FullPrunedBlockStore with the given cache size
        Parameters:
        params - A copy of the NetworkParameters used
        dbName - The path to the database on disk
        fullStoreDepth - The number of blocks of history stored in full (something like 1000 is pretty safe)
        cacheSize - The number of kilobytes to dedicate to H2 Cache (the default value of 16MB (16384) is a safe bet to achieve good performance/cost when importing blocks from disk, past 32MB makes little sense, and below 4MB sees a sharp drop in performance)
        Throws:
        BlockStoreException - if the database fails to open for any reason