why does proxygen crash

This commit is contained in:
Andrew Jackson (Ajax) 2023-10-18 16:47:00 -05:00
parent e548b46dbf
commit 6695a2d936
3 changed files with 14 additions and 3 deletions

View File

@ -168,7 +168,7 @@ func GetRawAPIMultiV2(ctx *cli.Context, ainfoCfg []string, version string) ([]Ht
var httpHeads []HttpHead var httpHeads []HttpHead
if len(ainfoCfg) == 0 { if len(ainfoCfg) == 0 {
return httpHeads, xerrors.Errorf("could not get API info: none configured") return httpHeads, xerrors.Errorf("could not get API info: none configured. \nConsider getting base.toml with './lotus-provider config get base' \nthen adding \n[APIs] \ndaemon = [\"lotusdaemon:1234\"]\n and updating it with './lotus-provider config set base.toml'")
} }
for _, i := range ainfoCfg { for _, i := range ainfoCfg {
ainfo := ParseApiInfo(i) ainfo := ParseApiInfo(i)
@ -445,7 +445,7 @@ func GetFullNodeAPIV1LotusProvider(ctx *cli.Context, ainfoCfg []string, opts ...
for _, head := range heads { for _, head := range heads {
v1api, closer, err := client.NewFullNodeRPCV1(ctx.Context, head.addr, head.header, rpcOpts...) v1api, closer, err := client.NewFullNodeRPCV1(ctx.Context, head.addr, head.header, rpcOpts...)
if err != nil { if err != nil {
log.Warnf("Not able to establish connection to node with addr: ", head.addr) log.Warnf("Not able to establish connection to node with addr: %s", head.addr)
continue continue
} }
fullNodes = append(fullNodes, v1api) fullNodes = append(fullNodes, v1api)

View File

@ -217,7 +217,8 @@ var configViewCmd = &cli.Command{
func getConfig(cctx *cli.Context, db *harmonydb.DB) (*config.LotusProviderConfig, error) { func getConfig(cctx *cli.Context, db *harmonydb.DB) (*config.LotusProviderConfig, error) {
lp := config.DefaultLotusProvider() lp := config.DefaultLotusProvider()
have := []string{} have := []string{}
for _, layer := range cctx.StringSlice("layers") { layers := cctx.StringSlice("layers")
for _, layer := range layers {
text := "" text := ""
err := db.QueryRow(cctx.Context, `SELECT config FROM harmony_config WHERE title=$1`, layer).Scan(&text) err := db.QueryRow(cctx.Context, `SELECT config FROM harmony_config WHERE title=$1`, layer).Scan(&text)
if err != nil { if err != nil {

View File

@ -16,6 +16,7 @@ import (
"github.com/urfave/cli/v2" "github.com/urfave/cli/v2"
"go.opencensus.io/stats" "go.opencensus.io/stats"
"go.opencensus.io/tag" "go.opencensus.io/tag"
"golang.org/x/xerrors"
"github.com/filecoin-project/go-jsonrpc/auth" "github.com/filecoin-project/go-jsonrpc/auth"
"github.com/filecoin-project/go-statestore" "github.com/filecoin-project/go-statestore"
@ -68,6 +69,11 @@ var runCmd = &cli.Command{
Usage: "manage open file limit", Usage: "manage open file limit",
Value: true, Value: true,
}, },
&cli.StringSliceFlag{
Name: "layers",
Usage: "list of layers to be interpreted (atop defaults). Default: base",
Value: cli.NewStringSlice("base"),
},
}, },
Action: func(cctx *cli.Context) (err error) { Action: func(cctx *cli.Context) (err error) {
defer func() { defer func() {
@ -189,6 +195,9 @@ var runCmd = &cli.Command{
log.Error("closing repo", err) log.Error("closing repo", err)
} }
}() }()
if err := lr.SetAPIToken([]byte(address)); err != nil { // our assigned listen address is our unique token
return xerrors.Errorf("setting api token: %w", err)
}
localStore, err := paths.NewLocal(ctx, lr, nil, []string{"http://" + address + "/remote"}) localStore, err := paths.NewLocal(ctx, lr, nil, []string{"http://" + address + "/remote"})
if err != nil { if err != nil {
return err return err
@ -229,6 +238,7 @@ var runCmd = &cli.Command{
return err return err
} }
defer fullCloser() defer fullCloser()
sa, err := modules.StorageAuth(ctx, full) sa, err := modules.StorageAuth(ctx, full)
if err != nil { if err != nil {
return err return err