Documentation ¶
Index ¶
- func MustImportGenesisMiner(tn *TestNode, gi *GenesisInfo)
- func NewIPTBTestbed(count int, typ, dir string, attrs map[string]string) (iptb.Testbed, error)
- func ReadSetup(t *testing.T, setupPath string) *gengen.GenesisCfg
- type GenesisInfo
- type TestNode
- func (tn *TestNode) MustConnect(ctx context.Context, peer *TestNode)
- func (tn *TestNode) MustInit(ctx context.Context, args ...string) *TestNode
- func (tn *TestNode) MustInitWithGenesis(ctx context.Context, genesisinfo *GenesisInfo, args ...string) *TestNode
- func (tn *TestNode) MustRunCmd(ctx context.Context, args ...string) (stdout, stderr string)
- func (tn *TestNode) MustRunCmdJSON(ctx context.Context, expOut interface{}, args ...string)
- func (tn *TestNode) MustStart(ctx context.Context, args ...string) *TestNode
- func (tn *TestNode) MustStop(ctx context.Context)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MustImportGenesisMiner ¶
func MustImportGenesisMiner(tn *TestNode, gi *GenesisInfo)
MustImportGenesisMiner configures a node from the GenesisInfo and starts it mining. The node should already be initialized with the GenesisFile, and be should started.
func NewIPTBTestbed ¶
NewIPTBTestbed creates an iptb testebed of size `count`. "localfilecoin" or "dockerfilecoin" may be passed for `type`.
Types ¶
type GenesisInfo ¶
type GenesisInfo struct { GenesisFile string KeyFile string WalletAddress string MinerAddress string SectorsDir string PresealedSectorDir string }
GenesisInfo chains require information to start a single node with funds
func RequireGenerateGenesis ¶
func RequireGenerateGenesis(t *testing.T, funds int64, dir string, genesisTime time.Time) *GenesisInfo
RequireGenerateGenesis constructs the required information and files to build a single filecoin node with the provided funds. The GenesisInfo can be used with MustImportGenesisMiner
func RequireGenesis ¶
func RequireGenesis(t *testing.T, dir string, cfg *gengen.GenesisCfg) *GenesisInfo
RequireGenesis generates a genesis block and metadata from config
func RequireGenesisFromSetup ¶
func RequireGenesisFromSetup(t *testing.T, dir string, setupPath string) *GenesisInfo
RequireGenesisFromSetup constructs the required information and files to build a single filecoin node from a genesis configuration file. The GenesisInfo can be used with MustImportGenesisMiner
type TestNode ¶
TestNode is a wrapper around an iptb core node interface.
func NewTestNodes ¶
NewTestNodes returns `count` TestNodes, and error is returned if a failure is encoundered.
func (*TestNode) MustConnect ¶
MustConnect will connect TestNode to TestNode `peer`, testing.Fatal will be called if connecting fails.
func (*TestNode) MustInit ¶
MustInit inits TestNode, passing `args` to the init command. testing.Fatal is called if initing fails, or exits with and exitcode > 0.
func (*TestNode) MustInitWithGenesis ¶
func (tn *TestNode) MustInitWithGenesis(ctx context.Context, genesisinfo *GenesisInfo, args ...string) *TestNode
MustInitWithGenesis init TestNode, passing in the `--genesisfile` flag, by calling MustInit
func (*TestNode) MustRunCmd ¶
MustRunCmd runs `args` against TestNode. MustRunCmd returns stderr and stdout after running the command successfully. If the command exits with an exitcode > 0, the MustRunCmd will call testing.Fatal and print the error.
func (*TestNode) MustRunCmdJSON ¶
MustRunCmdJSON runs `args` against TestNode. The '--enc=json' flag is appened to the command specified by `args`, the result of the command is marshaled into `expOut`.