fix serve command for ipld graphql server

This commit is contained in:
ramil
2021-04-16 16:56:02 +03:00
parent 75debec01a
commit 31cbaec567
2 changed files with 13 additions and 8 deletions
+9 -7
View File
@@ -164,14 +164,18 @@ func startIpldGraphQL(settings *s.Config) error {
return err
}
ethClients, err := parseRpcAddresses(viper.GetString("ethereum.httpPath"))
ethClients, err := parseRpcAddresses(settings.EthHttpEndpoint)
if err != nil {
return err
}
tracingClients, err := parseRpcAddresses(viper.GetString("tracing.httpPath"))
if err != nil {
return err
var tracingClients []*rpc.Client
tracingEndpoint := viper.GetString("tracing.httpPath")
if tracingEndpoint != "" {
tracingClients, err = parseRpcAddresses(tracingEndpoint)
if err != nil {
return err
}
}
router, err := mux.NewServeMux(&mux.Options{
@@ -190,9 +194,7 @@ func startIpldGraphQL(settings *s.Config) error {
return err
}
if err := http.ListenAndServe(settings.IpldGraphqlEndpoint, router); err != nil {
logWithCommand.Fatal(err)
}
go http.ListenAndServe(settings.IpldGraphqlEndpoint, router)
} else {
logWithCommand.Info("IPLD GraphQL server is disabled")
}