Skip to content
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

Providers file #1

Open
wants to merge 67 commits into
base: optprov
Choose a base branch
from

Conversation

FotiosBistas
Copy link

Motivation

Needing to store the CIDs along with the provider records provided by optimistic provide, to be able to gather different metrics.

Tasks

  • Implement writing provider records and corresponding CIDs to a providers.json file.

dennis-tra and others added 30 commits July 22, 2022 15:04
Created a new struct which encapsulates the data of the providers into a JSON format.
Added a method which will save the JSON format to a file.
Put provider method now returns the record to be written to the provider record file.
Plan: to be able to get all of the providers for a specific cid, open the file once and then store the provider records
Created necessary fields inside the estimator state struct to be able to receive new providers from the putProviderMethod using a channel. The providers are saved inside a map, a field of the estimator state struct.
Created a new type to do that cidAndProvider struct and this is sent over the channel.
When the channel receives a doneProviderChannel message it calls the saveProvidersToFile method insdie the record_providers file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants