Register iptb plugin once

This commit was moved from ipfs/go-ipfs-http-client@d6c8cbd5e6
This commit is contained in:
Łukasz Magiera 2019-02-12 12:48:04 +01:00
parent 0813d808b5
commit abc30e384f

View File

@ -19,9 +19,7 @@ import (
"github.com/ipfs/iptb/testbed/interfaces"
)
type NodeProvider struct{}
func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]iface.CoreAPI, error) {
func init() {
_, err := testbed.RegisterPlugin(testbed.IptbPlugin{
From: "<builtin>",
NewNode: local.NewNode,
@ -31,8 +29,13 @@ func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int)
BuiltIn: true,
}, false)
if err != nil {
return nil, err
panic(err)
}
}
type NodeProvider struct{}
func (NodeProvider) MakeAPISwarm(ctx context.Context, fullIdentity bool, n int) ([]iface.CoreAPI, error) {
dir, err := ioutil.TempDir("", "httpapi-tb-")
if err != nil {