diff --git a/cmd/chain-ws-head2/main.go b/cmd/chain-ws-head2/main.go index d00e5749..cafe4d53 100644 --- a/cmd/chain-ws-head2/main.go +++ b/cmd/chain-ws-head2/main.go @@ -2,12 +2,12 @@ package main import ( "context" + "encoding/json" "fmt" "log" "github.com/0xsequence/ethkit/go-ethereum/rpc" "github.com/0xsequence/ethkit/util" - "github.com/davecgh/go-spew/spew" ) func main() { @@ -17,10 +17,10 @@ func main() { } // nodeWebsocketURL := testConfig["MAINNET_WSS_URL"] - // nodeWebsocketURL := testConfig["POLYGON_MAINNET_WSS_URL"] + nodeWebsocketURL := testConfig["POLYGON_MAINNET_WSS_URL"] // nodeWebsocketURL := testConfig["POLYGON_ZKEVM_WSS_URL"] // nodeWebsocketURL := testConfig["ARBITRUM_MAINNET_WSS_URL"] - nodeWebsocketURL := testConfig["OPTIMISM_MAINNET_WSS_URL"] + // nodeWebsocketURL := testConfig["OPTIMISM_MAINNET_WSS_URL"] client, err := rpc.Dial(nodeWebsocketURL) if err != nil { @@ -46,7 +46,9 @@ func main() { log.Fatal(fmt.Errorf("websocket error %w", err)) case data := <-ch: - spew.Dump(data) + v, _ := json.Marshal(data) + fmt.Println(string(v)) + fmt.Println("# bytes??", len(v), "CU?", float64(len(v))*.04) } } diff --git a/ethmonitor/ethmonitor.go b/ethmonitor/ethmonitor.go index 0ba99bc7..0a671d90 100644 --- a/ethmonitor/ethmonitor.go +++ b/ethmonitor/ethmonitor.go @@ -101,9 +101,6 @@ func NewMonitor(provider ethrpc.Interface, options ...Options) (*Monitor, error) opts = options[0] } - // TODO: in the future, consider using a multi-provider, and querying data from multiple - // sources to ensure all matches. we could build this directly inside of ethrpc too - // TODO: lets see if we can use ethrpc websocket for this set of data if opts.Logger == nil {