server

package
v0.9.2 Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: Apache-2.0 Imports: 67 Imported by: 0

Documentation

Overview

Package server defines the main Kwil server, which includes the blockchain node and the gRPC services that interface with the Kwil dataset engine.

Index

Constants

View Source
const (
	PGVersion = 16
)

Variables

View Source
var (
	// AppVersion is the application's "protocol version", signaling changes in
	// the application's component of the state machine that could impact
	// consensus. This version should be bumped whenever changes in the
	// application's logic might cause nodes with different versions to come to
	// different conclusions about the validity of transactions, blocks, votes,
	// or the resulting state.
	//
	// It should NOT be bumped for changes that do not affect consensus, such as
	// performance optimizations, logging updates, or bug fixes that do not
	// alter how transactions are validated or blocks are processed.
	//
	// Custom applications, especially those use extensions to extend or modify
	// the state machine's logic, should set this variable appropriately prior
	// to starting the Server or executing the root command.
	AppVersion uint64 = 1
)

Functions

func PrepareForMigration added in v0.9.0

func PrepareForMigration(ctx context.Context, kwildCfg *commonCfg.KwildConfig, genesisCfg *chain.GenesisConfig, logger log.Logger) (*commonCfg.KwildConfig, *chain.GenesisConfig, error)

PrepareForMigration initiates the migration mode for the kwild node. This is a pre-start phase where the node periodically polls the old chain for the genesis state. This mode is used to prepare the node for migration by downloading the genesis state from the old chain for the new chain to start from. It also updates the genesis and kwild configurations required for the migration process.

Types

type Server

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

Server controls the gRPC server and http gateway.

func New

func New(ctx context.Context, cfg *config.KwildConfig, genesisCfg *chain.GenesisConfig,
	nodeKey *crypto.Ed25519PrivateKey, autogen bool, logger log.Logger) (svr *Server, err error)

New builds the kwild server.

func (*Server) Start

func (s *Server) Start(ctx context.Context) error

func (*Server) Stop

func (s *Server) Stop()

Stop begins shutting down the Server. However, the caller of Start will normally cancel the provided context and wait for it to return.

Jump to

Keyboard shortcuts

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