Skip to content

fix #147 by adding support for skipping STUN #156

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

Closed
wants to merge 1 commit into from
Closed
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
7 changes: 7 additions & 0 deletions ethportal-peertest/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ cd ethportal-peertest
RUST_LOG=debug cargo run -p ethportal-peertest -- --target-node enr:-IS4QBDHCSMoYoC5UziAwKSyTmMPrhMaEpaE52L8DDAkipqvZQe9fgLy2wVuuEJwO9l1KsYrRoFGCsNjylbd0CDNw60BgmlkgnY0gmlwhMCoXUSJc2VjcDI1NmsxoQJPAZUFErHK1DZYRTLjk3SCNgye9sS-MxoQI-gLiUdwc4N1ZHCCIyk
```

If you are running it on a local network you will likely want to manually give it a port
to use and advertise:

```sh
RUST_LOG=debug cargo run -p ethportal-peertest -- --external-address 127.0.0.1:4568 --listen-port 4568 --target-node $ENR
```

## Transport selection
Running the test harness will by default test all jsonrpc endpoints over IPC to the target node. To make sure these pass, please make sure that the target node is running with `--web3-transport ipc`. To test jsonrpc over http, use the `--target-transport http` cli argument for the harness, and make sure the target node is running with `--web3-transport http`. Ideally, both transport methods are tested before PRs.

7 changes: 7 additions & 0 deletions ethportal-peertest/src/cli.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use std::env;
use std::ffi::OsString;
use std::net::SocketAddr;
use structopt::StructOpt;
use trin_core::cli::DEFAULT_WEB3_HTTP_PORT as DEFAULT_TARGET_HTTP_PORT;
use trin_core::cli::DEFAULT_WEB3_IPC_PATH as DEFAULT_TARGET_IPC_PATH;
Expand Down Expand Up @@ -57,6 +58,12 @@ pub struct PeertestConfig {
help = "HTTP port of target node under test"
)]
pub target_http_port: String,

#[structopt(
long = "external-address",
help = "(Only use this if you are behind a NAT) This is the address which will be advertised to peers (in an ENR). Changing it does not change which port or address trin binds to."
)]
pub external_addr: Option<SocketAddr>,
}

impl PeertestConfig {
Expand Down
1 change: 1 addition & 0 deletions ethportal-peertest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
tokio::spawn(async move {
let peertest_config = PeertestConfig::default();
let portal_config = PortalnetConfig {
external_addr: peertest_config.external_addr,
listen_port: peertest_config.listen_port,
..Default::default()
};
Expand Down