Skip to content

chore!: simplify peer id parsing#5228

Merged
0x009922 merged 1 commit intohyperledger-iroha:mainfrom
mversic:simplify_peers_in_conifg
Nov 12, 2024
Merged

chore!: simplify peer id parsing#5228
0x009922 merged 1 commit intohyperledger-iroha:mainfrom
mversic:simplify_peers_in_conifg

Conversation

@mversic
Copy link
Copy Markdown
Contributor

@mversic mversic commented Nov 11, 2024

  • simplify parsing of peer ids (serialize/deserialize it from string now)
    ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10@irohad2:1339 instead of:
    { "address":"irohad2:1339", "public_key":"ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10" }
  • also move [[sumeragi.trusted_peers]] table into trusted_peers array in the toml config
    this is a required field so it should stand out of config subsections

Migration guide

This change will be reflected in peer_config.toml file.
Minimal configuration before:

chain = "00000000-0000-0000-0000-000000000000"
public_key = "ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B"
private_key = "802620282ED9F3CF92811C3818DBC4AE594ED59DC1A2F78E4241E31924E101D6B1FB83"

[[sumeragi.trusted_peers]]                                                                 
address = "127.0.0.1:1337"                                                                 
public_key = "ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B"      
                                                                                           
[[sumeragi.trusted_peers]]                                                                 
address = "127.0.0.1:1338"                                                                 
public_key = "ed0120CC25624D62896D3A0BFD8940F928DC2ABF27CC57CEFEB442AA96D9081AAE58A1"      
                                                                                           
[[sumeragi.trusted_peers]]                                                                 
address = "127.0.0.1:1339"                                                                 
public_key = "ed0120FACA9E8AA83225CB4D16D67F27DD4F93FC30FFA11ADC1F5C88FD5495ECC91020"      
                                                                                           
[[sumeragi.trusted_peers]]                                                                 
address = "127.0.0.1:1340"                                                                 
public_key = "ed01208E351A70B6A603ED285D666B8D689B680865913BA03CE29FB7D13A166C4E7F1F"

Minimal configuration now:

chain = "00000000-0000-0000-0000-000000000000"
public_key = "ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B"
private_key = "802620282ED9F3CF92811C3818DBC4AE594ED59DC1A2F78E4241E31924E101D6B1FB83"

trusted_peers = [
  "ed01201C61FAF8FE94E253B93114240394F79A607B7FA55F9E5A41EBEC74B88055768B@127.0.0.1:1337",
  "ed0120CC25624D62896D3A0BFD8940F928DC2ABF27CC57CEFEB442AA96D9081AAE58A1@127.0.0.1:1338",
  "ed0120FACA9E8AA83225CB4D16D67F27DD4F93FC30FFA11ADC1F5C88FD5495ECC91020@127.0.0.1:1339",
  "ed01208E351A70B6A603ED285D666B8D689B680865913BA03CE29FB7D13A166C4E7F1F@127.0.0.1:1340",
]

In env:

# before
export TRUSTED_PEERS='[{"address":"irohad2:1339","public_key":"ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10"},{"address":"irohad1:1338","public_key":"ed01209897952D14BDFAEA780087C38FF3EB800CB20B882748FC95A575ADB9CD2CB21D"},{"address":"irohad3:1340","public_key":"ed0120CACF3A84B8DC8710CE9D6B968EE95EC7EE4C93C85858F026F3B4417F569592CE"}]'

# after
export TRUSTED_PEERS='["ed01204EE2FCD53E1730AF142D1E23951198678295047F9314B4006B0CB61850B1DB10@irohad2:1339","ed01209897952D14BDFAEA780087C38FF3EB800CB20B882748FC95A575ADB9CD2CB21D@irohad1:1338","ed0120CACF3A84B8DC8710CE9D6B968EE95EC7EE4C93C85858F026F3B4417F569592CE@irohad3:1340"]'

@github-actions
Copy link
Copy Markdown

@BAStos525

@github-actions github-actions bot added the config-changes Changes in configuration and start up of the Iroha label Nov 11, 2024
@mversic mversic force-pushed the simplify_peers_in_conifg branch 6 times, most recently from 20e9408 to c803822 Compare November 12, 2024 07:54
@s8sato s8sato self-assigned this Nov 12, 2024
Copy link
Copy Markdown
Contributor

@0x009922 0x009922 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When will we stop breaking configuration... @BAStos525 please take a note.

Comment thread docs/source/references/peer.template.toml Outdated
Comment thread defaults/docker-compose.local.yml Outdated
Comment thread crates/iroha_swarm/src/schema.rs
@0x009922
Copy link
Copy Markdown
Contributor

Also, please, fill the PR description appropriately, at least the migration guide. It directly affects public API.

@mversic mversic marked this pull request as draft November 12, 2024 08:27
@mversic mversic force-pushed the simplify_peers_in_conifg branch from c803822 to 38af9fd Compare November 12, 2024 08:39
@mversic mversic changed the title chore: simplify peers serialized form in the configuration chore!: simplify peer id parsing Nov 12, 2024
@mversic mversic force-pushed the simplify_peers_in_conifg branch from 38af9fd to c1ac572 Compare November 12, 2024 08:48
@mversic mversic marked this pull request as ready for review November 12, 2024 08:50
@mversic mversic force-pushed the simplify_peers_in_conifg branch from c1ac572 to 69b9728 Compare November 12, 2024 08:50
@mversic mversic requested a review from 0x009922 November 12, 2024 08:54
@mversic mversic force-pushed the simplify_peers_in_conifg branch 2 times, most recently from fbe2575 to a623cdd Compare November 12, 2024 09:22
Comment thread crates/iroha_test_network/src/lib.rs
@mversic mversic force-pushed the simplify_peers_in_conifg branch from a623cdd to 1db7ecf Compare November 12, 2024 10:15
@mversic mversic requested a review from s8sato November 12, 2024 10:16
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
@mversic mversic force-pushed the simplify_peers_in_conifg branch from 1db7ecf to 75136a6 Compare November 12, 2024 10:48
@0x009922 0x009922 merged commit 2a30fc9 into hyperledger-iroha:main Nov 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

config-changes Changes in configuration and start up of the Iroha

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants