Skip to content

Commit

Permalink
cu?
Browse files Browse the repository at this point in the history
  • Loading branch information
pkieltyka committed Aug 7, 2023
1 parent 24e1b43 commit c98a4c2
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 6 additions & 4 deletions cmd/chain-ws-head2/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand All @@ -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 {
Expand All @@ -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)
}
}

Expand Down
3 changes: 0 additions & 3 deletions ethmonitor/ethmonitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit c98a4c2

Please sign in to comment.