Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore!: simplify peer id parsing #5228

Merged
merged 1 commit into from
Nov 12, 2024

Conversation

mversic
Copy link
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"]'

Copy link

@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
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.

docs/source/references/peer.template.toml Outdated Show resolved Hide resolved
defaults/docker-compose.local.yml Outdated Show resolved Hide resolved
crates/iroha_swarm/src/schema.rs Outdated Show resolved Hide resolved
@0x009922
Copy link
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 changed the title chore: simplify peers serialized form in the configuration chore!: simplify peer id parsing Nov 12, 2024
@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 2 times, most recently from fbe2575 to a623cdd Compare November 12, 2024 09:22
@mversic mversic requested a review from s8sato November 12, 2024 10:16
Signed-off-by: Marin Veršić <marin.versic101@gmail.com>
@0x009922 0x009922 merged commit 2a30fc9 into hyperledger-iroha:main Nov 12, 2024
18 checks passed
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