blockchain

package
v0.47.1 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2025 License: GPL-3.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Blockchain

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

Blockchain provides Neo blockchain services consumed by NeoFS Inner Ring (hereinafter node). By design, Blockchain does not implement node specifics: instead, it provides the generic functionality of the Neo blockchain, and narrows the rich Neo functionality to the minimum necessary for the node's operation.

Blockchain must be initialized using New constructor. After initialization Blockchain becomes a single-use component that can be started and then stopped. All operations should be executed after Blockchain is started and before it is stopped (any other behavior is undefined).

func New

func New(cfg *config.Consensus, wallet *config.Wallet, errChan chan<- error, log *zap.Logger) (res *Blockchain, err error)

New returns new Blockchain configured by the specified Config. New panics if any required Config field is zero or unset. Resulting Blockchain is ready to run. Launched Blockchain should be finally stopped.

func (*Blockchain) BuildWSClient

func (x *Blockchain) BuildWSClient(ctx context.Context) (*rpcclient.WSClient, error)

BuildWSClient initializes rpcclient.WSClient with direct access to the underlying blockchain.

func (*Blockchain) Run

func (x *Blockchain) Run(ctx context.Context) (err error)

Run runs the Blockchain and makes all its functionality available for use. Context break fails startup. Run returns any error encountered which prevented the Blockchain to be started. If Run failed, the Blockchain should no longer be used. After Blockchain has been successfully run, all internal failures are written to the configured listener.

Run should not be called more than once.

Use Stop to stop the Blockchain.

func (*Blockchain) Stop

func (x *Blockchain) Stop()

Stop stops the running Blockchain and frees all its internal resources.

Stop should not be called twice and before successful Run.

Jump to

Keyboard shortcuts

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