Documentation ¶
Index ¶
- Variables
- type ActionOption
- func AOAllowDuplicates(allow bool) ActionOption
- func AOCount(count uint) ActionOption
- func AOFormat(format string) ActionOption
- func AOFromAddr(fromAddr address.Address) ActionOption
- func AOLatency() ActionOption
- func AOLimit(limit uint64) ActionOption
- func AOMinerAddr(minerAddr address.Address) ActionOption
- func AOPayer(payer address.Address) ActionOption
- func AOPeerid(pid peer.ID) ActionOption
- func AOPrice(price *big.Float) ActionOption
- func AOSectorSize(ba abi.SectorSize) ActionOption
- func AOStreams() ActionOption
- func AOValidAt(bh abi.ChainEpoch) ActionOption
- func AOValue(value int) ActionOption
- func AOVerbose() ActionOption
- func AOWaitForCount(count uint) ActionOption
- type Filecoin
- func (f *Filecoin) ActorLs(ctx context.Context) ([]cmd.ActorView, error)
- func (f *Filecoin) AddressLookup(ctx context.Context, addr address.Address) (peer.ID, error)
- func (f *Filecoin) AddressLs(ctx context.Context) ([]address.Address, error)
- func (f *Filecoin) AddressNew(ctx context.Context) (address.Address, error)
- func (f *Filecoin) ChainHead(ctx context.Context) ([]cid.Cid, error)
- func (f *Filecoin) ChainLs(ctx context.Context) (*json.Decoder, error)
- func (f *Filecoin) Config() (*fcconfig.Config, error)
- func (f *Filecoin) ConfigGet(ctx context.Context, key string, v interface{}) error
- func (f *Filecoin) ConfigSet(ctx context.Context, key string, v interface{}) error
- func (f *Filecoin) DHTFindPeer(ctx context.Context, pid peer.ID) ([]multiaddr.Multiaddr, error)
- func (f *Filecoin) DHTFindProvs(ctx context.Context, key cid.Cid) (*json.Decoder, error)
- func (f *Filecoin) DagGet(ctx context.Context, ref cid.Cid) (map[string]interface{}, error)
- func (f *Filecoin) Dir() string
- func (f *Filecoin) DumpLastOutput(w io.Writer)
- func (f *Filecoin) DumpLastOutputJSON(w io.Writer)
- func (f *Filecoin) ID(ctx context.Context, options ...ActionOption) (*cmd.IDDetails, error)
- func (f *Filecoin) InitDaemon(ctx context.Context, args ...string) (testbedi.Output, error)
- func (f *Filecoin) InspectAll(ctx context.Context, options ...ActionOption) (*node.AllInspectorInfo, error)
- func (f *Filecoin) InspectConfig(ctx context.Context, options ...ActionOption) (*config.Config, error)
- func (f *Filecoin) InspectDisk(ctx context.Context, options ...ActionOption) (*node.DiskInfo, error)
- func (f *Filecoin) InspectMemory(ctx context.Context, options ...ActionOption) (*node.MemoryInfo, error)
- func (f *Filecoin) InspectRuntime(ctx context.Context, options ...ActionOption) (*node.RuntimeInfo, error)
- func (f *Filecoin) LastCmdStdErr() io.ReadCloser
- func (f *Filecoin) LastCmdStdErrStr() (string, error)
- func (f *Filecoin) MessageSend(ctx context.Context, target address.Address, method abi.MethodNum, ...) (cid.Cid, error)
- func (f *Filecoin) MessageWait(ctx context.Context, mcid cid.Cid, options ...ActionOption) (cmd.WaitResult, error)
- func (f *Filecoin) MpoolLs(ctx context.Context, options ...ActionOption) ([]*types.SignedMessage, error)
- func (f *Filecoin) Protocol(ctx context.Context) (*apitypes.ProtocolParams, error)
- func (f *Filecoin) RunCmdJSONWithStdin(ctx context.Context, stdin io.Reader, v interface{}, args ...string) error
- func (f *Filecoin) RunCmdLDJSONWithStdin(ctx context.Context, stdin io.Reader, args ...string) (*json.Decoder, error)
- func (f *Filecoin) RunCmdWithStdin(ctx context.Context, stdin io.Reader, args ...string) (testbedi.Output, error)
- func (f *Filecoin) Shell() error
- func (f *Filecoin) ShowHeader(ctx context.Context, ref cid.Cid) (*types.BlockHeader, error)
- func (f *Filecoin) ShowMessages(ctx context.Context, ref cid.Cid) ([]*types.SignedMessage, error)
- func (f *Filecoin) ShowReceipts(ctx context.Context, ref cid.Cid) ([]types.MessageReceipt, error)
- func (f *Filecoin) StartDaemon(ctx context.Context, wait bool, args ...string) (testbedi.Output, error)
- func (f *Filecoin) StartLogCapture() (*fastutil.Interval, error)
- func (f *Filecoin) StopDaemon(ctx context.Context) error
- func (f *Filecoin) String() string
- func (f *Filecoin) SwarmConnect(ctx context.Context, addrs ...multiaddr.Multiaddr) (peer.ID, error)
- func (f *Filecoin) SwarmPeers(ctx context.Context, options ...ActionOption) ([]net.SwarmConnInfo, error)
- func (f *Filecoin) WalletBalance(ctx context.Context, addr address.Address) (fbig.Int, error)
- func (f *Filecoin) WalletExport(ctx context.Context, addrs []address.Address) ([]*crypto.KeyInfo, error)
- func (f *Filecoin) WalletImport(ctx context.Context, file files.File) ([]address.Address, error)
- func (f *Filecoin) WriteConfig(cfg *fcconfig.Config) error
- type FilecoinOpts
- type IPTBCoreExt
- type ProcessDaemonOption
- type ProcessInitOption
- func POAutoSealIntervalSeconds(seconds int) ProcessInitOption
- func PODevnet(net string) ProcessInitOption
- func PODevnetNightly() ProcessInitOption
- func PODevnetStaging() ProcessInitOption
- func PODevnetUser() ProcessInitOption
- func POGenesisFile(uri string) ProcessInitOption
- func POPeerKeyFile(pkf string) ProcessInitOption
Constants ¶
This section is empty.
Variables ¶
var ( // ErrDoubleInitOpts is returned by InitDaemon when both init options are provided by FilecoinOpts // in NewProcess as well as passed to InitDaemon directly. ErrDoubleInitOpts = errors.New("cannot provide both init options through environment and arguments") // ErrDoubleDaemonOpts is returned by StartDaemon when both init options are provided by FilecoinOpts // in NewProcess as well as passed to StartDaemon directly. ErrDoubleDaemonOpts = errors.New("cannot provide both daemon options through environment and arguments") )
Functions ¶
This section is empty.
Types ¶
type ActionOption ¶
type ActionOption func() []string
ActionOption is used to pass optional arguments to actions. Thought it's not necessary, we use function options to enforce coding standards not not passing string options directly into the actions.
func AOAllowDuplicates ¶
func AOAllowDuplicates(allow bool) ActionOption
AOAllowDuplicates provides the --allow-duplicates option to client propose-storage-deal
func AOCount ¶
func AOCount(count uint) ActionOption
AOCount provides the `--count=<uint>` option to actions
func AOFormat ¶
func AOFormat(format string) ActionOption
AOFormat provides the `--format=<format>` option to actions
func AOFromAddr ¶
func AOFromAddr(fromAddr address.Address) ActionOption
AOFromAddr provides the `--from=<addr>` option to actions
func AOLimit ¶
func AOLimit(limit uint64) ActionOption
AOLimit provides the `--gas-limit=<uint64>` option to actions
func AOMinerAddr ¶
func AOMinerAddr(minerAddr address.Address) ActionOption
AOMinerAddr provides the `--miner=<addr>` option to actions
func AOPayer ¶
func AOPayer(payer address.Address) ActionOption
AOPayer provides the `--payer=<addr>` option to actions
func AOPeerid ¶
func AOPeerid(pid peer.ID) ActionOption
AOPeerid provides the `--peerid=<peerid>` option to actions
func AOPrice ¶
func AOPrice(price *big.Float) ActionOption
AOPrice provides the `--gas-price=<fil>` option to actions
func AOSectorSize ¶
func AOSectorSize(ba abi.SectorSize) ActionOption
AOSectorSize provides the `--sectorsize` option to actions
func AOValidAt ¶
func AOValidAt(bh abi.ChainEpoch) ActionOption
AOValidAt provides the `--validate=<blockheight>` option to actions
func AOValue ¶
func AOValue(value int) ActionOption
AOValue provides the `--value` option to actions
func AOWaitForCount ¶
func AOWaitForCount(count uint) ActionOption
AOWaitForCount provides the `--wait-for-count` option to actions
type Filecoin ¶
type Filecoin struct { PeerID peer.ID Log logging.EventLogger // contains filtered or unexported fields }
Filecoin represents a wrapper around the iptb Core interface.
func NewFilecoinProcess ¶
func NewFilecoinProcess(ctx context.Context, c IPTBCoreExt, eo FilecoinOpts) *Filecoin
NewFilecoinProcess returns a pointer to a Filecoin process that wraps the IPTB core interface `c`.
func (*Filecoin) AddressLookup ¶
AddressLookup runs the address lookup command against the filecoin process.
func (*Filecoin) AddressNew ¶
AddressNew runs the address new command against the filecoin process.
func (*Filecoin) ConfigGet ¶
ConfigGet runs the `config` command against the filecoin process, and decodes the output into `v`.
func (*Filecoin) ConfigSet ¶
ConfigSet runs the `config` command against the filecoin process, encoding `v` as the value.
func (*Filecoin) DHTFindPeer ¶
DHTFindPeer runs the `dht findpeer` command against the filecoin process
func (*Filecoin) DHTFindProvs ¶
DHTFindProvs runs the `dht findprovs` command against the filecoin process
func (*Filecoin) DumpLastOutput ¶
DumpLastOutput writes all the output (args, exit-code, error, stderr, stdout) of the last ran command from RunCmdWithStdin, RunCmdJSONWithStdin, or RunCmdLDJSONWithStdin.
func (*Filecoin) DumpLastOutputJSON ¶
DumpLastOutputJSON writes all the output (args, exit-code, error, stderr, stdout) of the last ran command from RunCmdWithStdin, RunCmdJSONWithStdin, or RunCmdLDJSONWithStdin as json.
func (*Filecoin) InitDaemon ¶
InitDaemon initializes the filecoin daemon process.
func (*Filecoin) InspectAll ¶
func (f *Filecoin) InspectAll(ctx context.Context, options ...ActionOption) (*node.AllInspectorInfo, error)
InspectAll runs the `inspect all` command against the filecoin process
func (*Filecoin) InspectConfig ¶
func (f *Filecoin) InspectConfig(ctx context.Context, options ...ActionOption) (*config.Config, error)
InspectConfig runs the `inspect config` command against the filecoin process
func (*Filecoin) InspectDisk ¶
func (f *Filecoin) InspectDisk(ctx context.Context, options ...ActionOption) (*node.DiskInfo, error)
InspectDisk runs the `inspect disk` command against the filecoin process
func (*Filecoin) InspectMemory ¶
func (f *Filecoin) InspectMemory(ctx context.Context, options ...ActionOption) (*node.MemoryInfo, error)
InspectMemory runs the `inspect memory` command against the filecoin process
func (*Filecoin) InspectRuntime ¶
func (f *Filecoin) InspectRuntime(ctx context.Context, options ...ActionOption) (*node.RuntimeInfo, error)
InspectRuntime runs the `inspect runtime` command against the filecoin process
func (*Filecoin) LastCmdStdErr ¶
func (f *Filecoin) LastCmdStdErr() io.ReadCloser
LastCmdStdErr is the standard error output from the last command run
func (*Filecoin) LastCmdStdErrStr ¶
LastCmdStdErrStr is a shortcut to just get the output as string
func (*Filecoin) MessageSend ¶
func (f *Filecoin) MessageSend(ctx context.Context, target address.Address, method abi.MethodNum, options ...ActionOption) (cid.Cid, error)
MessageSend runs the `message send` command against the filecoin process.
func (*Filecoin) MessageWait ¶
func (f *Filecoin) MessageWait(ctx context.Context, mcid cid.Cid, options ...ActionOption) (cmd.WaitResult, error)
MessageWait runs the `message wait` command against the filecoin process.
func (*Filecoin) MpoolLs ¶
func (f *Filecoin) MpoolLs(ctx context.Context, options ...ActionOption) ([]*types.SignedMessage, error)
MpoolLs runs the `mpool ls` command against the filecoin process.
func (*Filecoin) RunCmdJSONWithStdin ¶
func (f *Filecoin) RunCmdJSONWithStdin(ctx context.Context, stdin io.Reader, v interface{}, args ...string) error
RunCmdJSONWithStdin runs `args` against Filecoin process `f`. The '--enc=json' flag is appened to the command specified by `args`, the result of the command is marshaled into `v`.
func (*Filecoin) RunCmdLDJSONWithStdin ¶
func (f *Filecoin) RunCmdLDJSONWithStdin(ctx context.Context, stdin io.Reader, args ...string) (*json.Decoder, error)
RunCmdLDJSONWithStdin runs `args` against Filecoin process `f`. The '--enc=json' flag is appened to the command specified by `args`. The result of the command is returned as a json.Decoder that may be used to read and decode JSON values from the result of the command.
func (*Filecoin) RunCmdWithStdin ¶
func (f *Filecoin) RunCmdWithStdin(ctx context.Context, stdin io.Reader, args ...string) (testbedi.Output, error)
RunCmdWithStdin runs `args` against Filecoin process `f`, a testbedi.Output and an error are returned.
func (*Filecoin) Shell ¶
Shell starts a user shell targeting the filecoin process. Exact behavior is plugin dependent. Please refer to the plugin documentation for more information.
func (*Filecoin) ShowHeader ¶
ShowHeader runs the `show header` command against the filecoin process
func (*Filecoin) ShowMessages ¶
ShowMessages runs the `show messages` command against the filecoin process
func (*Filecoin) ShowReceipts ¶
ShowReceipts runs the `show receipts` command against the filecoin process
func (*Filecoin) StartDaemon ¶
func (f *Filecoin) StartDaemon(ctx context.Context, wait bool, args ...string) (testbedi.Output, error)
StartDaemon starts the filecoin daemon process.
func (*Filecoin) StartLogCapture ¶
StartLogCapture returns a fastutil.Interval, after calling fastutil.Interval#Stop all stderr logs generator between the call to StartLogCapture and then will be available. fastutil.Interval implements io.Reader (its a bytes.Buffer) If an error has occurred reading the stderr, the error will be returned here
func (*Filecoin) StopDaemon ¶
StopDaemon stops the filecoin daemon process.
func (*Filecoin) SwarmConnect ¶
SwarmConnect runs the `swarm connect` command against the filecoin process
func (*Filecoin) SwarmPeers ¶
func (f *Filecoin) SwarmPeers(ctx context.Context, options ...ActionOption) ([]net.SwarmConnInfo, error)
SwarmPeers runs the `swarm peers` command against the filecoin process
func (*Filecoin) WalletBalance ¶
WalletBalance run the wallet balance command against the filecoin process.
func (*Filecoin) WalletExport ¶
func (f *Filecoin) WalletExport(ctx context.Context, addrs []address.Address) ([]*crypto.KeyInfo, error)
WalletExport run the wallet export command against the filecoin process.
func (*Filecoin) WalletImport ¶
WalletImport run the wallet import command against the filecoin process.
type FilecoinOpts ¶
type FilecoinOpts struct { InitOpts []ProcessInitOption DaemonOpts []ProcessDaemonOption }
FilecoinOpts are used define process init and daemon options for the environment.
type IPTBCoreExt ¶
type IPTBCoreExt interface { testbedi.Config // StderrReader is require to gather daemon logs during action execution StderrReader() (io.ReadCloser, error) }
IPTBCoreExt is an extended interface of the iptb.Core. It defines additional requirement.
type ProcessDaemonOption ¶
type ProcessDaemonOption func() []string
ProcessDaemonOption are options passed to process when starting.
func POIsRelay ¶
func POIsRelay() ProcessDaemonOption
POIsRelay provides the `--is-relay` to process when starting.
func POSwarmRelayPublic ¶
func POSwarmRelayPublic(a multiaddr.Multiaddr) ProcessDaemonOption
POSwarmRelayPublic provides the `--swarmrelaypublic=<multiaddress>` to process when starting.
type ProcessInitOption ¶
type ProcessInitOption func() []string
ProcessInitOption are options passed to process init.
func POAutoSealIntervalSeconds ¶
func POAutoSealIntervalSeconds(seconds int) ProcessInitOption
POAutoSealIntervalSeconds provides the `--auto-seal-interval-seconds=<seconds>` option to process at init
func PODevnet ¶
func PODevnet(net string) ProcessInitOption
PODevnet provides the `--devnet-<net>` option to process at init
func PODevnetNightly ¶
func PODevnetNightly() ProcessInitOption
PODevnetNightly provides the `--devnet-nightly` option to process at init
func PODevnetStaging ¶
func PODevnetStaging() ProcessInitOption
PODevnetStaging provides the `--devnet-staging` option to process at init
func PODevnetUser ¶
func PODevnetUser() ProcessInitOption
PODevnetUser provides the `--devnet-user` option to process at init
func POGenesisFile ¶
func POGenesisFile(uri string) ProcessInitOption
POGenesisFile provides the `--genesisfile=<uri>` option to process at init
func POPeerKeyFile ¶
func POPeerKeyFile(pkf string) ProcessInitOption
POPeerKeyFile provides the `--peerkeyfile=<path>` option to process at init