From f6780ddd95340bc74276d6b437ebea4c826aa319 Mon Sep 17 00:00:00 2001 From: Ian Norden Date: Wed, 10 Mar 2021 10:46:21 -0600 Subject: [PATCH] update go.mod and cmds --- cmd/proxy.go | 17 +++-------------- cmd/serve.go | 2 ++ go.mod | 2 +- go.sum | 4 ++++ 4 files changed, 10 insertions(+), 15 deletions(-) diff --git a/cmd/proxy.go b/cmd/proxy.go index 9dd743f8..a1323e57 100644 --- a/cmd/proxy.go +++ b/cmd/proxy.go @@ -12,7 +12,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/viper" "github.com/vulcanize/gap-filler/pkg/mux" - "github.com/vulcanize/gap-filler/pkg/qlservices" ) var ErrNoRpcEndpoints = errors.New("no rpc endpoints is available") @@ -48,22 +47,12 @@ func proxy() { logWithCommand.Fatal(err) } - rpcBalancer, err := qlservices.NewBalancer(rpcClients) - if err != nil { - logWithCommand.Fatal(err) - } - tracingClients, err := parseRpcAddresses(viper.GetString("rpc.tracing")) if err != nil { logrus.Error("bad rpc.tracing addresses") logWithCommand.Fatal(err) } - tracingBalancer, err := qlservices.NewBalancer(tracingClients) - if err != nil { - logWithCommand.Fatal(err) - } - router, err := mux.NewServeMux(&mux.Options{ BasePath: viper.GetString("http.path"), EnableGraphiQL: viper.GetBool("gql.gui"), @@ -72,8 +61,8 @@ func proxy() { TracingAPI: gqlTracingAPIAddr, }, RPC: mux.RPCOptions{ - DefaultBalancer: rpcBalancer, - TracingBalancer: tracingBalancer, + DefaultClients: rpcClients, + TracingClients: tracingClients, }, }) if err != nil { @@ -112,7 +101,7 @@ func init() { // flags proxyCmd.PersistentFlags().String("http-host", "127.0.0.1", "http host") - proxyCmd.PersistentFlags().String("http-port", "8080", "http port") + proxyCmd.PersistentFlags().String("http-port", "8083", "http port") proxyCmd.PersistentFlags().String("http-path", "/", "http base path") proxyCmd.PersistentFlags().String("rpc-eth", "http://127.0.0.1:8545", "comma separated ethereum rpc addresses. Example http://127.0.0.1:8545,http://127.0.0.2:8545") diff --git a/cmd/serve.go b/cmd/serve.go index 6c4dfdf6..f539b218 100644 --- a/cmd/serve.go +++ b/cmd/serve.go @@ -138,6 +138,7 @@ func init() { serveCmd.PersistentFlags().String("eth-default-sender", "", "default sender address") serveCmd.PersistentFlags().String("eth-rpc-gas-cap", "", "rpc gas cap (for eth_Call execution)") serveCmd.PersistentFlags().String("eth-chain-config", "", "json chain config file location") + serveCmd.PersistentFlags().Bool("eth-supports-state-diff", false, "whether or not the proxy ethereum client supports statediffing endpoints") // and their bindings viper.BindPFlag("server.graphql", serveCmd.PersistentFlags().Lookup("server-graphql")) @@ -155,4 +156,5 @@ func init() { viper.BindPFlag("ethereum.defaultSender", serveCmd.PersistentFlags().Lookup("eth-default-sender")) viper.BindPFlag("ethereum.rpcGasCap", serveCmd.PersistentFlags().Lookup("eth-rpc-gas-cap")) viper.BindPFlag("ethereum.chainConfig", serveCmd.PersistentFlags().Lookup("eth-chain-config")) + viper.BindPFlag("ethereum.supportsStateDiff", serveCmd.PersistentFlags().Lookup("eth-supports-state-diff")) } diff --git a/go.mod b/go.mod index 9bcb2c7f..2d07688b 100644 --- a/go.mod +++ b/go.mod @@ -20,7 +20,7 @@ require ( github.com/spf13/cobra v1.1.1 github.com/spf13/viper v1.7.0 github.com/vulcanize/ipld-eth-indexer v0.7.1-alpha - github.com/vulcanize/gap-filler v0.3.0 + github.com/vulcanize/gap-filler v0.3.1 github.com/vulcanize/ipfs-ethdb v0.0.2-alpha golang.org/x/sys v0.0.0-20210218155724-8ebf48af031b // indirect ) diff --git a/go.sum b/go.sum index 4049c556..ea9e7433 100644 --- a/go.sum +++ b/go.sum @@ -453,6 +453,8 @@ github.com/jedisct1/go-minisign v0.0.0-20190909160543-45766022959e/go.mod h1:G1C github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU= github.com/jessevdk/go-flags v0.0.0-20141203071132-1679536dcc89/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= +github.com/jinzhu/copier v0.2.4 h1:dT3tI+8GzU8DjJFCj9mLYtjfRtUmK7edauduQdcZCpI= +github.com/jinzhu/copier v0.2.4/go.mod h1:24xnZezI2Yqac9J61UC6/dG/k76ttpq0DdJI3QmUvro= github.com/jmespath/go-jmespath v0.0.0-20180206201540-c2b33e8439af/go.mod h1:Nht3zPeWKUH0NzdCt2Blrr5ys8VGpn0CEB0cQHVjt7k= github.com/jmoiron/sqlx v1.2.0 h1:41Ip0zITnmWNR/vHV+S4m+VoUivnWY5E4OJfLZjCJMA= github.com/jmoiron/sqlx v1.2.0/go.mod h1:1FEQNm3xlJgrMD+FBdI9+xvCksHtbpVBBw5dYhBSsks= @@ -1005,6 +1007,8 @@ github.com/viant/assertly v0.4.8/go.mod h1:aGifi++jvCrUaklKEKT0BU95igDNaqkvz+49u github.com/viant/toolbox v0.24.0/go.mod h1:OxMCG57V0PXuIP2HNQrtJf2CjqdmbrOx5EkMILuUhzM= github.com/vulcanize/gap-filler v0.3.0 h1:SaBrOxlxCDPbSA902K/46iELH8yM3BqhvBuXK1ktFDI= github.com/vulcanize/gap-filler v0.3.0/go.mod h1:4odsXyckNU1xdXk37qXY2SbxUM6oDpQrpWZtEHfq+0w= +github.com/vulcanize/gap-filler v0.3.1 h1:N5d+jCJo/VTWFvBSbTD7biRhK/OqDZzi1tgA85SIBKs= +github.com/vulcanize/gap-filler v0.3.1/go.mod h1:qowG1cgshVpBqMokiWro/1xhh0uypw7oAu8FQ42JMy4= github.com/vulcanize/go-ethereum v1.9.11-statediff-0.0.5 h1:U+BqhjRLR22e9OEm8cgWC3Eq3bh8G6azjNpXeenfCG4= github.com/vulcanize/go-ethereum v1.9.11-statediff-0.0.5/go.mod h1:7oC0Ni6dosMv5pxMigm6s0hN8g4haJMBnqmmo0D9YfQ= github.com/vulcanize/go-ethereum v1.9.11-statediff-0.0.8 h1:7TK52k55uvSl+1SCKYYFelzH1NrpvEcDrpeU9nUDIpI=