Documentation ¶
Index ¶
- Variables
- type Localfilecoin
- func (l *Localfilecoin) APIAddr() (string, error)
- func (l *Localfilecoin) Config() (interface{}, error)
- func (l *Localfilecoin) Connect(ctx context.Context, n testbedi.Core) error
- func (l *Localfilecoin) Dir() string
- func (l *Localfilecoin) Errorf(format string, args ...interface{})
- func (l *Localfilecoin) Events() (io.ReadCloser, error)
- func (l *Localfilecoin) GetMetricDesc(key string) (string, error)
- func (l *Localfilecoin) GetMetricList() []string
- func (l *Localfilecoin) GetPeerID() (cid.Cid, error)
- func (l *Localfilecoin) Heartbeat() (map[string]string, error)
- func (l *Localfilecoin) Infof(format string, args ...interface{})
- func (l *Localfilecoin) Init(ctx context.Context, args ...string) (testbedi.Output, error)
- func (l *Localfilecoin) Metric(key string) (string, error)
- func (l *Localfilecoin) PeerID() (string, error)
- func (l *Localfilecoin) RunCmd(ctx context.Context, stdin io.Reader, args ...string) (testbedi.Output, error)
- func (l *Localfilecoin) Shell(ctx context.Context, ns []testbedi.Core) error
- func (l *Localfilecoin) Start(ctx context.Context, wait bool, args ...string) (testbedi.Output, error)
- func (l *Localfilecoin) StderrReader() (io.ReadCloser, error)
- func (l *Localfilecoin) StdoutReader() (io.ReadCloser, error)
- func (l *Localfilecoin) Stop(ctx context.Context) error
- func (l *Localfilecoin) String() string
- func (l *Localfilecoin) SwarmAddrs() ([]string, error)
- func (l *Localfilecoin) Type() string
- func (l *Localfilecoin) WriteConfig(cfg interface{}) error
Constants ¶
This section is empty.
Variables ¶
var ( // AttrFilecoinBinary is the key used to set which binary to use in the plugin through NewNode attrs AttrFilecoinBinary = "filecoinBinary" // AttrLogLevel is the key used to set the log level through NewNode attrs AttrLogLevel = "logLevel" // AttrLogJSON is the key used to set the node to output json logs AttrLogJSON = "logJSON" // AttrRustLogLevel is the key used to set the node to output rust logs AttrRustLogLevel = "rustLogLevel" // AttrSectorsPath is the key used to set the sectors path AttrSectorsPath = "sectorsPath" )
var NewNode testbedi.NewNodeFunc // nolint: golint
var PluginName = "localfilecoin"
PluginName is the name of the plugin
Functions ¶
This section is empty.
Types ¶
type Localfilecoin ¶
type Localfilecoin struct {
// contains filtered or unexported fields
}
Localfilecoin represents a filecoin node
func (*Localfilecoin) APIAddr ¶
func (l *Localfilecoin) APIAddr() (string, error)
APIAddr returns the api address of the node.
func (*Localfilecoin) Config ¶
func (l *Localfilecoin) Config() (interface{}, error)
Config returns the nodes config.
func (*Localfilecoin) Connect ¶
func (l *Localfilecoin) Connect(ctx context.Context, n testbedi.Core) error
Connect connects the node to another testbed node.
func (*Localfilecoin) Dir ¶
func (l *Localfilecoin) Dir() string
Dir returns the IPTB directory the node is using.
func (*Localfilecoin) Errorf ¶
func (l *Localfilecoin) Errorf(format string, args ...interface{})
Errorf writes an error log.
func (*Localfilecoin) Events ¶
func (l *Localfilecoin) Events() (io.ReadCloser, error)
Events not implemented
func (*Localfilecoin) GetMetricDesc ¶
func (l *Localfilecoin) GetMetricDesc(key string) (string, error)
GetMetricDesc not implemented
func (*Localfilecoin) GetMetricList ¶
func (l *Localfilecoin) GetMetricList() []string
GetMetricList not implemented
func (*Localfilecoin) GetPeerID ¶
func (l *Localfilecoin) GetPeerID() (cid.Cid, error)
GetPeerID returns the nodes peerID by running its `id` command. TODO this a temp fix, should read the nodes keystore instead
func (*Localfilecoin) Heartbeat ¶
func (l *Localfilecoin) Heartbeat() (map[string]string, error)
Heartbeat not implemented
func (*Localfilecoin) Infof ¶
func (l *Localfilecoin) Infof(format string, args ...interface{})
Infof writes an info log.
func (*Localfilecoin) Init ¶
func (l *Localfilecoin) Init(ctx context.Context, args ...string) (testbedi.Output, error)
Init runs the node init process.
func (*Localfilecoin) Metric ¶
func (l *Localfilecoin) Metric(key string) (string, error)
Metric not implemented
func (*Localfilecoin) PeerID ¶
func (l *Localfilecoin) PeerID() (string, error)
PeerID returns the nodes peerID.
func (*Localfilecoin) RunCmd ¶
func (l *Localfilecoin) RunCmd(ctx context.Context, stdin io.Reader, args ...string) (testbedi.Output, error)
RunCmd runs a command in the context of the node.
func (*Localfilecoin) Shell ¶
func (l *Localfilecoin) Shell(ctx context.Context, ns []testbedi.Core) error
Shell starts a user shell in the context of a node setting VENUS_PATH to ensure calls to venus will be ran agasint the target node. Stderr, stdout will be set to os.Stderr and os.Stdout. If env TTY is set, it will be used for stdin, otherwise os.Stdin will be used.
If VENUS_PATH is already set, an error will be returned.
The shell environment will have the follow variables set in the shell for the user.
NODE0-NODE# - set to the PeerID for each value in ns passed. VENUS_PATH - The value is set to the directory for the Filecoin node. FIL_PID - The value is set to the pid for the Filecoin daemon FIL_BINARY - The value is set to the path of the binary used for running the Filecoin daemon. PATH - The users PATH will be updated to include a location that contains the FIL_BINARY.
Note: user shell configuration may lead to the `venus` command not pointing to FIL_BINARY, due to PATH ordering.
func (*Localfilecoin) Start ¶
func (l *Localfilecoin) Start(ctx context.Context, wait bool, args ...string) (testbedi.Output, error)
Start starts the node process.
func (*Localfilecoin) StderrReader ¶
func (l *Localfilecoin) StderrReader() (io.ReadCloser, error)
StderrReader provides an io.ReadCloser to the running daemons stderr
func (*Localfilecoin) StdoutReader ¶
func (l *Localfilecoin) StdoutReader() (io.ReadCloser, error)
StdoutReader provides an io.ReadCloser to the running daemons stdout
func (*Localfilecoin) Stop ¶
func (l *Localfilecoin) Stop(ctx context.Context) error
Stop stops the node process.
func (*Localfilecoin) String ¶
func (l *Localfilecoin) String() string
String implements the stringr interface.
func (*Localfilecoin) SwarmAddrs ¶
func (l *Localfilecoin) SwarmAddrs() ([]string, error)
SwarmAddrs returns the addresses a node is listening on for swarm connections.
func (*Localfilecoin) Type ¶
func (l *Localfilecoin) Type() string
Type returns the type of the node.
func (*Localfilecoin) WriteConfig ¶
func (l *Localfilecoin) WriteConfig(cfg interface{}) error
WriteConfig writes a nodes config file.