Skip to content

Commit

Permalink
Changing primary_address to use tcp all other places
Browse files Browse the repository at this point in the history
  • Loading branch information
gokhan-simsek-iota committed Dec 20, 2024
1 parent e0e2326 commit c05d7e4
Show file tree
Hide file tree
Showing 13 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion crates/iota-core/src/test_utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@ async fn init_genesis(
commission_rate: 0,
network_address: local_ip_utils::new_local_tcp_address_for_testing(),
p2p_address: local_ip_utils::new_local_udp_address_for_testing(),
primary_address: local_ip_utils::new_local_udp_address_for_testing(),
primary_address: local_ip_utils::new_local_tcp_address_for_testing(),
description: String::new(),
image_url: String::new(),
project_url: String::new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ module iota_system::iota_system_tests {
system_state.update_validator_project_url(b"new_project_url", ctx);
system_state.update_candidate_validator_network_address(network_address, ctx);
system_state.update_candidate_validator_p2p_address(p2p_address, ctx);
system_state.update_candidate_validator_primary_address(b"/ip4/127.0.0.1/udp/80", ctx);
system_state.update_candidate_validator_primary_address(b"/ip4/127.0.0.1/tcp/80", ctx);
system_state.update_candidate_validator_authority_pubkey(
authority_pub_key,
pop,
Expand Down Expand Up @@ -428,7 +428,7 @@ module iota_system::iota_system_tests {
system_state.update_validator_project_url(b"new_project_url", ctx);
system_state.update_validator_next_epoch_network_address(network_address, ctx);
system_state.update_validator_next_epoch_p2p_address(p2p_address, ctx);
system_state.update_validator_next_epoch_primary_address(b"/ip4/168.168.168.168/udp/80", ctx);
system_state.update_validator_next_epoch_primary_address(b"/ip4/168.168.168.168/tcp/80", ctx);
system_state.update_validator_next_epoch_authority_pubkey(
authority_pub_key,
pop,
Expand Down Expand Up @@ -470,7 +470,7 @@ module iota_system::iota_system_tests {
// Next epoch
assert!(validator.next_epoch_network_address() == &option::some(new_network_address.to_string()));
assert!(validator.next_epoch_p2p_address() == &option::some(new_p2p_address.to_string()));
assert!(validator.next_epoch_primary_address() == &option::some(b"/ip4/168.168.168.168/udp/80".to_string()));
assert!(validator.next_epoch_primary_address() == &option::some(b"/ip4/168.168.168.168/tcp/80".to_string()));
assert!(
validator.next_epoch_authority_pubkey_bytes() == &option::some(new_authority_pub_key),
0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ module iota_system::validator_tests {
{
validator.update_next_epoch_network_address(b"/ip4/192.168.1.1/tcp/80");
validator.update_next_epoch_p2p_address(b"/ip4/192.168.1.1/udp/80");
validator.update_next_epoch_primary_address(b"/ip4/192.168.1.1/udp/80");
validator.update_next_epoch_primary_address(b"/ip4/192.168.1.1/tcp/80");
validator.update_next_epoch_authority_pubkey(new_authority_pub_key, new_pop);
validator.update_next_epoch_protocol_pubkey(new_protocol_pub_key);
validator.update_next_epoch_network_pubkey(new_network_pub_key);
Expand Down Expand Up @@ -367,7 +367,7 @@ module iota_system::validator_tests {
// Next epoch
assert!(validator.next_epoch_network_address() == &option::some(b"/ip4/192.168.1.1/tcp/80".to_string()));
assert!(validator.next_epoch_p2p_address() == &option::some(b"/ip4/192.168.1.1/udp/80".to_string()));
assert!(validator.next_epoch_primary_address() == &option::some(b"/ip4/192.168.1.1/udp/80".to_string()));
assert!(validator.next_epoch_primary_address() == &option::some(b"/ip4/192.168.1.1/tcp/80".to_string()));
assert!(
validator.next_epoch_authority_pubkey_bytes() == &option::some(new_authority_pub_key),
0
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-genesis-builder/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1783,7 +1783,7 @@ mod test {
commission_rate: DEFAULT_COMMISSION_RATE,
network_address: local_ip_utils::new_local_tcp_address_for_testing(),
p2p_address: local_ip_utils::new_local_udp_address_for_testing(),
primary_address: local_ip_utils::new_local_udp_address_for_testing(),
primary_address: local_ip_utils::new_local_tcp_address_for_testing(),
description: String::new(),
image_url: String::new(),
project_url: String::new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,7 @@ Response: {
},
"net_address": "/ip4/127.0.0.1/tcp/8000/http",
"p2p_address": "/ip4/127.0.0.1/udp/8001/http",
"primary_address": "/ip4/127.0.0.1/udp/8003/http",
"primary_address": "/ip4/127.0.0.1/tcp/8003/http",
"next_epoch_authority_pubkey_bytes": null,
"next_epoch_proof_of_possession": null,
"next_epoch_network_pubkey_bytes": null,
Expand Down
2 changes: 1 addition & 1 deletion crates/iota-swarm-config/tests/snapshot_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ fn populated_genesis_snapshot_matches() {
commission_rate: DEFAULT_COMMISSION_RATE,
network_address: "/ip4/127.0.0.1/tcp/80".parse().unwrap(),
p2p_address: "/ip4/127.0.0.1/udp/80".parse().unwrap(),
primary_address: "/ip4/127.0.0.1/udp/80".parse().unwrap(),
primary_address: "/ip4/127.0.0.1/tcp/80".parse().unwrap(),
description: String::new(),
image_url: String::new(),
project_url: String::new(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ validators:
project_url: ""
net_address: /ip4/127.0.0.1/tcp/80
p2p_address: /ip4/127.0.0.1/udp/80
primary_address: /ip4/127.0.0.1/udp/80
primary_address: /ip4/127.0.0.1/tcp/80
next_epoch_authority_pubkey_bytes: ~
next_epoch_proof_of_possession: ~
next_epoch_network_pubkey_bytes: ~
Expand Down
4 changes: 2 additions & 2 deletions crates/iota/src/fire_drill.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,10 @@ async fn update_next_epoch_metadata(
let mut new_primary_addresses =
Multiaddr::try_from(self_validator.primary_address.clone()).unwrap();
info!("Current primary address: {:?}", new_primary_addresses);
// pop out udp
// pop out tcp
new_primary_addresses.pop().unwrap();
let new_port = local_ip_utils::get_available_port(&localhost);
new_primary_addresses.push(Protocol::Udp(new_port));
new_primary_addresses.push(Protocol::Tcp(new_port));
info!("New primary address: {:?}", new_primary_addresses);

// Save new config
Expand Down
2 changes: 1 addition & 1 deletion crates/iota/src/generate_genesis_checkpoint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ async fn main() {
commission_rate: iota_config::node::DEFAULT_COMMISSION_RATE,
network_address: local_ip_utils::new_local_tcp_address_for_testing(),
p2p_address: local_ip_utils::new_local_udp_address_for_testing(),
primary_address: local_ip_utils::new_local_udp_address_for_testing(),
primary_address: local_ip_utils::new_local_tcp_address_for_testing(),
description: String::new(),
image_url: String::new(),
project_url: String::new(),
Expand Down
2 changes: 1 addition & 1 deletion crates/iota/src/genesis_ceremony.rs
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,7 @@ mod test {
commission_rate: iota_config::node::DEFAULT_COMMISSION_RATE,
network_address: local_ip_utils::new_local_tcp_address_for_testing(),
p2p_address: local_ip_utils::new_local_udp_address_for_testing(),
primary_address: local_ip_utils::new_local_udp_address_for_testing(),
primary_address: local_ip_utils::new_local_tcp_address_for_testing(),
description: String::new(),
image_url: String::new(),
project_url: String::new(),
Expand Down
8 changes: 4 additions & 4 deletions docker/iota-network/genesis/compose-validators.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ validator_config_info:
- commission_rate: 0
gas_price: 1000
name: validator1
primary_address: /dns/validator1/udp/8081
primary_address: /dns/validator1/tcp/8081
network_address: /dns/validator1/tcp/8080/http
p2p_address: /dns/validator1/udp/8084
stake: 20000000000000000
Expand All @@ -26,21 +26,21 @@ validator_config_info:
- commission_rate: 0
gas_price: 1000
name: validator2
primary_address: /dns/validator2/udp/8081
primary_address: /dns/validator2/tcp/8081
network_address: /dns/validator2/tcp/8080/http
p2p_address: /dns/validator2/udp/8084
stake: 20000000000000000
- commission_rate: 0
gas_price: 1000
name: validator3
primary_address: /dns/validator3/udp/8081
primary_address: /dns/validator3/tcp/8081
network_address: /dns/validator3/tcp/8080/http
p2p_address: /dns/validator3/udp/8084
stake: 20000000000000000
- commission_rate: 0
gas_price: 1000
name: validator4
primary_address: /dns/validator4/udp/8081
primary_address: /dns/validator4/tcp/8081
network_address: /dns/validator4/tcp/8080/http
p2p_address: /dns/validator4/udp/8084
stake: 20000000000000000
8 changes: 4 additions & 4 deletions docker/iota-private-network/configs/genesis-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,28 +20,28 @@ validator_config_info:
- commission_rate: 0
gas_price: 1000
name: validator-1
primary_address: /dns/validator-1/udp/8081
primary_address: /dns/validator-1/tcp/8081
network_address: /dns/validator-1/tcp/8080/http
p2p_address: /dns/validator-1/udp/8084
stake: 20000000000000000
- commission_rate: 0
gas_price: 1000
name: validator-2
primary_address: /dns/validator-2/udp/8081
primary_address: /dns/validator-2/tcp/8081
network_address: /dns/validator-2/tcp/8080/http
p2p_address: /dns/validator-2/udp/8084
stake: 20000000000000000
- commission_rate: 0
gas_price: 1000
name: validator-3
primary_address: /dns/validator-3/udp/8081
primary_address: /dns/validator-3/tcp/8081
network_address: /dns/validator-3/tcp/8080/http
p2p_address: /dns/validator-3/udp/8084
stake: 20000000000000000
- commission_rate: 0
gas_price: 1000
name: validator-4
primary_address: /dns/validator-4/udp/8081
primary_address: /dns/validator-4/tcp/8081
network_address: /dns/validator-4/tcp/8080/http
p2p_address: /dns/validator-4/udp/8084
stake: 20000000000000000
Expand Down
2 changes: 1 addition & 1 deletion docs/content/references/cli/validator.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ $ iota validator display-metadata 0x8359fff1dc629bad933cf1781564a6d98a7277ac391e
"projectUrl": "",
"netAddress": "/dns/validator-2.r.iota-rebased-testnet.iota.cafe/tcp/8080/http",
"p2pAddress": "/dns/validator-2.r.iota-rebased-testnet.iota.cafe/udp/8084",
"primaryAddress": "/dns/validator-2.r.iota-rebased-testnet.iota.cafe/udp/8081",
"primaryAddress": "/dns/validator-2.r.iota-rebased-testnet.iota.cafe/tcp/8081",
"nextEpochAuthorityPubkeyBytes": null,
"nextEpochProofOfPossession": null,
"nextEpochNetworkPubkeyBytes": null,
Expand Down

0 comments on commit c05d7e4

Please sign in to comment.