-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add index provider library #143
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-authored-by: Miroslav Bajtoš <[email protected]>
Co-authored-by: Miroslav Bajtoš <[email protected]>
…/filecoin-station/deal-observer into nhaimerl-telemetry-payload-state
Co-authored-by: Julian Gruber <[email protected]>
bajtos
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change looks pretty good, let's improve the details.
|
@bajtos it seems like the GLIF token we use for RPC calls cannot be used as well for the smart contract calls: https://github.com/CheckerNetwork/spark-deal-observer/actions/runs/14218917560/job/39841932436?pr=143#step:7:125 Should I use the RPC_AUTH from spark checker for the smart contract calls instead? |
It seems like the |
Co-authored-by: Julian Gruber <[email protected]>
|
@bajtos @juliangruber authentication issue should be fixed now. |
|
Blocked by #145 |
I disagree.
I propose the following steps forward:
|
| import { | ||
| getIndexProviderPeerId, | ||
| MINER_TO_PEERID_CONTRACT_ADDRESS, MINER_TO_PEERID_CONTRACT_ABI | ||
| // @ts-ignore |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any follow-up issue (or a check-list item in an existing issue) to remind us that we need to remove this ts-ignore directive once index-provider-peer-id includes type definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a PR for it closing the issue that is tracking this: CheckerNetwork/index-provider-peer-id#21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am confused. After you land that pull request and auto-close the issue, who is going to edit backend/lib/resolve-payload-cids.js in this repository to remove the // @ts-ignore line?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After the pull request CheckerNetwork/index-provider-peer-id#21 is merged I can update the npm package version and then I should be able to remove the // @ts-ignore in all three repos.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent!
My question at the top of this thread was about ensuring this cleanup task is not forgotten.
Is there any follow-up issue (or a check-list item in an existing issue) to remind us that we need to remove this ts-ignore directive once index-provider-peer-id includes type definitions?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I created subtasks in the original issue to keep track
| const getPeerId = async (/** @type {number} */ minerId) => { | ||
| const peerId = minerPeerIds.get(`f0${minerId}`)?.PeerId | ||
| if (!peerId) { | ||
| throw new Error(`Peer ID not found for miner ID: ${minerId}`) | ||
| } | ||
| return Promise.resolve({ peerId, source: 'TEST' }) | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Either remove the async keyword or make it return { peerId, source.. }, having both is redundant (you're creating a promise that's resolving with a promise that's resolving with the value).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 330d290
Co-authored-by: Julian Gruber <[email protected]>
Co-authored-by: Julian Gruber <[email protected]>
This PR uses the newly released library to fetch index provider peer ids.
Related to
CheckerNetwork/index-provider-peer-id#10
CheckerNetwork/roadmap#250
CheckerNetwork/roadmap#244