diff --git a/client/client.go b/client/client.go index bd6b54f7..0c1f39aa 100644 --- a/client/client.go +++ b/client/client.go @@ -5,12 +5,12 @@ import ( "fmt" "reflect" - "github.com/spf13/pflag" "golang.org/x/net/context" sdkclient "github.com/cosmos/cosmos-sdk/client" aclient "github.com/akash-network/akash-api/go/node/client" + cltypes "github.com/akash-network/akash-api/go/node/client/types" "github.com/akash-network/akash-api/go/node/client/v1beta2" ) @@ -37,9 +37,10 @@ func DiscoverQueryClient(ctx context.Context, cctx sdkclient.Context) (v1beta2.Q return cl, nil } -func DiscoverClient(ctx context.Context, cctx sdkclient.Context, flags *pflag.FlagSet) (v1beta2.Client, error) { +func DiscoverClient(ctx context.Context, cctx sdkclient.Context, opts ...cltypes.ClientOption) (v1beta2.Client, error) { var cl v1beta2.Client - err := aclient.DiscoverClient(ctx, cctx, flags, func(i interface{}) error { + + setupFn := func(i interface{}) error { var valid bool if cl, valid = i.(v1beta2.Client); !valid { @@ -47,7 +48,9 @@ func DiscoverClient(ctx context.Context, cctx sdkclient.Context, flags *pflag.Fl } return nil - }) + } + + err := aclient.DiscoverClient(ctx, cctx, setupFn, opts...) if err != nil { return nil, err diff --git a/cmd/provider-services/cmd/run.go b/cmd/provider-services/cmd/run.go index cb36d18a..5eeec75e 100644 --- a/cmd/provider-services/cmd/run.go +++ b/cmd/provider-services/cmd/run.go @@ -11,6 +11,7 @@ import ( "strings" "time" + cltypes "github.com/akash-network/akash-api/go/node/client/types" sdkclient "github.com/cosmos/cosmos-sdk/client" "github.com/pkg/errors" "github.com/shopspring/decimal" @@ -542,7 +543,13 @@ func doRunCmd(ctx context.Context, cmd *cobra.Command, _ []string) error { } cctx = cctx.WithSkipConfirmation(true) - cl, err := client.DiscoverClient(ctx, cctx, cmd.Flags()) + + opts, err := cltypes.ClientOptionsFromFlags(cmd.Flags()) + if err != nil { + return err + } + + cl, err := client.DiscoverClient(ctx, cctx, opts...) if err != nil { return err } diff --git a/go.mod b/go.mod index 8b136ea6..865063a4 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/akash-network/provider go 1.21 require ( - github.com/akash-network/akash-api v0.0.55 + github.com/akash-network/akash-api v0.0.56 github.com/akash-network/node v0.30.3 github.com/avast/retry-go/v4 v4.5.0 github.com/blang/semver/v4 v4.0.0 diff --git a/go.sum b/go.sum index 16b4a7a8..30b4befd 100644 --- a/go.sum +++ b/go.sum @@ -197,8 +197,8 @@ github.com/afex/hystrix-go v0.0.0-20180502004556-fa1af6a1f4f5/go.mod h1:SkGFH1ia github.com/agnivade/levenshtein v1.0.1/go.mod h1:CURSv5d9Uaml+FovSIICkLbAUZ9S4RqaHDIsdSBg7lM= github.com/ajg/form v1.5.1/go.mod h1:uL1WgH+h2mgNtvBq0339dVnzXdBETtL2LeUXaIv25UY= github.com/ajstarks/svgo v0.0.0-20180226025133-644b8db467af/go.mod h1:K08gAheRH3/J6wwsYMMT4xOr94bZjxIelGM0+d/wbFw= -github.com/akash-network/akash-api v0.0.55 h1:koRFImeVbEggkWGEQ97U+qHuryQ/LRDg5yHqnGmMXcg= -github.com/akash-network/akash-api v0.0.55/go.mod h1:pNr61L4+0sheol7ZK0HjgK3rxpIAbYBGq1w1oH4B0+M= +github.com/akash-network/akash-api v0.0.56 h1:dUiDR7DXeMXgh9xyxCik4gznTsjSJhi8Pq3iPcZoqSc= +github.com/akash-network/akash-api v0.0.56/go.mod h1:pNr61L4+0sheol7ZK0HjgK3rxpIAbYBGq1w1oH4B0+M= github.com/akash-network/cometbft v0.34.27-akash h1:V1dApDOr8Ee7BJzYyQ7Z9VBtrAul4+baMeA6C49dje0= github.com/akash-network/cometbft v0.34.27-akash/go.mod h1:BcCbhKv7ieM0KEddnYXvQZR+pZykTKReJJYf7YC7qhw= github.com/akash-network/ledger-go v0.14.3 h1:LCEFkTfgGA2xFMN2CtiKvXKE7dh0QSM77PJHCpSkaAo=