Skip to content

Commit

Permalink
fix: correctly use controller when registering interest and ...
Browse files Browse the repository at this point in the history
correctly use node's ID when publishing metrics.
  • Loading branch information
nathanielc committed Jul 30, 2024
1 parent fcb5062 commit 38d4b97
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 2 additions & 2 deletions packages/core/src/ceramic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -662,11 +662,11 @@ export class Ceramic implements StreamReaderWriter, StreamStateLoader {
ceramicVersion: this._versionInfo.cliPackageVersion,
ipfsVersion: ipfsVersion.version,
intervalMS: this._metricsConfig?.metricsPublishIntervalMS || DEFAULT_PUBLISH_INTERVAL_MS,
nodeId: ipfsId.publicKey, // what makes the best ID for the node?
nodeId: ipfsId.id.toString(),
nodeName: '', // daemon.hostname is not useful
nodeAuthDID: this.did.id,
nodeIPAddr: '', // daemon.hostname is not the external name
nodePeerId: ipfsId.publicKey,
nodePeerId: ipfsId.id.toString(),
logger: this._logger,
})
this._logger.imp(
Expand Down
5 changes: 2 additions & 3 deletions packages/core/src/recon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,11 +169,10 @@ export class ReconApi extends Observable<ReconEventFeedResponse> implements IRec
}
try {
const headers = { 'Content-Type': 'application/json' }
const body = { ...(controller && { controller }) }
await this.#sendRequest(this.#url + `/ceramic/interests/model/${model.toString()}`, {
const query = controller ? `controller=${controller}` : ''
await this.#sendRequest(this.#url + `/ceramic/interests/model/${model.toString()}?${query}`, {
method: 'POST',
headers,
body,
})
this.#logger.debug(`Recon: added interest for model ${model.toString()}`)
} catch (err) {
Expand Down

0 comments on commit 38d4b97

Please sign in to comment.