Unit Noso.Summary
Description
This item has no description.
Uses
- Classes
- Noso.Crypto
- Noso.Debug
- Noso.General
- SysUtils
- Zipper
Overview
Classes, Interfaces, Objects and Records
| Name | Description |
|---|---|
Record TBlockRecord |
Holds information about a block, including its disk position and associated summary data. |
Packed Record TOrderGroup |
Manages the details of an order within the system. |
Packed Record TSummaryData |
Holds the data for each address' summary |
Functions and Procedures
function ComputeSummaryHash: String; |
procedure CreateNewSummaryFile(AddBlockZero: Boolean); |
function CreateProtocolOrder(BlockNumber: Integer; OrderType, Sender, Receiver, Signature: String; TimeStamp, Amount: Int64): TOrderData; |
function CreateSummaryBackup(): Boolean; |
function CreateSummaryIndex(): Int64; |
procedure CreditTo(Address: String; Amount, BlockNumber: Int64); |
function FindSummaryIndexPosition(Text: String; out RecordData: TSummaryData; IsAlias: Boolean = False): Int64; |
function GetAddressAlias(Address: String): String; |
function GetAddressBalanceIndexed(Address: String): Int64; |
function GetAddressLastOperation(Address: String): Int64; |
function GetSummaryAsMemoryStream(out Stream: TMemoryStream): Int64; |
function GetZipSummaryAsMemoryStream(out Stream: TMemoryStream): Int64; |
function IsCustomizationValid(Address, Custom: String; BlockNumber: Int64; ForceCustom: Boolean = False): Boolean; |
function IsSummaryValidPayment(Address: String; Amount, BlockNumber: Int64): Boolean; |
procedure ProcessSummaryPayment(Address: String; Amount, BlockNumber: Int64); |
procedure ResetBlockRecords(); |
function RestoreSummaryBackup(): Boolean; |
function SaveSummaryToFile(Stream: TMemoryStream): Int64; |
procedure SetSummaryHash(); |
function SummaryIndexLength(): Int64; |
procedure UpdateSummaryChanges(); |
function ZipSummary(): Boolean; |
Types
TIndexRecord = array of Integer; |
Variables
SummaryFileName: String = 'NOSODATA' + DirectorySeparator + 'sumary.psk'; |
SummaryHashValue: String = ''; |
SummaryLastOperation: Int64; |
WorkingDirectory: String = ''; |
ZipSummaryFileName: String = 'NOSODATA' + DirectorySeparator + 'sumary.zip'; |
Description
Functions and Procedures
function ComputeSummaryHash: String; |
|
Retrieves the current hash value of the summary file. ReturnsThe hash value as a string. |
procedure CreateNewSummaryFile(AddBlockZero: Boolean); |
|
Initializes a new summary file on disk. Parameters
|
function CreateProtocolOrder(BlockNumber: Integer; OrderType, Sender, Receiver, Signature: String; TimeStamp, Amount: Int64): TOrderData; |
|
Initializes a new order with the specified parameters.
Parameters
ReturnsA TOrderData structure containing the initialized order information. |
function CreateSummaryBackup(): Boolean; |
|
Creates a backup of the current summary file. Returns
|
function CreateSummaryIndex(): Int64; |
|
Creates the summary index from the disk summary file. ReturnsThe time taken to create the summary index in milliseconds. |
procedure CreditTo(Address: String; Amount, BlockNumber: Int64); |
|
Credits a specified amount to a specific address, updating its balance. Parameters
|
function FindSummaryIndexPosition(Text: String; out RecordData: TSummaryData; IsAlias: Boolean = False): Int64; |
|
Searches for a summary record in the index based on the provided text. Parameters
ReturnsThe index position of the found record, or -1 if not found. |
function GetAddressAlias(Address: String): String; |
|
Retrieves the custom alias for a specified address, if it exists.
Parameters
ReturnsThe custom alias associated with the address, or an empty string if none exists. |
function GetAddressBalanceIndexed(Address: String): Int64; |
|
Retrieves the balance of a specific address from the summary index. Parameters
ReturnsThe balance of the specified address, or 0 if not found. |
function GetAddressLastOperation(Address: String): Int64; |
|
Retrieves the last operation block number associated with a specified address.
Returns the address last operation block Parameters
ReturnsThe block number of the last operation, or 0 if not found. |
function GetSummaryAsMemoryStream(out Stream: TMemoryStream): Int64; |
|
Loads the summary file into a memory stream.
Parameters
ReturnsThe size of the summary data loaded into the stream. |
function GetZipSummaryAsMemoryStream(out Stream: TMemoryStream): Int64; |
|
Loads the zipped summary file into a memory stream. Parameters
ReturnsThe size of the zipped summary data loaded into the stream. |
function IsCustomizationValid(Address, Custom: String; BlockNumber: Int64; ForceCustom: Boolean = False): Boolean; |
|
Checks if an address can customize its alias based on current balance and conditions. Parameters
Returns
|
function IsSummaryValidPayment(Address: String; Amount, BlockNumber: Int64): Boolean; |
|
Verifies if a sender address has enough funds for a specified payment amount. Parameters
Returns
|
procedure ProcessSummaryPayment(Address: String; Amount, BlockNumber: Int64); |
|
Processes a payment for a specified address, updating its balance.
Parameters
|
procedure ResetBlockRecords(); |
|
Resets the block records by clearing the block records array. |
function RestoreSummaryBackup(): Boolean; |
|
Restores the summary file from a backup. Returns
|
function SaveSummaryToFile(Stream: TMemoryStream): Int64; |
|
Saves the content of a memory stream to a specified file. Parameters
ReturnsThe size of the stream. |
procedure SetSummaryHash(); |
|
Calculates and sets the hash value for the summary file. |
function SummaryIndexLength(): Int64; |
|
Returns the length of the summary index. ReturnsThe length of the summary index. |
procedure UpdateSummaryChanges(); |
|
Processes and writes changes made to the summary in memory to the disk. |
function ZipSummary(): Boolean; |
|
Compresses the current summary file into a ZIP archive.
Must be replaced with new stream compression methods Returns
|
Types
TIndexRecord = array of Integer; |
|
This item has no description. |
Variables
SummaryFileName: String = 'NOSODATA' + DirectorySeparator + 'sumary.psk'; |
|
The file name for the summary data, located in the 'NOSODATA' directory. |
SummaryHashValue: String = ''; |
|
The MD5 hash value of the summary file for integrity checks. |
SummaryLastOperation: Int64; |
|
Holds the block number of the last operation performed on the summary data. |
WorkingDirectory: String = ''; |
|
The current working directory for the application. |
ZipSummaryFileName: String = 'NOSODATA' + DirectorySeparator + 'sumary.zip'; |
|
The file name for the zipped summary data, located in the 'NOSODATA' directory. |
Generated by PasDoc 0.16.0-snapshot.