diff --git a/lotus-soup/node.go b/lotus-soup/node.go index f9d62d73b..33749add6 100644 --- a/lotus-soup/node.go +++ b/lotus-soup/node.go @@ -207,13 +207,7 @@ func prepareBootstrapper(t *TestEnvironment) (*Node, error) { node.Online(), node.Repo(repo.NewMemory(nil)), node.Override(new(modules.Genesis), modtest.MakeGenesisMem(&genesisBuffer, genesisTemplate)), - node.Override(node.SetApiEndpointKey, func(lr repo.LockedRepo) error { - apima, err := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/1234") - if err != nil { - return err - } - return lr.SetAPIEndpoint(apima) - }), + node.Override(node.SetApiEndpointKey, withApiEndpoint), withListenAddress(bootstrapperIP), withBootstrapper(nil), withPubsubConfig(true, pubsubTracer), @@ -416,13 +410,7 @@ func prepareMiner(t *TestEnvironment) (*Node, error) { node.Online(), node.Repo(minerRepo), node.Override(new(api.FullNode), n.fullApi), - node.Override(node.SetApiEndpointKey, func(lr repo.LockedRepo) error { - apima, err := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/1234") - if err != nil { - return err - } - return lr.SetAPIEndpoint(apima) - }), + node.Override(node.SetApiEndpointKey, withApiEndpoint), withMinerListenAddress(minerIP), } @@ -856,3 +844,11 @@ func startClientAPIServer(repo *repo.MemRepo, api api.FullNode) error { return nil } + +func withApiEndpoint(lr repo.LockedRepo) error { + apima, err := multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/1234") + if err != nil { + return err + } + return lr.SetAPIEndpoint(apima) +}