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

Rename portal_*RecursiveFindContent to portal_*GetContent #344

Merged
merged 9 commits into from
Oct 14, 2024
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Specify filepatterns you want git to ignore.
jsonrpc/openrpc.json
jsonrpc/node_modules
7 changes: 7 additions & 0 deletions jsonrpc/src/content/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -225,5 +225,12 @@
"title": "number of peers",
"type": "number"
}
},
"GetContentResult": {
"name": "GetContentResult",
"description": "Returns the hex encoded content value. If the content is not available, returns \"0x\"",
"schema": {
"$ref": "#/components/schemas/hexString"
}
}
}
12 changes: 12 additions & 0 deletions jsonrpc/src/methods/beacon.json
Original file line number Diff line number Diff line change
Expand Up @@ -200,5 +200,17 @@
"result": {
"$ref": "#/components/contentDescriptors/GossipResult"
}
},
{
"name": "portal_beaconGetContent",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

I do think we need to somewhere explicitly specify that the content needs to get verified by the RPC server and throw an error if verification fails.

Else we will end up with differences between clients like we have now for the portal_*RecursiveFindContent method (which as @morph-dev mentioned, we should clearify also, but perhaps in another PR)

Copy link
Contributor Author

@bhartnett bhartnett Oct 1, 2024

Choose a reason for hiding this comment

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

Okay, I'll add more detail to the description in that case.

"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
}
],
"result": {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This method will also require a ContentNotFoundError, see PR: #343.

Copy link
Contributor Author

@bhartnett bhartnett Oct 1, 2024

Choose a reason for hiding this comment

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

Sure, I'll add once that PR is merged.

"$ref": "#/components/contentDescriptors/GetContentResult"
}
}
]
12 changes: 12 additions & 0 deletions jsonrpc/src/methods/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -192,5 +192,17 @@
"result": {
"$ref": "#/components/contentDescriptors/GossipResult"
}
},
{
"name": "portal_historyGetContent",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network.",
"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
}
],
"result": {
"$ref": "#/components/contentDescriptors/GetContentResult"
}
}
]
12 changes: 12 additions & 0 deletions jsonrpc/src/methods/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -180,5 +180,17 @@
"result": {
"$ref": "#/components/contentDescriptors/GossipResult"
}
},
{
"name": "portal_stateGetContent",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network.",
"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
}
],
"result": {
"$ref": "#/components/contentDescriptors/GetContentResult"
}
}
]
Loading