ceramicnetwork / js-ceramic

Typescript implementation of the Ceramic protocol
http://ceramic.network
Other
414 stars 127 forks source link

fix: correctly use controller when registering interest and correctly use node's ID when publishing metrics. #3273

Closed nathanielc closed 2 months ago

nathanielc commented 2 months ago

Description

In testing the node metrics publish I found two bugs:

  1. Metrics interest was for all peers not just itself.
  2. The node id was empty causing the published data to fail validation.

This fixes both issues.

The controller needs to be a query parameter not a POST body object.

The ipfsId.publicKey was empty I do not know why, however the ipfsId.id field was set correctly and works as expected.

How Has This Been Tested?

Manually tested, starting a node. Previously the node saw errors everytime it tried to publish metrics. Additionally I directly inspected the interest and was able to see it was for all controllers not just itself. I have manually verified the interest is now for the specific controller.

PR checklist

Before submitting this PR, please make sure:

References:

Please list relevant documentation (e.g. tech specs, articles, related work etc.) relevant to this change, and note if the documentation has been updated.