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 and error 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 and boltdb) Currently the storage in state is implemented using boltdb, while the storage in blockchain and txdb is implemented using sqlite.
  • 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 and ed25519. This component is in the form of an interface and can extend other encryption algorithms by itself.

image