I would like to subscribe to the beefy justification stream on Rococo. The rpc for getFinalizedHead works fine, but I also require the justifications themselves.
When I try to subscribe to the justifications using (in the polkadot-apps-ui/Developer/Javascript section):
const unsub = await api.rpc.beefy.subscribeJustifications((header) => {
console.log(`The last block has a timestamp of ${header}`);
});
I get the following error (when a new header is finalized):
h@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:76373
createTypeUnsafe@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:163502
_formatOutput@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:5692
_formatResult@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:3182
d@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:4503
21899/y/this.__internal__onSocketMessageSubscribe@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:24109
21899/y/this.__internal__onSocketMessage@https://polkadot.js.org/apps/modu.151b50df8afdab63.js:50:23088
How can I get this to work?
Any help is much appreciated
Please and thank you