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

feat: expose current ceramic network via api #441

Merged
merged 4 commits into from
Jul 26, 2024

Conversation

dav1do
Copy link
Contributor

@dav1do dav1do commented Jul 16, 2024

This adds a new endpoint to support retrieving the current network the server is connected to. I changing the name formatting to remove /ceramic/ and return the values that match more closely to what we previously used in js-ceramic. It is possibly a subtly breaking change if people were relying on this string representation to match the pubsub topics, but I can't find any uses in the repo, http client or keramik so went ahead and changed it. Open to implementing Display or another function instead if others deem that worthwhile.

I also added inmemory as an alias of in-memory for the network cli flag so either can be passed in. It's not advertised in help/completion but it will work if passed in.

# GET /ceramic/network
❯ curl http://127.0.0.1:5101/ceramic/config/network
{"name":"local-0"}

Copy link

linear bot commented Jul 16, 2024

Copy link
Collaborator

@stbrody stbrody left a comment

Choose a reason for hiding this comment

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

LGTM mod question about namespacing the endpoint

api/ceramic.yaml Outdated Show resolved Hide resolved
@dav1do dav1do requested a review from a team as a code owner July 25, 2024 22:50
dav1do added 4 commits July 25, 2024 17:06
we now return the names used previously by js-ceramic rather than something that looks like a pubsub topic. this could be subtly breaking, but afaict, nothing uses or relies on this currently.

we could instead impl Display or another function to get this value, but given the unused nature I'm preferring one version unless others deem that a mistake.
this matches js-ceramic. it's not advertised in shell completion but will be accepted
@dav1do dav1do force-pushed the feat/aes-209-expose-current-network branch from fcebc04 to 4123066 Compare July 25, 2024 23:07
@dav1do dav1do temporarily deployed to github-tests-2024 July 25, 2024 23:17 — with GitHub Actions Inactive
@dav1do dav1do temporarily deployed to github-tests-2024 July 26, 2024 00:01 — with GitHub Actions Inactive
@dav1do dav1do added this pull request to the merge queue Jul 26, 2024
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Jul 26, 2024
@dav1do dav1do added this pull request to the merge queue Jul 26, 2024
Merged via the queue into main with commit ed45718 Jul 26, 2024
5 checks passed
@dav1do dav1do deleted the feat/aes-209-expose-current-network branch July 26, 2024 16:27
@smrz2001 smrz2001 mentioned this pull request Jul 29, 2024
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.

2 participants