Skip to content

Commit

Permalink
Update portal_*Offer jsonrpc call to accept multiple key-value pairs (
Browse files Browse the repository at this point in the history
  • Loading branch information
KolbyML authored Oct 2, 2024
1 parent 3508500 commit 380dc84
Show file tree
Hide file tree
Showing 6 changed files with 40 additions and 15 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
jsonrpc/openrpc.json
jsonrpc/node_modules
13 changes: 13 additions & 0 deletions jsonrpc/src/content/params.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,19 @@
}
}
},
"ContentItems": {
"name": "content_items",
"required": true,
"schema": {
"title": "content_item",
"type": "array",
"items": {
"$ref": "#/components/schemas/ContentItem"
},
"minItems": 1,
"maxItems": 64
}
},
"Enr": {
"name": "enr",
"required": true,
Expand Down
7 changes: 2 additions & 5 deletions jsonrpc/src/methods/beacon.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,13 @@
},
{
"name": "portal_beaconOffer",
"summary": "Send an OFFER request with given ContentKey, to the designated peer and wait for a response.",
"summary": "Send an OFFER request with given array of content items (keys & values), to the designated peer and wait for a response. The client MUST return an error if more than 64 content items are provided or less than 1 content items are provided.",
"params": [
{
"$ref": "#/components/contentDescriptors/Enr"
},
{
"$ref": "#/components/contentDescriptors/ContentKey"
},
{
"$ref": "#/components/contentDescriptors/ContentValue"
"$ref": "#/components/contentDescriptors/ContentItems"
}
],
"result": {
Expand Down
7 changes: 2 additions & 5 deletions jsonrpc/src/methods/history.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,13 @@
},
{
"name": "portal_historyOffer",
"summary": "Send an OFFER request with given ContentKey, to the designated peer and wait for a response.",
"summary": "Send an OFFER request with given array of content items (keys & values), to the designated peer and wait for a response. The client MUST return an error if more than 64 content items are provided or less than 1 content items are provided.",
"params": [
{
"$ref": "#/components/contentDescriptors/Enr"
},
{
"$ref": "#/components/contentDescriptors/ContentKey"
},
{
"$ref": "#/components/contentDescriptors/ContentValue"
"$ref": "#/components/contentDescriptors/ContentItems"
}
],
"result": {
Expand Down
7 changes: 2 additions & 5 deletions jsonrpc/src/methods/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,13 @@
},
{
"name": "portal_stateOffer",
"summary": "Send an OFFER request with given ContentKey, to the designated peer and wait for a response.",
"summary": "Send an OFFER request with given array of content items (keys & values), to the designated peer and wait for a response. The client MUST return an error if more than 64 content items are provided or less than 1 content items are provided.",
"params": [
{
"$ref": "#/components/contentDescriptors/Enr"
},
{
"$ref": "#/components/contentDescriptors/ContentKey"
},
{
"$ref": "#/components/contentDescriptors/ContentValue"
"$ref": "#/components/contentDescriptors/ContentItems"
}
],
"result": {
Expand Down
19 changes: 19 additions & 0 deletions jsonrpc/src/schemas/portal.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,24 @@
"title": "UDP port number",
"type": "string",
"pattern": "^([1-9][0-9]{0,3}|[1-5][0-9]{4}|6[0-4][0-9]{3}|65[0-4][0-9]{2}|655[0-2][0-9]|6553[0-5])$"
},
"ContentItem": {
"title": "content_item",
"type": "array",
"items": [
{
"title": "Content key",
"description": "The encoded Portal content key",
"$ref": "#/components/schemas/hexString"
},
{
"title": "Content value",
"description": "The encoded Portal content value",
"$ref": "#/components/schemas/hexString"
}
],
"minItems": 2,
"maxItems": 2,
"additionalItems": false
}
}

0 comments on commit 380dc84

Please sign in to comment.