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_*Gossip JSON-RPC endpoint to portal_*PutContent #346

Merged
merged 5 commits into from
Dec 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions jsonrpc/src/content/results.json
Original file line number Diff line number Diff line change
Expand Up @@ -220,12 +220,25 @@
"$ref": "#/components/schemas/hexString"
}
},
"GossipResult": {
"name": "gossipResult",
"description": "Returns the number of peers that the content was gossiped to",
"PutContentResult": {
"name": "PutContentResult",
"description": "Returns the number of peers that the content was gossiped to and a flag indicating whether the content was stored locally or not.",
"schema": {
"title": "number of peers",
"type": "number"
"type": "object",
"required": [
"peerCount",
"storedLocally"
],
"properties": {
"peerCount": {
"description": "Indicates how many peers the content was gossiped to.",
"type": "number"
},
"storedLocally": {
"description": "Indicates whether the content was stored locally or not.",
"type": "boolean"
}
}
}
}
}
32 changes: 19 additions & 13 deletions jsonrpc/src/methods/beacon.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@
},
{
"name": "portal_beaconGetContent",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network. After fetching from the network the content is validated and stored in the local database if storage criteria is met before being returned.",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network. After fetching from the network the content is stored in the local database if storage criteria is met before being returned.",
"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
Expand All @@ -143,9 +143,11 @@
"result": {
"$ref": "#/components/contentDescriptors/GetContentResult"
},
"errors":[{
"$ref": "#/components/errors/ContentNotFoundError"
}]
"errors": [
{
"$ref": "#/components/errors/ContentNotFoundError"
}
]
},
{
"name": "portal_beaconTraceGetContent",
Expand All @@ -158,9 +160,11 @@
"result": {
"$ref": "#/components/contentDescriptors/TraceGetContentResult"
},
"errors":[{
"$ref": "#/components/errors/ContentNotFoundErrorWithTrace"
}]
"errors": [
{
"$ref": "#/components/errors/ContentNotFoundErrorWithTrace"
}
]
},
{
"name": "portal_beaconStore",
Expand Down Expand Up @@ -188,13 +192,15 @@
"result": {
"$ref": "#/components/contentDescriptors/LocalContentResult"
},
"errors":[{
"$ref": "#/components/errors/ContentNotFoundError"
}]
"errors": [
{
"$ref": "#/components/errors/ContentNotFoundError"
}
]
},
{
"name": "portal_beaconGossip",
"summary": "Send the provided content item to interested peers. Clients may choose to send to some or all peers.",
"name": "portal_beaconPutContent",
"summary": "Store the content in the local database if storage criteria is met, then send the content to interested peers using the client's default gossip mechanisms.",
"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
Expand All @@ -204,7 +210,7 @@
}
],
"result": {
"$ref": "#/components/contentDescriptors/GossipResult"
"$ref": "#/components/contentDescriptors/PutContentResult"
}
}
]
32 changes: 19 additions & 13 deletions jsonrpc/src/methods/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
},
{
"name": "portal_historyGetContent",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network. After fetching from the network the content is validated and stored in the local database if storage criteria is met before being returned.",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network. After fetching from the network the content is stored in the local database if storage criteria is met before being returned.",
"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
Expand All @@ -135,9 +135,11 @@
"result": {
"$ref": "#/components/contentDescriptors/GetContentResult"
},
"errors":[{
"$ref": "#/components/errors/ContentNotFoundError"
}]
"errors": [
{
"$ref": "#/components/errors/ContentNotFoundError"
}
]
},
{
"name": "portal_historyTraceGetContent",
Expand All @@ -150,9 +152,11 @@
"result": {
"$ref": "#/components/contentDescriptors/TraceGetContentResult"
},
"errors":[{
"$ref": "#/components/errors/ContentNotFoundErrorWithTrace"
}]
"errors": [
{
"$ref": "#/components/errors/ContentNotFoundErrorWithTrace"
}
]
},
{
"name": "portal_historyStore",
Expand Down Expand Up @@ -180,13 +184,15 @@
"result": {
"$ref": "#/components/contentDescriptors/LocalContentResult"
},
"errors":[{
"$ref": "#/components/errors/ContentNotFoundError"
}]
"errors": [
{
"$ref": "#/components/errors/ContentNotFoundError"
}
]
},
{
"name": "portal_historyGossip",
"summary": "Send the provided content item to interested peers. Clients may choose to send to some or all peers.",
"name": "portal_historyPutContent",
"summary": "Store the content in the local database if storage criteria is met, then send the content to interested peers using the client's default gossip mechanisms.",
"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
Expand All @@ -196,7 +202,7 @@
}
],
"result": {
"$ref": "#/components/contentDescriptors/GossipResult"
"$ref": "#/components/contentDescriptors/PutContentResult"
}
}
]
8 changes: 4 additions & 4 deletions jsonrpc/src/methods/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@
},
{
"name": "portal_stateGetContent",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network. After fetching from the network the content is validated and stored in the local database if storage criteria is met before being returned.",
"summary": "Get content from the local database if it exists, otherwise look up the target content key in the network. After fetching from the network the content is stored in the local database if storage criteria is met before being returned.",
"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
Expand Down Expand Up @@ -185,8 +185,8 @@
}]
},
{
"name": "portal_stateGossip",
"summary": "Send the provided content item to interested peers. Clients may choose to send to some or all peers.",
"name": "portal_statePutContent",
"summary": "Store the content in the local database if storage criteria is met, then send the content to interested peers using the client's default gossip mechanisms.",
"params": [
{
"$ref": "#/components/contentDescriptors/ContentKey"
Expand All @@ -196,7 +196,7 @@
}
],
"result": {
"$ref": "#/components/contentDescriptors/GossipResult"
"$ref": "#/components/contentDescriptors/PutContentResult"
}
}
]
Loading