Skip to content

Commit

Permalink
Adding package name to every cargo cmd with --example param
Browse files Browse the repository at this point in the history
  • Loading branch information
pwalski committed Sep 15, 2023
1 parent c70cf5e commit ba591bc
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
uses: actions-rs/cargo@v1
with:
command: build
args: --example http_client --release
args: -p ya-relay-client --example http_client --release

- name: Run test suite
run: poetry run pytest
Expand Down
8 changes: 4 additions & 4 deletions server/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@

Initialize session with server:

`cargo run --example client -- -a udp://127.0.0.1:7464 init`
`cargo run -p ya-relay-client --example client -- -a udp://127.0.0.1:7464 init`

Query information about Node:

`cargo run --example client -- -a udp://127.0.0.1:7464 find-node -n 0x95369fc6fd02afeca110b9c32a21fb8ad899ee0a`
`cargo run -p ya-relay-client --example client -- -a udp://127.0.0.1:7464 find-node -n 0x95369fc6fd02afeca110b9c32a21fb8ad899ee0a`

Ping node:

`cargo run --example client -- -a udp://127.0.0.1:7464 ping`
`cargo run -p ya-relay-client --example client -- -a udp://127.0.0.1:7464 ping`

## Running test suite

Expand All @@ -24,7 +24,7 @@ Ping node:

### Relay forwarding test

`cargo run --release --example perf relay-traffic --connections 6000 --requestors 3 --scenario-file client/examples/resources/fwds.csv`
`cargo run -p ya-relay-client --release --example perf relay-traffic --connections 6000 --requestors 3 --scenario-file client/examples/resources/fwds.csv`

To run test locally we need to ensure we have relayed connections with other Nodes. The best way to do this is to modify `ya-relay-server`
so it always returns no public endpoints for connected Node.
4 changes: 2 additions & 2 deletions test_env/README.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
- go to main dir of ya_relay
- build release
`cargo build --release`
`cargo build --example http_client --release`
`cargo build -p ya-relay-client --example http_client --release`
- run:
docker compose -f test_env/docker-compose.yml up --build client --build relay_server --scale client=2
- check client ports via `docker ps`
- you can access them via `curl localhost:8080/ping/0x1234...`
- you can access them via `curl localhost:8080/ping/0x1234...`
2 changes: 1 addition & 1 deletion test_env/basic-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ while getopts ":c:" options; do
done

cargo build --release
cargo build --example http_client --release
cargo build -p ya-relay-client --example http_client --release

# Start the network
docker compose -f test_env/docker-compose.yml up \
Expand Down
2 changes: 1 addition & 1 deletion test_env/many-pings.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ while getopts ":c:" options; do
done

cargo build --release
cargo build --example http_client --release
cargo build -p ya-relay-client --example http_client --release

# Start the network
RUST_LOG=debug docker compose -f test_env/docker-compose.yml up \
Expand Down
2 changes: 1 addition & 1 deletion test_env/scenario-net-down.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

cargo build --release
cargo build --example http_client --release
cargo build -p ya-relay-client --example http_client --release

docker build -f Dockerfile.base -t tests_base test_env/.
# Start the network
Expand Down
2 changes: 1 addition & 1 deletion tests_integration/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Build and run
```bash
# Dockerfiles take local release or debug binaries (if release is missing)
cargo build
cargo build --example http_client
cargo build -p ya-relay-client --example http_client
# Switch to Python 3.10
source .venv/bin/activate
# Install poetry
Expand Down

0 comments on commit ba591bc

Please sign in to comment.