The BaseModule represents Lisk modules by providing a generic interface, from which each module extends from.

Hierarchy

Constructors

Properties

_feeMethod: FeeMethod
_moduleConfig: ModuleConfig
_randomMethod: RandomMethod
_registerAuthorityCommand: RegisterAuthorityCommand = ...
_updateAuthorityCommand: UpdateAuthorityCommand = ...
_updateGeneratorKeyCommand: UpdateGeneratorKeyCommand = ...
_validatorsMethod: ValidatorsMethod
commands: (RegisterAuthorityCommand | UpdateAuthorityCommand | UpdateGeneratorKeyCommand)[] = ...

A command is a group of state-transition logic triggered by a transaction and is identified by the module and command name of the transaction.

endpoint: PoAEndpoint = ...

An endpoint is an interface between a module and an external system. Lisk endpoints support RPC communication. The module-specific RPC endpoints can be invoked by external services, like UIs, to get relevant data from the application.

Endpoints allow us to conveniently get data from the blockchain. It is never possible to set data / mutate the state via module endpoints.

events: NamedRegistry = ...

Blockchain events, or module events, are logs of events that occur in the blockchain network during block execution. Events occur per block, and are stored in the respective block header, from where they can be queried.

method: PoAMethod = ...

A method is an interface for module-to-module communication, and can perform state mutations on the blockchain.

To get or set module-specific data in the blockchain, methods are either called by other modules or by the module itself. For example, the transfer() method from the Token module is called by a module, if it needs to transfer tokens from one account to the other.

offchainStores: NamedRegistry = ...

In a module, the off-chain store is available in: insertAssets & Endpoints.

It complements the on-chain module store, by allowing to store various additional data in the blockchain client, that does not need to be included in the on-chain store.

The data stored in the off-chain store is not part of the blockchain protocol, and it may differ from machine to machine.

stores: NamedRegistry = ...

A module can define one or multiple on-chain stores, to store data in the blockchain, i.e. to include it in the blockchain state.

For example, data such as account balances, validator’s names, and multisignature keys are values that are stored in the on-chain module store.

Accessors

  • get name(): string
  • The module name is the unique identifier for the module.

    The module name is automatically calculated from the class name of the module: The Module suffix of the class name is removed, and the first character is converted to lowercase.

    Returns string

Methods

  • Parameters

    • validatorsMethod: ValidatorsMethod
    • feeMethod: FeeMethod
    • randomMethod: RandomMethod

    Returns void

  • Returns {
        assets: never[];
        commands: {
            name: string;
            params: Schema;
        }[];
        endpoints: never[];
        events: {
            data: Schema;
            name: string;
        }[];
        stores: {
            data: Schema;
            key: string;
        }[];
    }

    • assets: never[]
    • commands: {
          name: string;
          params: Schema;
      }[]
    • endpoints: never[]
    • events: {
          data: Schema;
          name: string;
      }[]
    • stores: {
          data: Schema;
          key: string;
      }[]
  • If a module needs to access certain configuration options, it is required to validate and cache the respective configurations in the init() method of a module.

    The init() function is called for every registered module once, when the client is started.

    Parameters

    Returns Promise<void>

Generated using TypeDoc