Skip to content

Commit

Permalink
add back default rlps config
Browse files Browse the repository at this point in the history
  • Loading branch information
ryandotsmith committed Oct 1, 2023
1 parent 12e1d66 commit 42e2b73
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
16 changes: 13 additions & 3 deletions cmd/e2pg/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,20 @@
"name": "mainnet",
"id": 1,
"chain": 1,
"concurrency": 1,
"batch": 8,
"eth": "http://hera:8545",
"concurrency": 8,
"batch": 128,
"eth": "https://1.rlps.indexsupply.net",
"pg": "postgres:///e2pg",
"integrations": ["erc721", "erc1155"]
},
{
"name": "bedrock",
"id": 2,
"chain": 10,
"concurrency": 8,
"batch": 1024,
"eth": "http://10.rlps.indexsupply.net",
"pg": "postgres:///e2pg",
"integrations": ["erc20"]
}
]
14 changes: 2 additions & 12 deletions e2pg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,10 @@ import (
"strings"

"github.com/indexsupply/x/e2pg"
"github.com/indexsupply/x/freezer"
"github.com/indexsupply/x/integrations/erc1155"
"github.com/indexsupply/x/integrations/erc20"
"github.com/indexsupply/x/integrations/erc4337"
"github.com/indexsupply/x/integrations/erc721"
"github.com/indexsupply/x/jrpc"
"github.com/indexsupply/x/jrpc2"
"github.com/indexsupply/x/rlps"
"github.com/jackc/pgx/v5/pgxpool"
Expand Down Expand Up @@ -124,17 +122,9 @@ func parseNode(url, fpath string) (e2pg.Node, error) {
case strings.Contains(url, "rlps"):
return rlps.NewClient(url), nil
case strings.HasPrefix(url, "http"):
//rc, err := jrpc.New(jrpc.WithHTTP(url))
//if err != nil {
// return nil, fmt.Errorf("new http rpc client: %w", err)
//}
//return e2pg.NewGeth(freezer.New(fpath), rc), nil
return jrpc2.New(url), nil
default:
rc, err := jrpc.New(jrpc.WithSocket(url))
if err != nil {
return nil, fmt.Errorf("new unix rpc client: %w", err)
}
return e2pg.NewGeth(freezer.New(fpath), rc), nil
// TODO add back support for local node
return nil, fmt.Errorf("unable to create node for %s", url)
}
}

0 comments on commit 42e2b73

Please sign in to comment.