Skip to content

Commit

Permalink
Merge pull request #4203 from filecoin-project/fix/pond-actorsv2
Browse files Browse the repository at this point in the history
Fix pond
  • Loading branch information
magik6k authored Oct 7, 2020
2 parents 0ec2a10 + 1567094 commit f6eb530
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
16 changes: 8 additions & 8 deletions cmd/lotus-storage-miner/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var runCmd = &cli.Command{
Usage: "Start a lotus miner process",
Flags: []cli.Flag{
&cli.StringFlag{
Name: "api",
Name: "miner-api",
Usage: "2345",
},
&cli.BoolFlag{
Expand Down Expand Up @@ -61,7 +61,7 @@ var runCmd = &cli.Command{

nodeApi, ncloser, err := lcli.GetFullNodeAPI(cctx)
if err != nil {
return err
return xerrors.Errorf("getting full node api: %w", err)
}
defer ncloser()
ctx := lcli.DaemonContext(cctx)
Expand Down Expand Up @@ -112,29 +112,29 @@ var runCmd = &cli.Command{
node.Online(),
node.Repo(r),

node.ApplyIf(func(s *node.Settings) bool { return cctx.IsSet("api") },
node.ApplyIf(func(s *node.Settings) bool { return cctx.IsSet("miner-api") },
node.Override(new(dtypes.APIEndpoint), func() (dtypes.APIEndpoint, error) {
return multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/" + cctx.String("api"))
return multiaddr.NewMultiaddr("/ip4/127.0.0.1/tcp/" + cctx.String("miner-api"))
})),
node.Override(new(api.FullNode), nodeApi),
)
if err != nil {
return err
return xerrors.Errorf("creating node: %w", err)
}

endpoint, err := r.APIEndpoint()
if err != nil {
return err
return xerrors.Errorf("getting API endpoint: %w", err)
}

// Bootstrap with full node
remoteAddrs, err := nodeApi.NetAddrsListen(ctx)
if err != nil {
return err
return xerrors.Errorf("getting full node libp2p address: %w", err)
}

if err := minerapi.NetConnect(ctx, remoteAddrs); err != nil {
return err
return xerrors.Errorf("connecting to full node (libp2p): %w", err)
}

log.Infof("Remote version %s", v)
Expand Down
12 changes: 7 additions & 5 deletions lotuspond/spawn.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@ import (
"sync/atomic"
"time"

"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/types"

"github.com/google/uuid"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
"github.com/filecoin-project/go-state-types/abi"
genesis2 "github.com/filecoin-project/lotus/chain/gen/genesis"

"github.com/filecoin-project/lotus/chain/actors/policy"
"github.com/filecoin-project/lotus/chain/gen"
"github.com/filecoin-project/lotus/chain/types"
"github.com/filecoin-project/lotus/cmd/lotus-seed/seed"
"github.com/filecoin-project/lotus/genesis"
)
Expand Down Expand Up @@ -69,6 +69,8 @@ func (api *api) Spawn() (nodeInfo, error) {
Meta: (&genesis.AccountMeta{Owner: genm.Owner}).ActorMeta(),
})
template.VerifregRootKey = gen.DefaultVerifregRootkeyActor
template.RemainderAccount = gen.DefaultRemainderAccountActor
template.NetworkName = "pond-" + uuid.New().String()

tb, err := json.Marshal(&template)
if err != nil {
Expand Down Expand Up @@ -188,7 +190,7 @@ func (api *api) SpawnStorage(fullNodeRepo string) (nodeInfo, error) {

mux := newWsMux()

cmd = exec.Command("./lotus-miner", "run", "--api", fmt.Sprintf("%d", 2500+id), "--nosync")
cmd = exec.Command("./lotus-miner", "run", "--miner-api", fmt.Sprintf("%d", 2500+id), "--nosync")
cmd.Stderr = io.MultiWriter(os.Stderr, errlogfile, mux.errpw)
cmd.Stdout = io.MultiWriter(os.Stdout, logfile, mux.outpw)
cmd.Env = append(os.Environ(), "LOTUS_MINER_PATH="+dir, "LOTUS_PATH="+fullNodeRepo)
Expand Down Expand Up @@ -248,7 +250,7 @@ func (api *api) RestartNode(id int32) (nodeInfo, error) {

var cmd *exec.Cmd
if nd.meta.Storage {
cmd = exec.Command("./lotus-miner", "run", "--api", fmt.Sprintf("%d", 2500+id), "--nosync")
cmd = exec.Command("./lotus-miner", "run", "--miner-api", fmt.Sprintf("%d", 2500+id), "--nosync")
} else {
cmd = exec.Command("./lotus", "daemon", "--api", fmt.Sprintf("%d", 2500+id))
}
Expand Down

0 comments on commit f6eb530

Please sign in to comment.