node

package
v0.9.7-rc1 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: Apache-2.0, MIT Imports: 59 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, opts ...InitOpt) 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 SetPassword added in v0.9.4

func SetPassword(password string) BuilderOpt

SetPassword 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
	BlockServiceAPI      apiface.IBlockService
	BlockStoreAPI        apiface.IBlockStore
	ChainAPI             apiface.IChain
	ConfigAPI            apiface.IConfig
	DiscoveryAPI         apiface.IDiscovery
	NetworkAPI           apiface.INetwork
	StorageNetworkingAPI storagenetworking.IStorageNetworking
	SyncerAPI            apiface.ISyncer
	WalletAPI            apiface.IWallet
	MingingAPI           apiface.IMining
	MessagePoolAPI       apiface.IMessagePool

	MultiSigAPI apiface.IMultiSig
	MarketAPI   apiface.IMarket
	PaychAPI    apiface.IPaychan
	// 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 {
	FilAPI  string `json:"FIL_API"`
	FilPath string `json:"FIL_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 InitOpt

type InitOpt func(*initCfg)

InitOpt is an option for initialization of a node's repo.

func DefaultKeyOpt

func DefaultKeyOpt(ki *crypto.KeyInfo) InitOpt

DefaultKeyOpt sets the private key for the wallet's default account. If unspecified, initialization will create a new one.

func ImportKeyOpt

func ImportKeyOpt(ki *crypto.KeyInfo) InitOpt

ImportKeyOpt imports the provided key during initialization.

func PeerKeyOpt

func PeerKeyOpt(k acrypto.PrivKey) InitOpt

PeerKeyOpt sets the private key for a node's 'self' libp2p identity. If unspecified, initialization will create a new one.

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() *blockservice.BlockServiceSubmodule

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) Discovery

func (node *Node) Discovery() *discovery.DiscoverySubmodule

func (*Node) Mpool

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

func (*Node) MultiSig added in v0.9.4

func (node *Node) MultiSig() *multisig.MultiSigSubmodule

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

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) 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) 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) Build added in v0.9.7

func (builder *RPCBuilder) Build(version string) *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