cmd

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2021 License: Apache-2.0, MIT Imports: 96 Imported by: 0

Documentation

Overview

Package commands implements the command to print the blockchain.

Package commands implements the command to print the blockchain.

Package cmd implements the command to print the blockchain.

Index

Constants

View Source
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 = "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"

	// 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"

	// PeerKeyFile is the path of file containing key to use for new nodes libp2p identity
	PeerKeyFile = "peerkeyfile"

	// WalletKeyFile is the path of file containing wallet keys that may be imported on initialization
	WalletKeyFile = "wallet-keyfile"

	// 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"
)
View Source
const Confidence = 10

Variables

View Source
var (
	// ErrInvalidSize indicates that the provided size was invalid.
	ErrInvalidSize = fmt.Errorf("invalid size")

	// ErrInvalidPrice indicates that the provided price was invalid.
	ErrInvalidPrice = fmt.Errorf("invalid price")

	// ErrInvalidAmount indicates that the provided amount was invalid.
	ErrInvalidAmount = fmt.Errorf("invalid amount")

	// ErrInvalidCollateral indicates that provided collateral was invalid.
	ErrInvalidCollateral = fmt.Errorf("invalid collateral")

	// ErrInvalidPledge indicates that provided pledge was invalid.
	ErrInvalidPledge = fmt.Errorf("invalid pledge")

	// ErrInvalidBlockHeight indicates that the provided block height was invalid.
	ErrInvalidBlockHeight = fmt.Errorf("invalid block height")

	// ErrMissingDaemon is the error returned when trying to execute a command that requires the daemon to be started.
	ErrMissingDaemon = errors.New("daemon must be started before using this command")

	// ErrNoWalletAddresses indicates that there are no addresses in wallet to mine to.
	ErrNoWalletAddresses = fmt.Errorf("no addresses in wallet to mine to")
)
View Source
var (
	AdminExtra = new(cmds.Extra).SetValue("perm", "admin")
	WriteExtra = new(cmds.Extra).SetValue("perm", "write")
	SignExtra  = new(cmds.Extra).SetValue("perm", "sign")
	ReadExtra  = new(cmds.Extra).SetValue("perm", "read")
)
View Source
var RootCmd = &cmds.Command{
	Helptext: cmds.HelpText{
		Tagline: "A decentralized storage network",
		Subcommands: `
START RUNNING FILECOIN
  venus config <key> [<value>] - Get and set filecoin config values
  venus daemon                 - Start a long-running daemon process
  venus wallet                 - Manage your filecoin wallets
  venus msig                   - Interact with a multisig wallet

VIEW DATA STRUCTURES
  venus chain                  - Inspect the filecoin blockchain
  venus sync 				   - Inspect the filecoin Sync
  venus dag                    - Interact with IPLD DAG objects
  venus show                   - Get human-readable representations of filecoin objects

NETWORK COMMANDS
  venus swarm                  - Interact with the swarm
  venus drand                  - retrieve drand randomness

MESSAGE COMMANDS
  venus send                   - Send message
  venus mpool                  - Manage the message pool

State COMMANDS
  venus wait-msg               - Wait for a message to appear on chain
  venus search-msg             - Search to see whether a message has appeared on chain
  venus power                  - Query network or miner power
  venus sectors                - Query the sector set of a miner
  venus active-sectors         - Query the active sector set of a miner
  venus sector                 - Get miner sector info
  venus get-actor              - Print actor information
  venus lookup                 - Find corresponding ID address
  venus sector-size            - Look up miners sector size
  venus get-deal               - View on-chain deal info
  venus miner-info             - Retrieve miner information
  venus network-version        - MReturns the network version
  venus list-actor             - list all actors

Paych COMMANDS 
  venus paych                  - Manage payment channels

TOOL COMMANDS
  venus inspect                - Show info about the venus node
  venus leb128                 - Leb128 cli encode/decode
  venus log                    - Interact with the daemon event log output
  venus protocol               - Show protocol parameter details
  venus version                - Show venus version information
  venus seed                   - Seal sectors for genesis miner
  venus 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, "set the repo directory, defaults to ~/.venus/repo"),
		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

View Source
var RootCmdDaemon = &cmds.Command{
	Subcommands: make(map[string]*cmds.Command),
}

command object for the daemon

Functions

func EpochTime

func EpochTime(curr, e abi.ChainEpoch, blockDelay uint64) string

func Import

func Import(r repo.Repo, fileName string) error

Import cache tipset cids to store. The value of the cached tipset CIDS is used as the check-point when running `venus daemon`

func PrintString

func PrintString(w io.Writer, s fmt.Stringer) error

PrintString prints a given Stringer to the writer.

func ReqContext added in v0.9.4

func ReqContext(cctx context.Context) context.Context

func Run

func Run(ctx context.Context, args []string, stdin, stdout, stderr *os.File) (int, error)

Run processes the arguments and stdin

Types

type APIInfo added in v0.9.7

type APIInfo struct {
	Addr  string
	Token string
}

type ActorInfo

type ActorInfo struct {
	Address string
	Balance string
	Nonce   uint64
	Code    string
	Head    string
}

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

func (idd IDDetails) MarshalJSON() ([]byte, error)

MarshalJSON implements json.Marshaler

func (*IDDetails) UnmarshalJSON

func (idd *IDDetails) UnmarshalJSON(data []byte) error

UnmarshalJSON implements Unmarshaler

type MessageSendResult

type MessageSendResult struct {
	Cid     cid.Cid
	GasUsed int64
	Preview bool
}

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.UnsignedMessage
	Receipt   *types.MessageReceipt
	Signature vm.ActorMethodSignature
}

WaitResult is the result of a message wait call.

type WalletSerializeResult

type WalletSerializeResult struct {
	KeyInfo []*crypto.KeyInfo
}

WalletSerializeResult is the type wallet export and import return and expect.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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