Skip to content

Commit 3561458

Browse files
Merge pull request #4 from coinbase/patrick/small-nits
[Chore] Remote Node Instructions
2 parents 06e61e1 + 4dbc3f5 commit 3561458

File tree

2 files changed

+25
-9
lines changed

2 files changed

+25
-9
lines changed

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,12 @@ docker run -d --rm --ulimit "nofile=100000:100000" -v "$(pwd)/ethereum-data:/dat
6868
```
6969
_If you cloned the repository, you can run `make run-mainnet-online`._
7070

71+
#### Mainnet:Online (Remote)
72+
```text
73+
docker run -d --rm --ulimit "nofile=100000:100000" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -e "GETH=<NODE URL>" -p 8080:8080 -p 30303:30303 rosetta-ethereum:latest
74+
```
75+
_If you cloned the repository, you can run `make run-mainnet-remote geth=<NODE URL>`._
76+
7177
#### Mainnet:Offline
7278
```text
7379
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=MAINNET" -e "PORT=8081" -p 8081:8081 rosetta-ethereum:latest
@@ -80,6 +86,12 @@ docker run -d --rm --ulimit "nofile=100000:100000" -v "$(pwd)/ethereum-data:/dat
8086
```
8187
_If you cloned the repository, you can run `make run-testnet-online`._
8288

89+
#### Testnet:Online (Remote)
90+
```text
91+
docker run -d --rm --ulimit "nofile=100000:100000" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -e "GETH=<NODE URL>" -p 8080:8080 -p 30303:30303 rosetta-ethereum:latest
92+
```
93+
_If you cloned the repository, you can run `make run-testnet-remote geth=<NODE URL>`._
94+
8395
#### Testnet:Offline
8496
```text
8597
docker run -d --rm -e "MODE=OFFLINE" -e "NETWORK=TESTNET" -e "PORT=8081" -p 8081:8081 rosetta-ethereum:latest
@@ -119,7 +131,7 @@ and run one of the following commands:
119131
## Future Work
120132
* Add ERC-20 Rosetta Module to enable reading ERC-20 token transfers and transaction construction
121133
* [Rosetta API `/mempool/*`](https://www.rosetta-api.org/docs/MempoolApi.html) implementation
122-
* Add more methods to the `/call` endpoint (currently only support `eth_getTransactionReceipt`
134+
* Add more methods to the `/call` endpoint (currently only support `eth_getTransactionReceipt`)
123135
* Add CI test using `rosetta-cli` to run on each PR (likely on a regtest network)
124136

125137
_Please reach out on our [community](https://community.rosetta-api.org) if you want to tackle anything on this list!_

ethereum/client.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -317,7 +317,7 @@ func (ec *Client) getBlock(
317317
return nil, nil, ethereum.NotFound
318318
}
319319

320-
// Decode header and transactions.
320+
// Decode header and transactions
321321
var head types.Header
322322
var body rpcBlock
323323
if err := json.Unmarshal(raw, &head); err != nil {
@@ -332,7 +332,17 @@ func (ec *Client) getBlock(
332332
return nil, nil, fmt.Errorf("%w: unable to get uncles", err)
333333
}
334334

335+
// Get all transaction receipts
336+
receipts, err := ec.getBlockReceipts(ctx, body.Hash, body.Transactions)
337+
if err != nil {
338+
return nil, nil, fmt.Errorf("%w: could not get receipts for %x", err, body.Hash[:])
339+
}
340+
335341
// Get block traces (not possible to make idempotent block transaction trace requests)
342+
//
343+
// We fetch traces last because we want to avoid limiting the number of other
344+
// block-related data fetches we perform concurrently (we limit the number of
345+
// concurrent traces that are computed to 16 to avoid overwhelming geth).
336346
var traces []*rpcCall
337347
var rawTraces []*rpcRawCall
338348
var addTraces bool
@@ -344,13 +354,7 @@ func (ec *Client) getBlock(
344354
}
345355
}
346356

347-
// Get all transaction receipts
348-
receipts, err := ec.getBlockReceipts(ctx, body.Hash, body.Transactions)
349-
if err != nil {
350-
return nil, nil, fmt.Errorf("%w: could not get receipts for %x", err, body.Hash[:])
351-
}
352-
353-
// Convert all txs to formatted txs
357+
// Convert all txs to loaded txs
354358
txs := make([]*types.Transaction, len(body.Transactions))
355359
loadedTxs := make([]*loadedTransaction, len(body.Transactions))
356360
for i, tx := range body.Transactions {

0 commit comments

Comments
 (0)