Skip to content

Conversation

@Levi0804
Copy link
Contributor

@Levi0804 Levi0804 commented Jul 3, 2025

Closes #77

This PR is a work in progress. Please let me know if the current approach looks good.

In the current approach I have created a VERSION_METADATA env variable (from build.rs) which holds a stringified JSON of our version metadata. This JSON string could then be deserialized appropriately and served at the correct endpoint.

Current structure of JSON:

{
  "versions": [
    { "name": "iroha", "version": "2.0.0-rc.2.0" },
    { "name": "iroha_explorer", "version": "0.2.1" },
    { "name": "iroha_config", "version": "2.0.0-rc.2.0" },
    { "name": "iroha_config_base", "version": "2.0.0-rc.2.0" }
    // ...
  ]
}

@0x009922 0x009922 marked this pull request as draft July 7, 2025 03:52
@0x009922
Copy link
Contributor

0x009922 commented Jul 7, 2025

@Levi0804 Hi, thanks for opening the PR!

I think it is too excessive to handle all versions of Iroha dependencies. All Iroha deps are of the same version anyway.

What matters is:

  • Show which Explorer version it is (what is in Cargo.toml)
  • Show which Iroha version it is compatible with. I'd extract it as version of iroha_data_model dependency acquired from cargo metadata

So, the result would be just 2 env vars to pass from build.rs - VERGEN_EXPLORER_VERSION and VERGEN_IROHA_COMPAT or something.

How does it sound?

@Levi0804 Levi0804 closed this Jul 7, 2025
@Levi0804 Levi0804 reopened this Jul 7, 2025
@Levi0804
Copy link
Contributor Author

Levi0804 commented Jul 7, 2025

@Levi0804 Hi, thanks for opening the PR!

Happy to contribute!

  • Show which Explorer version it is (what is in Cargo.toml)

We could also get this from cargo metadata, should I just get it from there?

How does it sound?

Sounds good to me!

Do you think I should switch to using the vergen crate, or is this implementation okay?

@0x009922
Copy link
Contributor

0x009922 commented Jul 7, 2025

We could also get this from cargo metadata, should I just get it from there?

Yes.

Do you think I should switch to using the vergen crate, or is this implementation okay?

No need to use the vergen crate (I used VERGEN_ prefix because it reflects the essence of it). I also removed vergen in another unfinished PR: #72

@Levi0804 Levi0804 marked this pull request as ready for review July 15, 2025 16:04
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.

LGTM, only a small naming change

@Levi0804 Levi0804 requested a review from 0x009922 July 25, 2025 18:05
@0x009922 0x009922 merged commit 159cc8d into soramitsu:master Jul 30, 2025
@Levi0804 Levi0804 deleted the expose-version-metadata branch July 30, 2025 07:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Expose version metadata

2 participants