BREAKING CHANGE:
broadcastTalkReq has been removed since it was very opinionated and can be trivially reproduced using kadValues and sendTalkReq.
function broadcastTalkReq(
discv5: IDiscv5, payload: Buffer, protocol: string | Uint8Array
): Promise<Buffer> {
const requests = []
for (const enr of discv5.kadValues()) {
requests.push(discv5.sendTalkReq(enr, payload, protocol)
}
// Depending on the use case
// you might want to replace with Promise.allSettled
// to return all responses / errors
return Promise.race(requests)
}
BREAKING CHANGE:
broadcastTalkReq
has been removed since it was very opinionated and can be trivially reproduced usingkadValues
andsendTalkReq
.