diff --git a/packages/cli/src/rpc/modules/portal.ts b/packages/cli/src/rpc/modules/portal.ts index f4a5999d8..226109e02 100644 --- a/packages/cli/src/rpc/modules/portal.ts +++ b/packages/cli/src/rpc/modules/portal.ts @@ -33,6 +33,7 @@ const methods = [ 'portal_stateRoutingTableInfo', 'portal_stateStore', 'portal_stateLocalContent', + 'portal_stateGossip', // history 'portal_historyRoutingTableInfo', 'portal_historyAddEnr', @@ -158,6 +159,10 @@ export class portal { [validators.contentKey], [validators.hex], ]) + this.stateGossip = middleware(this.stateGossip.bind(this), 2, [ + [validators.hex], + [validators.hex], + ]) this.beaconSendFindContent = middleware(this.beaconSendFindContent.bind(this), 2, [ [validators.dstId], [validators.hex], @@ -605,6 +610,12 @@ export class portal { const res = await this._history.gossipContent(fromHexString(contentKey), fromHexString(content)) return res } + async stateGossip(params: [string, string]) { + const [contentKey, content] = params + this.logger(`stateGossip request received for ${contentKey}`) + const res = await this._state.gossipContent(fromHexString(contentKey), fromHexString(content)) + return res + } async historyStore(params: [string, string]) { const [contentKey, content] = params.map((param) => fromHexString(param)) try {