Przeglądaj źródła

DEFINE USE_ABSTRACTMEM_BLOCKCHAIN_STORAGE

This will enable to use indexed data on Blockchain storage so will allow to quick search indexed by ophash, by block/operation and account history
unknown 3 lat temu
rodzic
commit
306a4cbcc8
3 zmienionych plików z 18 dodań i 0 usunięć
  1. 4 0
      src/config.inc
  2. 7 0
      src/core/upcdaemon.pas
  3. 7 0
      src/gui-classic/UFRMWallet.pas

+ 4 - 0
src/config.inc

@@ -74,6 +74,10 @@
   // This also fixes issue #207 High memory usage on FreePascal compiler
   {.$DEFINE USE_BIGBLOCKS_MEM_ON_DISK}
 
+  // This will enable to use indexed data on Blockchain storage so will allow to quick search
+  // indexed by ophash, by block/operation and account history
+  {$DEFINE USE_ABSTRACTMEM_BLOCKCHAIN_STORAGE}
+
 { ********************************************************************
   Don't touch more code, it will addapt based on your preferences
   ******************************************************************** }

+ 7 - 0
src/core/upcdaemon.pas

@@ -26,6 +26,9 @@ uses
   Classes, SysUtils, daemonapp,
   SyncObjs, UOpenSSL, UCrypto, UNode, UFileStorage, UFolderHelper, UWallet, UConst, ULog, UNetProtocol,
   IniFiles, UBaseTypes,
+  {$IFDEF USE_ABSTRACTMEM_BLOCKCHAIN_STORAGE}
+  UAbstractMemBlockchainStorage,
+  {$ENDIF}
   {$IF Defined(FPC) and Defined(WINDOWS)}windows,jwawinsvc,crt,{$ENDIF}
   UThread, URPC, UPoolMining, UAccounts, UPCDataTypes;
 
@@ -306,7 +309,11 @@ begin
       InitRPCServer;
       Try
         // Check Database
+        {$IFDEF USE_ABSTRACTMEM_BLOCKCHAIN_STORAGE}
+        FNode.Bank.StorageClass := TAbstractMemBlockchainStorageSecondary;
+        {$ELSE}
         FNode.Bank.StorageClass := TFileStorage;
+        {$ENDIF}
         // By default daemon will not download checkpoint except if specified on INI file
         TNetData.NetData.MinFutureBlocksToDownloadNewSafebox := FIniFile.ReadInteger(CT_INI_SECTION_GLOBAL,CT_INI_IDENT_MINPENDINGBLOCKSTODOWNLOADCHECKPOINT,0);
         TNetData.NetData.OnReceivedHelloMessage:=@OnNetDataReceivedHelloMessage;

+ 7 - 0
src/gui-classic/UFRMWallet.pas

@@ -324,6 +324,9 @@ Uses UFolderHelper,{$IFDEF USE_GNUGETTEXT}gnugettext,{$ENDIF}
   UOpenSSL,
 {$ENDIF}
   UTime, UFileStorage,
+  {$IFDEF USE_ABSTRACTMEM_BLOCKCHAIN_STORAGE}
+  UAbstractMemBlockchainStorage,
+  {$ENDIF}
   UThread, UOpTransaction, UFRMPascalCoinWalletConfig,
   UFRMOperationsExplorer,
   {$IFDEF TESTNET}
@@ -449,7 +452,11 @@ begin
     FRPCServer.ValidIPs := TSettings.JsonRpcAllowedIPs;
     WalletKeys.SafeBox := FNode.Bank.SafeBox;
     // Check Database
+    {$IFDEF USE_ABSTRACTMEM_BLOCKCHAIN_STORAGE}
+    FNode.Bank.StorageClass := TAbstractMemBlockchainStorageSecondary;
+    {$ELSE}
     FNode.Bank.StorageClass := TFileStorage;
+    {$ENDIF}
     FNode.Bank.Storage.Initialize;
     // Init Grid