node

package
v1.15.2 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0, MIT Imports: 68 Imported by: 0

Documentation

Index

Constants

View Source
const APIPrefix = "/api"

APIPrefix is the prefix for the http version of the api.

Variables

This section is empty.

Functions

func Init

func Init(ctx context.Context, r repo.Repo, gen genesis.InitFunc) error

Init initializes a Filecoin repo with genesis state and keys. This will always set the configuration for wallet default address (to the specified default key or a newly generated one), but otherwise leave the repo's config object intact. Make further configuration changes after initialization.

func SetNetParams

func SetNetParams(params *config.NetworkParamsConfig)

Types

type AllInspectorInfo

type AllInspectorInfo struct {
	Config          *config.Config
	Runtime         *RuntimeInfo
	Environment     *EnvironmentInfo
	Disk            *DiskInfo
	Memory          *MemoryInfo
	FilecoinVersion string
}

AllInspectorInfo contains all information the inspector can gather.

type Builder

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

Builder is a helper to aid in the construction of a filecoin node.

func (Builder) Repo

func (b Builder) Repo() repo.Repo

repo returns the repo.

type BuilderOpt

type BuilderOpt func(*Builder) error

BuilderOpt is an option for building a filecoin node.

func BlockTime

func BlockTime(blockTime time.Duration) BuilderOpt

BlockTime sets the blockTime.

func ChainClockConfigOption

func ChainClockConfigOption(clk clock.ChainEpochClock) BuilderOpt

ChainClockConfigOption returns a function that sets the chainClock to use in the node.

func IsRelay

func IsRelay() BuilderOpt

IsRelay configures node to act as a libp2p relay.

func JournalConfigOption

func JournalConfigOption(jrl journal.Journal) BuilderOpt

JournalConfigOption returns a function that sets the journal to use in the node.

func Libp2pOptions

func Libp2pOptions(opts ...libp2p.Option) BuilderOpt

Libp2pOptions returns a builder option that sets up the libp2p node

func MonkeyPatchNetworkParamsOption

func MonkeyPatchNetworkParamsOption(params *config.NetworkParamsConfig) BuilderOpt

MonkeyPatchNetworkParamsOption returns a function that sets global vars in the binary's specs actor dependency to change network parameters that live there

func MonkeyPatchSetProofTypeOption

func MonkeyPatchSetProofTypeOption(proofType abi.RegisteredSealProof) BuilderOpt

MonkeyPatchSetProofTypeOption returns a function that sets package variable SuppurtedProofTypes to be only the given registered proof type

func OfflineMode

func OfflineMode(offlineMode bool) BuilderOpt

offlineMode enables or disables offline mode.

func OptionsFromRepo

func OptionsFromRepo(r repo.Repo) ([]BuilderOpt, error)

OptionsFromRepo takes a repo and returns options that configure a node to use the given repo.

func PropagationDelay

func PropagationDelay(propDelay time.Duration) BuilderOpt

PropagationDelay sets the time the node needs to wait for blocks to arrive before mining.

func SetAuthURL added in v0.9.4

func SetAuthURL(url string) BuilderOpt

SetAuthURL set venus auth service URL

func SetWalletPassword added in v0.9.7

func SetWalletPassword(password []byte) BuilderOpt

SetWalletPassword set wallet password

func VerifierConfigOption

func VerifierConfigOption(verifier ffiwrapper.Verifier) BuilderOpt

VerifierConfigOption returns a function that sets the verifier to use in the node consensus

type ConfigOpt

type ConfigOpt func(*config.Config)

ConfigOpt mutates a node config post initialization

type DiskInfo

type DiskInfo struct {
	Free   uint64
	Total  uint64
	FSType string
}

DiskInfo contains information about disk usage and type.

type Env

type Env struct {
	InspectorAPI         IInspector
	BlockStoreAPI        v1api.IBlockStore
	ChainAPI             v1api.IChain
	NetworkAPI           v1api.INetwork
	StorageNetworkingAPI storagenetworking.IStorageNetworking
	SyncerAPI            v1api.ISyncer
	WalletAPI            v1api.IWallet
	MingingAPI           v1api.IMining
	MessagePoolAPI       v1api.IMessagePool

	MarketAPI v1api.IMarket
	PaychAPI  v1api.IPaychan
	CommonAPI v1api.ICommon
	EthAPI    v1api.IETH
	// contains filtered or unexported fields
}

Env is the environment for command API handlers.

func NewClientEnv

func NewClientEnv(ctx context.Context) *Env

NewClientEnv returns a new environment for command API clients. This environment lacks direct access to any internal APIs.

func (*Env) Context

func (ce *Env) Context() context.Context

Context returns the context of the environment.

type EnvironmentInfo

type EnvironmentInfo struct {
	VENUSAPI  string `json:"VENUS_API"`
	VENUSPath string `json:"VENUS_PATH"`
	GoPath    string `json:"GOPATH"`
}

EnvironmentInfo contains information about the environment filecoin is running in.

type IInspector added in v0.9.7

type IInspector interface {
	Runtime() *RuntimeInfo
	Memory() (*MemoryInfo, error)
	Config() *config.Config
	Disk() (*DiskInfo, error)
	FilecoinVersion() string
	Environment() *EnvironmentInfo
}

func NewInspectorAPI

func NewInspectorAPI(r repo.Repo) IInspector

NewInspectorAPI returns a `Inspector` used to inspect the venus node.

type MemoryInfo

type MemoryInfo struct {
	Swap    uint64
	Virtual uint64
}

MemoryInfo contains information about memory usage.

type Node

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

Node represents a full Filecoin node.

func New

func New(ctx context.Context, opts ...BuilderOpt) (*Node, error)

New creates a new node.

func (*Node) Blockservice

func (node *Node) Blockservice() *dagservice.DagServiceSubmodule

func (*Node) Blockstore

func (node *Node) Blockstore() *blockstore.BlockstoreSubmodule

func (*Node) Chain

func (node *Node) Chain() *chain2.ChainSubmodule

func (*Node) ChainClock

func (node *Node) ChainClock() clock.ChainEpochClock

func (*Node) ConfigModule

func (node *Node) ConfigModule() *configModule.ConfigModule

func (*Node) Mpool

func (node *Node) Mpool() *mpool.MessagePoolSubmodule

func (*Node) Network

func (node *Node) Network() *network2.NetworkSubmodule

func (*Node) OfflineMode

func (node *Node) OfflineMode() bool

func (*Node) Repo

func (node *Node) Repo() repo.Repo

func (*Node) RunRPCAndWait

func (node *Node) RunRPCAndWait(ctx context.Context, rootCmdDaemon *cmds.Command, ready chan interface{}) error

RunRPCAndWait start rpc server and listen to signal to exit

func (*Node) Start

func (node *Node) Start(ctx context.Context) error

Start boots up the node.

func (*Node) Stop

func (node *Node) Stop(ctx context.Context)

Stop initiates the shutdown of the node.

func (*Node) StorageNetworking

func (node *Node) StorageNetworking() *storagenetworking.StorageNetworkingSubmodule

func (*Node) Sync added in v1.14.0

func (node *Node) Sync() *syncer2.SyncerSubmodule

func (*Node) Wallet

func (node *Node) Wallet() *wallet.WalletSubmodule

type RPCBuilder added in v0.9.7

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

func NewBuilder added in v0.9.7

func NewBuilder() *RPCBuilder

func (*RPCBuilder) AddAPI added in v1.10.0

func (builder *RPCBuilder) AddAPI(service RPCService) error

func (*RPCBuilder) AddService added in v0.9.7

func (builder *RPCBuilder) AddService(service RPCService) error

func (*RPCBuilder) AddServices added in v0.9.7

func (builder *RPCBuilder) AddServices(services ...RPCService) error

func (*RPCBuilder) AddV0API added in v1.10.0

func (builder *RPCBuilder) AddV0API(service RPCService) error

func (*RPCBuilder) Build added in v0.9.7

func (builder *RPCBuilder) Build(version string, limiter *ratelimit.RateLimiter) *jsonrpc.RPCServer

func (*RPCBuilder) NameSpace added in v0.9.7

func (builder *RPCBuilder) NameSpace(nameSpaece string) *RPCBuilder

type RPCService added in v0.9.7

type RPCService interface{}

type RuntimeInfo

type RuntimeInfo struct {
	OS            string
	Arch          string
	Version       string
	Compiler      string
	NumProc       int
	GoMaxProcs    int
	NumGoRoutines int
	NumCGoCalls   int64
}

RuntimeInfo contains information about the golang runtime.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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