framework

package
v0.0.0-...-77dcbbd Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 2, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package framework provides interface to build blockchain client with modular architecture.

Index

Constants

This section is empty.

Variables

View Source
var (
	StateDBPrefixState     []byte = []byte{0}
	StateDBPrefixTree      []byte = []byte{1}
	StateDBPrefixDiff      []byte = []byte{2}
	StateDBPrefixTreeState []byte = []byte{3}
)
View Source
var (
	GeneratorDBPrefix []byte = []byte{0}
)

Functions

This section is empty.

Types

type ABIHandler

type ABIHandler struct {
	// contains filtered or unexported fields
}

func NewABIHandler

func NewABIHandler(
	ctx context.Context,
	config *config.ApplicationConfig,
	logger log.Logger,
	stateMachine *statemachine.Executer,
	genesisBlock *blockchain.Block,
	stateDB *db.DB,
	moduleDB *db.DB,
	modules []Module,
) *ABIHandler

func (*ABIHandler) Clear

func (a *ABIHandler) Clear(req *labi.ClearRequest) (*labi.ClearResponse, error)

func (*ABIHandler) Commit

func (a *ABIHandler) Commit(req *labi.CommitRequest) (*labi.CommitResponse, error)

func (*ABIHandler) ExecuteTransaction

func (*ABIHandler) Finalize

func (a *ABIHandler) Finalize(req *labi.FinalizeRequest) (*labi.FinalizeResponse, error)

func (*ABIHandler) GetMetadata

func (a *ABIHandler) GetMetadata(req *labi.MetadataRequest) (*labi.MetadataResponse, error)

func (*ABIHandler) Init

func (a *ABIHandler) Init(req *labi.InitRequest) (*labi.InitResponse, error)

func (*ABIHandler) InitGenesisState

func (*ABIHandler) InitStateMachine

func (*ABIHandler) InsertAssets

func (*ABIHandler) Prove

func (a *ABIHandler) Prove(req *labi.ProveRequest) (*labi.ProveResponse, error)

func (*ABIHandler) Query

func (a *ABIHandler) Query(req *labi.QueryRequest) (*labi.QueryResponse, error)

func (*ABIHandler) Revert

func (a *ABIHandler) Revert(req *labi.RevertRequest) (*labi.RevertResponse, error)

func (*ABIHandler) VerifyAssets

func (*ABIHandler) VerifyTransaction

type Application

type Application struct {
	// contains filtered or unexported fields
}

func NewApplication

func NewApplication(cfg *config.ApplicationConfig) *Application

func (*Application) GenerateGenesisBlock

func (app *Application) GenerateGenesisBlock(height, timestamp uint32, previoudBlockID codec.Hex, assets blockchain.BlockAssets) (*blockchain.Block, error)

func (*Application) RegisterModule

func (app *Application) RegisterModule(module Module) error

func (*Application) RegisterPlugin

func (app *Application) RegisterPlugin(plugin Plugin) error

func (*Application) RegisteredModules

func (app *Application) RegisteredModules() []string

func (*Application) RegisteredPlugins

func (app *Application) RegisteredPlugins() []string

func (*Application) Start

func (app *Application) Start() error

func (*Application) Stop

func (app *Application) Stop() error

type Module

type Module interface {
	statemachine.Module
	Endpoint() statemachine.Endpoint
	Init(cfg []byte) error
}

type Plugin

type Plugin interface {
	Endpoint() statemachine.Endpoint
	Name() string
	Init(cfg *PluginConfig) error
	Start()
	Stop()
}

type PluginChannel

type PluginChannel interface {
	Invoke(ctx context.Context, method string, data codec.EncodeDecodable) rpc.EndpointResponse
	Subscribe(event string) chan rpc.EventContent
	Publish(event string, data codec.EncodeDecodable) error
}

type PluginConfig

type PluginConfig struct {
	Context  context.Context
	Logger   log.Logger
	Channel  PluginChannel
	Config   []byte
	DataPath string
}

type StateStoreGetter

type StateStoreGetter func() *diffdb.Database

Directories

Path Synopsis
Package blueprint provides blueprint for framework modules.
Package blueprint provides blueprint for framework modules.
Package config provides framework config structure.
Package config provides framework config structure.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL