Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable rpc on reth and determinsitic p2p key #23

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ The playground performs the following steps:

To stop the playground, press `Ctrl+C`.

The `EL` instance is deployed with this deterministic enode address:

```
enode://3479db4d9217fb5d7a8ed4d61ac36e120b05d36c2eefb795dc42ff2e971f251a2315f5649ea1833271e020b9adc98d5db9973c7ed92d6b2f1f2223088c3d852f@127.0.0.1:8545
```

Options:

- `--output` (string): The directory where the chain data and artifacts are stored. It defaults to `$HOME/.playground/devnet`.
Expand Down
17 changes: 17 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,11 @@ var clConfigContent []byte

var defaultJWTToken = "04592280e1778419b7aa954d43871cb2cfb2ebda754fb735e8adeb293a88f9bf"

var (
defaultRethDiscoveryPrivKey = "a11ac89899cd86e36b6fb881ec1255b8a92a688790b7d950f8b7d8dd626671fb"
defaultRethDiscoveryPrivKeyLoc = "/tmp/tmp-reth-disc.txt"
)

var outputFlag string
var continueFlag bool
var useBinPathFlag bool
Expand Down Expand Up @@ -357,6 +362,10 @@ func setupServices(svcManager *serviceManager, out *output) error {
}
fmt.Println("")

if err := os.WriteFile(defaultRethDiscoveryPrivKeyLoc, []byte(defaultRethDiscoveryPrivKey), 0644); err != nil {
return err
}

// start the reth el client
svcManager.
NewService("reth").
Expand All @@ -366,11 +375,19 @@ func setupServices(svcManager *serviceManager, out *output) error {
"--chain", "{{.Dir}}/genesis.json",
"--datadir", "{{.Dir}}/data_reth",
"--color", "never",
// p2p config. Use a default discovery key and disable public discovery and connections
"--p2p-secret-key", defaultRethDiscoveryPrivKeyLoc,
"--addr", "127.0.0.1",
"--port", "30303",
"--disable-discovery",
// http config
"--http",
"--http.api", "admin,eth,net,web3",
"--http.port", "8545",
"--authrpc.port", "8551",
"--authrpc.jwtsecret", "{{.Dir}}/jwtsecret",
).
WithPort("rpc", 30303).
WithPort("http", 8545).
WithPort("authrpc", 8551).
Run()
Expand Down
Loading