migrate-fix

This commit is contained in:
Andrew Jackson (Ajax) 2023-11-14 15:33:08 -06:00
parent 63b130aa5e
commit 68cef72fb7

View File

@ -6,12 +6,13 @@ import (
"encoding/base64" "encoding/base64"
"errors" "errors"
"fmt" "fmt"
"github.com/filecoin-project/go-address"
"github.com/ipfs/go-datastore"
"os" "os"
"path" "path"
"strings" "strings"
"github.com/filecoin-project/go-address"
"github.com/ipfs/go-datastore"
"github.com/BurntSushi/toml" "github.com/BurntSushi/toml"
"github.com/samber/lo" "github.com/samber/lo"
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
@ -151,6 +152,7 @@ func fromMiner(cctx *cli.Context) (err error) {
if err != nil { if err != nil {
return xerrors.Errorf("error getting JWTSecretName: %w", err) return xerrors.Errorf("error getting JWTSecretName: %w", err)
} }
lpCfg.Apis.StorageRPCSecret = base64.StdEncoding.EncodeToString(js.PrivateKey) lpCfg.Apis.StorageRPCSecret = base64.StdEncoding.EncodeToString(js.PrivateKey)
// Populate API Key // Populate API Key
@ -159,7 +161,11 @@ func fromMiner(cctx *cli.Context) (err error) {
return fmt.Errorf("cannot read API: %w", err) return fmt.Errorf("cannot read API: %w", err)
} }
lpCfg.Apis.ChainApiInfo = []string{header.Get("Authorization")[7:]} ainfo, err := cliutil.GetAPIInfo(&cli.Context{}, repo.FullNode)
if err != nil {
return xerrors.Errorf("could not get API info for FullNode: %w", err)
}
lpCfg.Apis.ChainApiInfo = []string{header.Get("Authorization")[7:] + ":" + ainfo.Addr}
// Enable WindowPoSt // Enable WindowPoSt
lpCfg.Subsystems.EnableWindowPost = true lpCfg.Subsystems.EnableWindowPost = true