Skip to content

Commit

Permalink
Added grpc endpoint as a config variable
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrolomanto authored and p0mvn committed Jul 3, 2024
1 parent 1632630 commit f7c0385
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"logger-is-production": true,
"logger-level": "info",
"grpc-gateway-endpoint": "http://localhost:26657",
"grpc-endpoint": "http://localhost:9090",
"chain-id": "osmosis-1",
"chain-registry-assets-url": "https://raw.githubusercontent.com/osmosis-labs/assetlists/main/osmosis-1/generated/frontend/assetlist.json",
"router": {
Expand Down
1 change: 1 addition & 0 deletions domain/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type Config struct {
LoggerLevel string `mapstructure:"logger-level"`

ChainGRPCGatewayEndpoint string `mapstructure:"grpc-gateway-endpoint"`
ChainGRPCEndpoint string `mapstructure:"grpc-endpoint"`

Check failure on line 16 in domain/config.go

View workflow job for this annotation

GitHub Actions / Run linter

File is not `gofmt`-ed with `-s` (gofmt)
ChainID string `mapstructure:"chain-id"`

// Chain registry assets URL.
Expand Down
4 changes: 3 additions & 1 deletion router/usecase/pools/cosmwasm_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,19 @@ import (
wasmtypes "github.com/CosmWasm/wasmd/x/wasm/types"
"github.com/cosmos/cosmos-sdk/client"
"github.com/osmosis-labs/sqs/sqsdomain/json"

Check failure on line 8 in router/usecase/pools/cosmwasm_utils.go

View workflow job for this annotation

GitHub Actions / Run linter

File is not `gofmt`-ed with `-s` (gofmt)
"github.com/osmosis-labs/sqs/domain"
"go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc"
"google.golang.org/grpc"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/metadata"
)

var config domain.Config
// initializeWasmClient initializes the wasm client given the node URI
// Returns error if fails to initialize the client
func initializeWasmClient(nodeURI string) (wasmtypes.QueryClient, error) {

Check failure on line 19 in router/usecase/pools/cosmwasm_utils.go

View workflow job for this annotation

GitHub Actions / Run linter

`initializeWasmClient` - `nodeURI` is unused (unparam)
clientContext := client.Context{}
grpcClient, err := grpc.NewClient("osmosis:9090",
grpcClient, err := grpc.NewClient(config.ChainGRPCEndpoint,
grpc.WithTransportCredentials(insecure.NewCredentials()),
grpc.WithStatsHandler(otelgrpc.NewClientHandler()),
)
Expand Down

0 comments on commit f7c0385

Please sign in to comment.