Skip to content

Commit

Permalink
wip: debugging
Browse files Browse the repository at this point in the history
  • Loading branch information
bryanchriswhite committed Nov 11, 2023
1 parent 641d60a commit 71052b7
Showing 1 changed file with 9 additions and 26 deletions.
35 changes: 9 additions & 26 deletions pkg/relayer/cmd/cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import (
"github.com/pokt-network/poktroll/pkg/relayer/miner"
"github.com/pokt-network/poktroll/pkg/relayer/proxy"
"github.com/pokt-network/poktroll/pkg/relayer/session"
suppliertypes "github.com/pokt-network/poktroll/x/supplier/types"
)

var (
Expand Down Expand Up @@ -76,11 +75,8 @@ func runRelayer(cmd *cobra.Command, _ []string) error {
return err
}

var relayMiner relayer.RelayMiner
if err := depinject.Inject(
deps,
&relayMiner,
); err != nil {
relayMiner, err := relayer.NewRelayMiner(ctx, deps)
if err != nil {
return err
}

Expand Down Expand Up @@ -139,24 +135,6 @@ func setupRelayerDependencies(
return nil, err
}

//var clientCtx cosmosclient.Context
//if err := depinject.Inject(deps, &clientCtx); err != nil {
// panic(err)
//}

clientCtx, err := cosmosclient.GetClientQueryContext(cmd)
if err != nil {
panic(err)
}
supplierQuerier := suppliertypes.NewQueryClient(clientCtx)
supplierQuery := &suppliertypes.QueryGetSupplierRequest{Address: ""}

log.Printf("clientCtx: %+v", clientCtx)
_, err = supplierQuerier.Supplier(ctx, supplierQuery)
if err != nil {
panic(err)
}

// Depends on clientCtx, txFactory, EventsQueryClient, & BlockClient.
deps, err = supplyTxClient(ctx, deps)
if err != nil {
Expand Down Expand Up @@ -203,12 +181,17 @@ func supplyEventsQueryClient(deps depinject.Config, pocketNodeWebsocketURL strin

// TODO_IN_THIS_COMMIT: move
func getPocketNodeWebsocketURL(cmd *cobra.Command) (string, error) {
pocketNodeURI, err := cmd.Flags().GetString(cosmosflags.FlagNode)
pocketNodeURLStr, err := cmd.Flags().GetString(cosmosflags.FlagNode)
if err != nil {
return "", err
}

pocketNodeURL, err := url.Parse(pocketNodeURLStr)
if err != nil {
return "", err
}

return fmt.Sprintf("ws://%s/websocket", pocketNodeURI), nil
return fmt.Sprintf("ws://%s/websocket", pocketNodeURL.Host), nil
}

func supplyBlockClient(
Expand Down

0 comments on commit 71052b7

Please sign in to comment.