Skip to content

Conversation

moritzkiefer-da
Copy link
Contributor

fixes #2038

[ci]

This keeps coming up every few days so rather than copy pasting the config snippet around let's just include it.

Pull Request Checklist

Cluster Testing

  • If a cluster test is required, comment /cluster_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.
  • If a hard-migration test is required (from the latest release), comment /hdm_test on this PR to request it, and ping someone with access to the DA-internal system to approve it.

PR Guidelines

  • Include any change that might be observable by our partners or affect their deployment in the release notes.
  • Specify fixed issues with Fixes #n, and mention issues worked on using #n
  • Include a screenshot for frontend-related PRs - see README or use your favorite screenshot tool

Merge Guidelines

  • Make the git commit message look sensible when squash-merging on GitHub (most likely: just copy your PR description).

@moritzkiefer-da moritzkiefer-da enabled auto-merge (squash) August 28, 2025 10:52
moritzkiefer-da pushed a commit that referenced this pull request Aug 28, 2025
Required for #2053 to
go through CI.

[static]

Signed-off-by: Moritz Kiefer <[email protected]>
Copy link
Contributor

@isegall-da isegall-da left a comment

Choose a reason for hiding this comment

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

Nice, thank you. Shouldn't we also add it to localnet?

@moritzkiefer-da
Copy link
Contributor Author

Nice, thank you. Shouldn't we also add it to localnet?

localnet already has support

moritzkiefer-da added a commit that referenced this pull request Aug 28, 2025
Required for #2053 to
go through CI.

[static]

Signed-off-by: Moritz Kiefer <[email protected]>
Co-authored-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da
Copy link
Contributor Author

Hm looking at this again, localnet does it differently though.

  1. It only exposes the JSON API under canton.*.
  2. It adds cors headers for the json api, I can add those as well makes sense to have I guess.
  3. For some reason it tries to be clever with which paths it routes
  location /docs/openapi {
    proxy_pass http://canton:2${PARTICIPANT_JSON_API_PORT_SUFFIX}/docs/openapi;
      include /etc/nginx/includes/cors-headers.conf;
  }

  location /v2 {
    include /etc/nginx/includes/cors-options-headers.conf;
    proxy_pass http://canton:2${PARTICIPANT_JSON_API_PORT_SUFFIX}/v2;
      include /etc/nginx/includes/cors-headers.conf;
  }

Don't see what the point of this is given that nothing else uses the same server name.

The inconsistency does seem awkward. I think I have a slight preference for the setup here so I'm leaning towards adjusting localnet to the urls here (but with cors) and also expose the grpc API there. I guess this is technically a breaking change but it seems trivial to adjust wdyt?

@moritzkiefer-da
Copy link
Contributor Author

@isegall-da Can I ask your input on the proposal above to adjust localnet to match the json-ledger-api and grpc-ledger-api urls?

@isegall-da
Copy link
Contributor

So the main difference seems to be that in localnet we made an effort not to expose everything, but only /docs/openapi and /v2. Do you know what else is there and if there's a reason not to expose that "something else" too?

I tend to agree that otherwise, the proposal in this PR seems nicer. I guess that in localnet we can have both for a while, and label the existing deprecated, no?

@moritzkiefer-da
Copy link
Contributor Author

Do you know what else is there and if there's a reason not to expose that "something else" too?

there isn't anything else. I think the filter is probably copypasta from actual UI configs. There it's common you want those filters so / serves your static UI files and then /v2 serves the json API. But here it is on a different port so this doesn't do anything useful.

I guess that in localnet we can have both for a while, and label the existing deprecated, no?

Yeah realized that afterwards. No need to make it a breaking change so I'll just keep the exisitng one with a comment.

fixes #2038

[ci]

This keeps coming up every few days so rather than copy pasting the
config snippet around let's just include it.

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da force-pushed the cocreature/direct-identity-export branch from 761f597 to c5c4d9e Compare August 29, 2025 06:33
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
[ci]

Signed-off-by: Moritz Kiefer <[email protected]>
@moritzkiefer-da moritzkiefer-da merged commit 5c83ff4 into main Aug 29, 2025
57 checks passed
@moritzkiefer-da moritzkiefer-da deleted the cocreature/direct-identity-export branch August 29, 2025 10:24
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 ledger API in docker compose setups
4 participants