Documentation ¶
Overview ¶
Package commands implements the command to print the blockchain.
Package cmd implements the command to print the blockchain.
Index ¶
- Constants
- Variables
- func EpochTime(curr, e abi.ChainEpoch, blockDelay uint64) string
- func Import(ctx context.Context, r repo.Repo, fileName string) error
- func LoadTipSet(ctx context.Context, req *cmds.Request, chainAPI v1api.IChain) (*types.TipSet, error)
- func MergePeers(peerSet1 []string, peerSet2 []string) []string
- func ParseTipSetRef(ctx context.Context, chainAPI v1api.IChain, tss string) (*types.TipSet, error)
- func ParseTipSetString(ts string) ([]cid.Cid, error)
- func PrintString(w io.Writer, s fmt.Stringer) error
- func ReqContext(cctx context.Context) context.Context
- func Run(ctx context.Context, args []string, stdin, stdout, stderr *os.File) (int, error)
- func SyncBasefeeCheck(ctx context.Context, chainAPI v1.IChain, blockDelaySecs int64, ...) error
- type APIInfo
- type ActorView
- type AddressLsResult
- type AddressResult
- type BlockResult
- type ChainHeadResult
- type ChainLsResult
- type IDDetails
- type MessageSendResult
- type SilentWriter
- func (sw *SilentWriter) ClearError() error
- func (sw *SilentWriter) Error() error
- func (sw *SilentWriter) Print(a ...interface{}) bool
- func (sw *SilentWriter) Printf(format string, a ...interface{}) bool
- func (sw *SilentWriter) Println(a ...interface{}) bool
- func (sw *SilentWriter) Write(p []byte) bool
- func (sw *SilentWriter) WriteString(str string) bool
- func (sw *SilentWriter) WriteStringln(str string) bool
- type WaitResult
- type WalletSerializeResult
Constants ¶
const ( // OptionAPI is the name of the option for specifying the api port. OptionAPI = "cmdapiaddr" OptionToken = "token" // OptionRepoDir is the name of the option for specifying the directory of the repo. OptionRepoDir = "repo" OptionLegacyRepoDir = "repodir" // OptionDrandConfigAddr is the init option for configuring drand to a given network address at init time OptionDrandConfigAddr = "drand-config-addr" // offlineMode tells us if we should try to connect this Filecoin node to the network OfflineMode = "offline" // ELStdout tells the daemon to write event logs to stdout. ELStdout = "elstdout" ULimit = "manage-fdlimit" // SwarmAddress is the multiaddr for this Filecoin node SwarmAddress = "swarmlisten" // SwarmPublicRelayAddress is a public address that the venus node // will listen on if it is operating as a relay. We use this to specify // the public ip:port of a relay node that is sitting behind a static // NAT mapping. SwarmPublicRelayAddress = "swarmrelaypublic" // GenesisFile is the path of file containing archive of genesis block DAG data GenesisFile = "genesisfile" // Network populates config with network-specific parameters for a known network (e.g. testnet2) Network = "network" // IsRelay when set causes the the daemon to provide libp2p relay // services allowing other filecoin nodes behind NATs to talk directly. IsRelay = "is-relay" Size = "size" ImportSnapshot = "import-snapshot" // wallet password Password = "password" AuthServiceURL = "auth-url" BootstrapPeers = "bootstrap-peers" )
const Confidence = 10
Variables ¶
var RootCmd = &cmds.Command{ Helptext: cmds.HelpText{ Tagline: "Filecoin decentralized storage network client", Subcommands: ` START RUNNING VENUS daemon - Start a venus daemon process wallet - Manage wallet info - Print node info VIEW DATA STRUCTURES chain - Inspect the filecoin blockchain sync - Inspect the filecoin Sync NETWORK COMMANDS swarm - Interact with the swarm drand - Retrieve randomness from drand server MESSAGE COMMANDS send - Send message mpool - Manage the message pool MINER COMMANDS miner - Interact with actors State COMMANDS state - query states of the filecoin network Paych COMMANDS paych - Manage payment channels Cid COMMANDS manifest-cid-from-car - Get the manifest CID from a car file Evm COMMANDS evm - Commands related to the Filecoin EVM runtime TOOL COMMANDS inspect - Show info about the venus node log - Interact with the daemon event log output version - Show venus version information seed - Seal sectors for genesis miner fetch - Fetch proving parameters `, }, Options: []cmds.Option{ cmds.StringsOption(OptionToken, "set the auth token to use"), cmds.StringOption(OptionAPI, "set the api port to use"), cmds.StringOption(OptionRepoDir, OptionLegacyRepoDir, "set the repo directory, defaults to ~/.venus"), cmds.StringOption(cmds.EncLong, cmds.EncShort, "The encoding type the output should be encoded with (pretty-json or json)").WithDefault("pretty-json"), cmds.BoolOption("help", "Show the full command help text."), cmds.BoolOption("h", "Show a short version of the command help text."), }, Subcommands: make(map[string]*cmds.Command), }
command object for the local cli
command object for the daemon
Functions ¶
func Import ¶
Import cache tipset cids to store. The value of the cached tipset CIDS is used as the check-point when running `venus daemon`
func LoadTipSet ¶ added in v1.1.0
func LoadTipSet(ctx context.Context, req *cmds.Request, chainAPI v1api.IChain) (*types.TipSet, error)
LoadTipSet gets the tipset from the context, or the head from the API.
It always gets the head from the API so commands use a consistent tipset even if time pases.
func MergePeers ¶ added in v1.10.0
func ParseTipSetRef ¶ added in v1.1.0
func ParseTipSetString ¶ added in v1.1.0
func PrintString ¶
PrintString prints a given Stringer to the writer.
func SyncBasefeeCheck ¶ added in v1.9.0
Types ¶
type ActorView ¶
type ActorView struct { Address string `json:"address"` Code cid.Cid `json:"code,omitempty"` Nonce uint64 `json:"nonce"` Balance abi.TokenAmount `json:"balance"` Head cid.Cid `json:"head,omitempty"` }
ActorView represents a generic way to represent details about any actor to the user.
type AddressLsResult ¶
type AddressLsResult struct {
Addresses []address.Address
}
AddressLsResult is the result of running the address list command.
type AddressResult ¶
type AddressResult struct {
Address address.Address
}
type BlockResult ¶
type BlockResult struct { Cid cid.Cid Miner address.Address }
type ChainHeadResult ¶
type ChainHeadResult struct { Height abi.ChainEpoch ParentWeight big.Int Cids []cid.Cid Timestamp string }
type ChainLsResult ¶
type ChainLsResult struct { Height abi.ChainEpoch Timestamp string Blocks []BlockResult }
type IDDetails ¶
type IDDetails struct { Addresses []ma.Multiaddr ID peer.ID AgentVersion string ProtocolVersion string PublicKey []byte // raw bytes }
IDDetails is a collection of information about a node.
func (IDDetails) MarshalJSON ¶
MarshalJSON implements json.Marshaler
func (*IDDetails) UnmarshalJSON ¶
UnmarshalJSON implements Unmarshaler
type MessageSendResult ¶
MessageSendResult is the return type for message send command
type SilentWriter ¶
type SilentWriter struct {
// contains filtered or unexported fields
}
SilentWriter writes to a stream, stopping after the first error and discarding output until the error is cleared. No printing methods return an error (to avoid warnings about ignoring it), but they do return a boolean indicating whether an error is waiting to be cleared. Example usage:
sw := NewSilentWriter(w) sw.Println("A line") sw.Println("Another line") return sw.Error()
func NewSilentWriter ¶
func NewSilentWriter(w io.Writer) *SilentWriter
NewSilentWriter returns a new writer backed by `w`.
func (*SilentWriter) ClearError ¶
func (sw *SilentWriter) ClearError() error
ClearError clears and returns any error encountered while writing. Subsequent writes will attempt to write to the underlying writer again.
func (*SilentWriter) Error ¶
func (sw *SilentWriter) Error() error
Error returns any error encountered while writing.
func (*SilentWriter) Print ¶
func (sw *SilentWriter) Print(a ...interface{}) bool
Print writes with fmt.Fprint and returns true if there was no error.
func (*SilentWriter) Printf ¶
func (sw *SilentWriter) Printf(format string, a ...interface{}) bool
Printf writes with fmt.Fprintf and returns true if there was no error.
func (*SilentWriter) Println ¶
func (sw *SilentWriter) Println(a ...interface{}) bool
Println writes with fmt.Fprintln and returns true if there was no error.
func (*SilentWriter) Write ¶
func (sw *SilentWriter) Write(p []byte) bool
Write writes with io.Writer.Write and returns true if there was no error.
func (*SilentWriter) WriteString ¶
func (sw *SilentWriter) WriteString(str string) bool
WriteString writes with io.WriteString and returns true if there was no error.
func (*SilentWriter) WriteStringln ¶
func (sw *SilentWriter) WriteStringln(str string) bool
WriteString writes with io.WriteString and returns true if there was no error.
type WaitResult ¶
type WaitResult struct { Message *types.Message Receipt *types.MessageReceipt Signature vm.ActorMethodSignature }
WaitResult is the result of a message wait call.
type WalletSerializeResult ¶
WalletSerializeResult is the type wallet export and import return and expect.