go-blockchain, v1.4-alpha.2
Posted on

The library that implements models and algorithms of blockchain.
Add a search of a block index and fix the bug with sorting in the storages.MemoryStorage structure.
Change Log
- models:
- block group:
- operations:
- search of a block index:
- based on the binary search algorithm;
- search of a block index:
- operations:
- block group:
- fix the bug with sorting in the
storages.MemoryStoragestructure:- fix the
storages.MemoryStorage.sortIfNeed()method; - fix the
storages.MemoryStorage.DeleteBlock()method; - fix the unit tests:
- of the
storages.MemoryStorage.LoadBlocks()method; - of the
storages.MemoryStorage.LoadLastBlock()method; - of the
storages.MemoryStorage.StoreBlock()method; - of the
storages.MemoryStorage.DeleteBlock()method.
- of the
- fix the
Features
- models:
- block data:
- operations:
- conversion to a string;
- comparison for equality with another block data;
- wrappers:
- wrapper that adds support for the following operations to those block data that cannot do them:
- conversion to a string:
- implementation of the
fmt.Stringerinterface; - implementation of the
encoding.TextMarshalerinterface;
- implementation of the
- comparison for equality with another block data;
- conversion to a string:
- wrapper that adds support for the following operations to those block data that cannot do them:
- operations:
- block:
- storing:
- timestamp;
- block data;
- hash;
- previous hash;
- operations:
- creation (using a proofer);
- getting merged data;
- comparison for equality with another block;
- self-validation (using a proofer);
- storing:
- genesis block:
- based on a usual block without a previous hash;
- block group:
- storing:
- group of blocks;
- operations:
- self-validation (using a proofer):
- modes:
- as a full blockchain;
- as a blockchain chunk;
- takes into account a prepended chunk;
- allows empty block groups;
- modes:
- validation of the last block (using a proofer):
- modes:
- as a full blockchain;
- as a blockchain chunk;
- modes:
- search of a block index:
- based on the binary search algorithm;
- self-validation (using a proofer):
- storing:
- block group loaders:
- loading block groups via the external interface;
- automatically saving the loaded block groups to a storage;
- wrappers:
- chunk validating loader:
- automatically validates the loaded block group as a blockchain chunk;
- last block validating loader:
- automatically validates the last block from the loaded block group;
- automatically preloads the next block group to perform the above validation;
- memoizing loader:
- remembers loaded block groups;
- restricts the quantity of the remembered block groups:
- stores the loaded block groups in the LRU cache;
- chunk validating loader:
- kinds:
- memory loader:
- loading blocks from the block group;
- memory loader:
- blockchain:
- storing:
- storage;
- last block;
- operations:
- creation:
- loading the last block from the storage;
- when the storage is empty (optional):
- creation a genesis block using a proofer;
- storing the genesis block to the storage;
- loading block groups from the storage;
- adding a block:
- creation a block using a proofer;
- storing the block to the storage;
- creation:
- storing:
- block data:
- proofers:
- operations:
- block hashing;
- block validation;
- kinds:
- proof of work:
- based on the Hashcash algorithm;
- additional storing in a block (in a hash actually):
- nonce;
- target bit;
- proof of work:
- operations:
- storages:
- operations:
- loading block groups;
- loading the last block;
- storing a block;
- storing a block group (optional);
- deleting a block;
- deleting a block group (optional);
- wrappers:
- wrapper that adds support for the following operations to those storages that cannot do them:
- storing a block group;
- deleting a block group;
- wrapper that adds support for the following operations to those storages that cannot do them:
- kinds:
- memory storage:
- storing blocks in memory.
- memory storage:
- operations:
Repository
Link: https://github.com/thewizardplusplus/go-blockchain/tree/v1.4-alpha.2.
Content: code.
License: MIT.