We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Current Storage interface is designed as below
type ContentStorage interface { Get(contentId []byte) ([]byte, error) Put(contentId []byte, content []byte) error }
In the history network, we just need contentId to get or store data.
contentId
But in the beacon network, we must know the contentKey to store or get data. So we can change the interface as below
contentKey
type ContentStorage interface { Get(contentKey []byte, contentId []byte) ([]byte, error) Put(contentKey []byte, contentId []byte, content []byte) error }
because the contentKey is []byte, when we use it, it should be decode to the relevant types。
there is another choice, which contentKey is an interface, which impl the toContentId method
toContentId
type Something interface { toContentId() []byte } type ContentStorage interface { Get(contentKey Something ) ([]byte, error) Put(contentKey Something , content []byte) error }
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Current Storage interface is designed as below
In the history network, we just need
contentId
to get or store data.But in the beacon network, we must know the
contentKey
to store or get data. So we can change the interface as belowbecause the contentKey is []byte, when we use it, it should be decode to the relevant types。
there is another choice, which contentKey is an interface, which impl the
toContentId
methodThe text was updated successfully, but these errors were encountered: