allow verifreg commands in lotus-shed to be run against a gateway

They still expect a 'full node api', but are in practice used with a gateway. Changes to the primary gateway to restrict available methods mean that it's preferable to have only the methods available on the gateay in use for these commands
This commit is contained in:
Will Scott
2025-05-07 16:09:52 -07:00
parent 168e48def8
commit 37245a2af0

View File

@ -80,7 +80,20 @@ var verifRegAddVerifierFromMsigCmd = &cli.Command{
api := srv.FullNodeAPI()
ctx := lcli.ReqContext(cctx)
vrk, err := api.StateVerifiedRegistryRootKey(ctx, types.EmptyTSK)
vact, err := api.StateGetActor(ctx, verifreg.Address, types.EmptyTSK)
if err != nil {
return err
}
apibs := blockstore.NewAPIBlockstore(api)
store := adt.WrapStore(ctx, cbor.NewCborStore(apibs))
vst, err := verifreg.Load(store, vact)
if err != nil {
return err
}
vrk, err := vst.RootKey()
if err != nil {
return err
}
@ -460,7 +473,20 @@ var verifRegRemoveVerifiedClientDataCapCmd = &cli.Command{
return err
}
vrk, err := api.StateVerifiedRegistryRootKey(ctx, types.EmptyTSK)
vact, err := api.StateGetActor(ctx, verifreg.Address, types.EmptyTSK)
if err != nil {
return err
}
apibs := blockstore.NewAPIBlockstore(api)
store := adt.WrapStore(ctx, cbor.NewCborStore(apibs))
vst, err := verifreg.Load(store, vact)
if err != nil {
return err
}
vrk, err := vst.RootKey()
if err != nil {
return err
}
@ -470,9 +496,6 @@ var verifRegRemoveVerifiedClientDataCapCmd = &cli.Command{
return err
}
apibs := blockstore.NewAPIBlockstore(api)
store := adt.WrapStore(ctx, cbor.NewCborStore(apibs))
st, err := multisig.Load(store, vrkState)
if err != nil {
return fmt.Errorf("load vrk failed: %w ", err)