Skip to content

feat!: provider + consumer + subscription #746

Draft
Gozala wants to merge 9 commits intomainfrom
feat/auto-provider
Draft

feat!: provider + consumer + subscription #746
Gozala wants to merge 9 commits intomainfrom
feat/auto-provider

Conversation

@Gozala
Copy link
Contributor

@Gozala Gozala commented Apr 11, 2023

No description provided.

1. Insert into `subscription` table record where
- `provider` is `with`
- `customer` is `nb.customer`
- `order` is `nb.order`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { cid: order } = CBOR.write({ customer, consumer })
const key = `${order}@${providerDID}`

db.put(key, { provider, customer, order })


2. Insert into `consumer` table records where
- `subscription` is `${nb.order}@${with}`
- `consumer` is `*`
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

const { with: provider, nb: { consumer, order } } = invocation.capability

db.consumer.put(`${order}@${provider}`, { consumer, order, provider })

travis pushed a commit to storacha/w3infra that referenced this pull request May 23, 2023
…mer tables (#200)

Implement the subscription and consumer tables specified by @Gozala in
storacha/w3up#746 and use them to implement
a new version of ProvisionStorage

This builds on a PR review from @Gozala that lays out some of the
queries we will need to support with these new tables:


#194 (review)

This is configured to merge into the main "D1 to Dynamo" development
branch - I'm in favor of going to production with this implementation of
`ProvisionStorage` rather than the one in that branch now.
travis added a commit to storacha/w3infra that referenced this pull request Jun 2, 2023
rework the indexes of the subscription and consumer tables per his guidance in storacha/w3up#746 (comment)
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.

1 participant