Components
Core components
The following blockchain
, txdb
, txpool
are all interfaces, with built-in default implementations,
if developers have special needs, they can re-implement the interfaces themselves:
- blockchain: Chain structure, responsible for storing block data and organizing chain structure and fork logic.
- txdb: The database of
yu
, which stores the specific transaction data in all blocks,event
anderror
after the transaction is executed. - txpool: The transaction pool is responsible for validating and caching transactions sent from outside.
- state: Storage state, which stores the state after each transaction(Writing) is executed, such as account balance.
- tripod: The basic minimum unit that runs the blockchain and allows developers to customize logic.
Developers can customize multiple tripods and load their ordered combinations into
land
for the framework to call.
Low-level components
- store: The storage layer supports various forms of storage such as kv, sql, and fs, and they are all interfaces. Developers can specify the required storage engine (for example, kv currently has two storage engines,
badger
andboltdb
) Currently the storage instate
is implemented usingboltdb
, while the storage inblockchain
andtxdb
is implemented usingsqlite
. - p2p: A peer-to-peer transport network, used to discover nodes in the network and propagate transactions and blocks, etc.
- keypair: Asymmetric encryption algorithm for public and private keys, currently supports
sr25519
anded25519
. This component is in the form of an interface and can extend other encryption algorithms by itself.