Skip to content

Commit

Permalink
doc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
acolytec3 committed Sep 18, 2024
1 parent 7a9ab41 commit 96d7ba9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/portalnetwork/src/client/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,9 @@ export class PortalNetwork extends (EventEmitter as { new (): PortalNetworkEvent
/**
*
* @param dstId `NodeId` of message recipient
* @param payload `Buffer` serialized payload of message
* @param payload `Uint8Array` serialized payload of message
* @param networkId subnetwork ID of subnetwork message is being sent on
* @returns response from `dstId` as `Buffer` or null `Buffer`
* @returns response from `dstId` as `Uint8Array` or empty array
*/
public sendPortalNetworkMessage = async (
enr: ENR | string,
Expand Down
9 changes: 9 additions & 0 deletions packages/portalnetwork/src/networks/network.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,14 @@ export abstract class BaseNetwork extends EventEmitter {
async handleNewRequest(request: INewRequest): Promise<ContentRequest> {
return this.portal.uTP.handleNewRequest(request)
}

/**
* Send a properly formatted Portal Network message to another node
* @param dstId `NodeId` of message recipient
* @param payload `Uint8Array` serialized payload of message
* @param networkId subnetwork ID of subnetwork message is being sent on
* @returns response from `dstId` as `Buffer` or null `Buffer`
*/
async sendMessage(
enr: ENR | string,
payload: Uint8Array,
Expand All @@ -101,6 +109,7 @@ export abstract class BaseNetwork extends EventEmitter {
): Promise<Uint8Array> {
return this.portal.sendPortalNetworkMessage(enr, payload, networkId, utpMessage)
}

sendResponse(src: INodeAddress, requestId: bigint, payload: Uint8Array): Promise<void> {
return this.portal.sendPortalNetworkResponse(src, requestId, payload)
}
Expand Down

0 comments on commit 96d7ba9

Please sign in to comment.