Skip to content

Commit 21c9142

Browse files
committed
fix #147 by adding support for skipping STUN
1 parent c6b77ab commit 21c9142

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

ethportal-peertest/README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ cd ethportal-peertest
88
RUST_LOG=debug cargo run -p ethportal-peertest -- --target-node enr:-IS4QBDHCSMoYoC5UziAwKSyTmMPrhMaEpaE52L8DDAkipqvZQe9fgLy2wVuuEJwO9l1KsYrRoFGCsNjylbd0CDNw60BgmlkgnY0gmlwhMCoXUSJc2VjcDI1NmsxoQJPAZUFErHK1DZYRTLjk3SCNgye9sS-MxoQI-gLiUdwc4N1ZHCCIyk
99
```
1010

11+
If you are running it on a local network you will likely want to manually give it a port
12+
to use and advertise:
13+
14+
```sh
15+
RUST_LOG=debug cargo run -p ethportal-peertest -- --external-address 127.0.0.1:4568 --listen-port 4568 --target-node $ENR
16+
```
17+
1118
## Transport selection
1219
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.
1320

ethportal-peertest/src/cli.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
use std::env;
22
use std::ffi::OsString;
3+
use std::net::SocketAddr;
34
use structopt::StructOpt;
45
use trin_core::cli::DEFAULT_WEB3_HTTP_PORT as DEFAULT_TARGET_HTTP_PORT;
56
use trin_core::cli::DEFAULT_WEB3_IPC_PATH as DEFAULT_TARGET_IPC_PATH;
@@ -57,6 +58,12 @@ pub struct PeertestConfig {
5758
help = "HTTP port of target node under test"
5859
)]
5960
pub target_http_port: String,
61+
62+
#[structopt(
63+
long = "external-address",
64+
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."
65+
)]
66+
pub external_addr: Option<SocketAddr>,
6067
}
6168

6269
impl PeertestConfig {

ethportal-peertest/src/main.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error>> {
2626
tokio::spawn(async move {
2727
let peertest_config = PeertestConfig::default();
2828
let portal_config = PortalnetConfig {
29+
external_addr: peertest_config.external_addr,
2930
listen_port: peertest_config.listen_port,
3031
..Default::default()
3132
};

0 commit comments

Comments
 (0)