Skip to content

Commit

Permalink
Update port usage to match ID derivation
Browse files Browse the repository at this point in the history
  • Loading branch information
howardwu committed Feb 11, 2024
1 parent f4e8bc2 commit 058b37a
Show file tree
Hide file tree
Showing 9 changed files with 81 additions and 81 deletions.
2 changes: 1 addition & 1 deletion .devnet/.analytics/analytics.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ async function main() {

if (match && match[1]) {
const ipAddress = match[1];
const baseUrl = `http://${ipAddress}:3033/mainnet/block`;
const baseUrl = `http://${ipAddress}:3030/mainnet/block`;

console.log(`${dimStart}IP Address: ${ipAddress}${dimEnd}`);
console.log(`${dimStart}Base URL: ${baseUrl}${dimEnd}`);
Expand Down
4 changes: 2 additions & 2 deletions .devnet/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Start by creating EC2 instances in the AWS console.
- Ubuntu 22.04 LTS (not Amazon Linux)
- Security Group - Inbound Policy
- SSH - Port 22 - 0.0.0.0/0 (or your IP)
- Custom TCP - Port 3033 - 0.0.0.0/0 (or your IP)
- Custom TCP - Port 4133 - 0.0.0.0/0
- Custom TCP - Port 3030 - 0.0.0.0/0 (or your IP)
- Custom TCP - Port 4130 - 0.0.0.0/0
- Custom TCP - Port 5000 - 0.0.0.0/0

Be sure the give the EC2 instances a name tag, i.e. `devnet`.
Expand Down
2 changes: 1 addition & 1 deletion .devnet/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ start_snarkos_in_tmux() {
tmux new-session -d -s snarkos-session
# Send the snarkOS start command to the tmux session with the NODE_ID
tmux send-keys -t "snarkos-session" "snarkos start --nodisplay --bft 0.0.0.0:5000 --rest 0.0.0.0:3033 --peers $NODE_IP:4133 --validators $NODE_IP:5000 --verbosity $VERBOSITY --dev $NODE_ID --dev-num-validators $NUM_INSTANCES --validator --metrics" C-m
tmux send-keys -t "snarkos-session" "snarkos start --nodisplay --bft 0.0.0.0:5000 --rest 0.0.0.0:3030 --peers $NODE_IP:4130 --validators $NODE_IP:5000 --verbosity $VERBOSITY --dev $NODE_ID --dev-num-validators $NUM_INSTANCES --validator --metrics" C-m
exit # Exit root user
EOF
Expand Down
116 changes: 58 additions & 58 deletions Cargo.lock

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ Lastly, install `snarkOS`:
cargo install --locked --path .
```

Please ensure ports `4133/tcp` and `3033/tcp` are open on your router and OS firewall.
Please ensure ports `4130/tcp` and `3030/tcp` are open on your router and OS firewall.

## 3. Run an Aleo Node

Expand Down Expand Up @@ -144,7 +144,7 @@ APrivateKey1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

### 2. My node is unable to connect to peers on the network.

- Ensure ports `4133/tcp` and `3033/tcp` are open on your router and OS firewall.
- Ensure ports `4130/tcp` and `3030/tcp` are open on your router and OS firewall.
- Ensure `snarkOS` is started using `./run-client.sh` or `./run-prover.sh`.

### 3. I can't generate a new address ###
Expand Down Expand Up @@ -191,10 +191,10 @@ OPTIONS:
--private-key <PRIVATE_KEY> Specify the node's account private key
--private-key-file <PRIVATE_KEY_FILE> Specify the path to a file containing the node's account private key
--node <IP:PORT> Specify the IP address and port for the node server [default: 0.0.0.0:4133]
--node <IP:PORT> Specify the IP address and port for the node server [default: 0.0.0.0:4130]
--connect <IP:PORT> Specify the IP address and port of a peer to connect to
--rest <REST> Specify the IP address and port for the REST server [default: 0.0.0.0:3033]
--rest <REST> Specify the IP address and port for the REST server [default: 0.0.0.0:3030]
--norest If the flag is set, the node will not initialize the REST server
--nodisplay If the flag is set, the node will not render the display
Expand Down
6 changes: 3 additions & 3 deletions build_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ source $HOME/.cargo/env
cargo install --locked --path .

echo "=================================================="
echo " Attention - Please ensure ports 4133 and 3033"
echo " Attention - Please ensure ports 4130 and 3030"
echo " are enabled on your local network."
echo ""
echo " Cloud Providers - Enable ports 4133 and 3033"
echo " Cloud Providers - Enable ports 4130 and 3030"
echo " in your network firewall"
echo ""
echo " Home Users - Enable port forwarding or NAT rules"
echo " for 4133 and 3033 on your router."
echo " for 4130 and 3030 on your router."
echo "=================================================="
12 changes: 6 additions & 6 deletions cli/src/commands/start.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ pub struct Start {
pub private_key_file: Option<PathBuf>,

/// Specify the IP address and port for the node server
#[clap(default_value = "0.0.0.0:4133", long = "node")]
#[clap(default_value = "0.0.0.0:4130", long = "node")]
pub node: SocketAddr,
/// Specify the IP address and port for the BFT
#[clap(long = "bft")]
Expand All @@ -89,7 +89,7 @@ pub struct Start {
pub validators: String,

/// Specify the IP address and port for the REST server
#[clap(default_value = "0.0.0.0:3033", long = "rest")]
#[clap(default_value = "0.0.0.0:3030", long = "rest")]
pub rest: SocketAddr,
/// Specify the requests per second (RPS) rate limit per IP for the REST server
#[clap(default_value = "10", long = "rest-rps")]
Expand Down Expand Up @@ -789,8 +789,8 @@ mod tests {
Start::try_parse_from(["snarkos", "--dev", "3", "--client", "--private-key", ""].iter()).unwrap();
config.parse_development(&mut trusted_peers, &mut trusted_validators).unwrap();
let genesis = config.parse_genesis::<CurrentNetwork>().unwrap();
assert_eq!(config.node, SocketAddr::from_str("0.0.0.0:4133").unwrap());
assert_eq!(config.rest, SocketAddr::from_str("0.0.0.0:3033").unwrap());
assert_eq!(config.node, SocketAddr::from_str("0.0.0.0:4130").unwrap());
assert_eq!(config.rest, SocketAddr::from_str("0.0.0.0:3030").unwrap());
assert_eq!(trusted_peers.len(), 3);
assert_eq!(trusted_validators.len(), 2);
assert!(!config.validator);
Expand All @@ -817,7 +817,7 @@ mod tests {
"--validators",
"IP1,IP2,IP3",
"--rest",
"127.0.0.1:3033",
"127.0.0.1:3030",
];
let cli = CLI::parse_from(arg_vec);

Expand All @@ -827,7 +827,7 @@ mod tests {
assert!(start.validator);
assert_eq!(start.private_key.as_deref(), Some("PRIVATE_KEY"));
assert_eq!(start.cdn, "CDN");
assert_eq!(start.rest, "127.0.0.1:3033".parse().unwrap());
assert_eq!(start.rest, "127.0.0.1:3030".parse().unwrap());
assert_eq!(start.network, 3);
assert_eq!(start.peers, "IP1,IP2,IP3");
assert_eq!(start.validators, "IP1,IP2,IP3");
Expand Down
8 changes: 4 additions & 4 deletions node/router/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -381,10 +381,10 @@ impl<N: Network> Router<N> {
vec![]
} else {
vec![
SocketAddr::from_str("35.224.50.150:4133").unwrap(),
SocketAddr::from_str("35.227.159.141:4133").unwrap(),
SocketAddr::from_str("34.139.203.87:4133").unwrap(),
SocketAddr::from_str("34.150.221.166:4133").unwrap(),
SocketAddr::from_str("35.224.50.150:4130").unwrap(),
SocketAddr::from_str("35.227.159.141:4130").unwrap(),
SocketAddr::from_str("34.139.203.87:4130").unwrap(),
SocketAddr::from_str("34.150.221.166:4130").unwrap(),
]
}
}
Expand Down
4 changes: 2 additions & 2 deletions node/src/validator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,8 +470,8 @@ mod tests {
#[tokio::test]
async fn test_profiler() -> Result<()> {
// Specify the node attributes.
let node = SocketAddr::from_str("0.0.0.0:4133").unwrap();
let rest = SocketAddr::from_str("0.0.0.0:3033").unwrap();
let node = SocketAddr::from_str("0.0.0.0:4130").unwrap();
let rest = SocketAddr::from_str("0.0.0.0:3030").unwrap();
let storage_mode = StorageMode::Development(0);

// Initialize an (insecure) fixed RNG.
Expand Down

0 comments on commit 058b37a

Please sign in to comment.