Skip to content

Commit

Permalink
feat: Add caching to HttpForkSource (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
nbaztec authored Sep 18, 2023
1 parent be53aec commit f3e1528
Show file tree
Hide file tree
Showing 13 changed files with 1,141 additions and 46 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ etc/**/*.zbin
!.vscode/launch.json
!.vscode/tasks.json

*.log
*.log
.cache
21 changes: 21 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ ethabi = "16.0.0"
itertools = "0.10.5"
log = "0.4.20"
simplelog = "0.12.1"
rustc-hash = "1.1.0"

[dev-dependencies]
httptest = "0.15.4"
tempdir = "0.3.7"
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,25 @@ Additionally, the file path can be provided via the `--log-file-path` option (de
era_test_node --log=error --log-file-path=run.log run
```

## 📃 Caching

The node will cache certain network request by default to disk in the `.cache` directory. Alternatively the caching can be disabled or set to in-memory only
via the `--cache=none|memory|disk` parameter.

```bash
era_test_node --cache=none run
```

```bash
era_test_node --cache=memory run
```

Additionally when using `--cache=disk`, the cache directory may be specified via `--cache-dir` and the cache may
be reset on startup via `--reset-cache` parameters.
```bash
era_test_node --cache=disk --cache-dir=/tmp/foo --reset-cache run
```

## 🌐 Network Details

- L2 RPC: http://localhost:8011
Expand Down
Loading

0 comments on commit f3e1528

Please sign in to comment.