-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: compute piece for uploaded cars #228
Conversation
82ee974
to
6ed7cd0
Compare
6ed7cd0
to
48d8bb6
Compare
View stack outputs
|
48d8bb6
to
b4ae896
Compare
@@ -21,7 +22,7 @@ export default function (app) { | |||
app.setDefaultFunctionProps({ | |||
runtime: 'nodejs16.x', | |||
environment: { | |||
NODE_OPTIONS: "--enable-source-maps", | |||
NODE_OPTIONS: "--enable-source-maps --experimental-fetch", |
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.
https://github.com/web3-storage/fr32-sha2-256-trunc254-padded-binary-tree-multihash relies on globalThis.fetch
and we will need to rely on this until we can upgrade SST here to bump node version
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.
ACK, lets get that upgrade done soon!
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.
This LGTM, I left a few nits. Please can we also publish an equivalency claim?
) | ||
export class DatabaseOperationFailed extends Error { | ||
get reason() { | ||
return this.message |
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 this necessary? Why not just use the message property?
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.
It follows the same pattern as ucanto
does https://github.com/web3-storage/ucanto/blob/c8999a59852b61549d163532a83bac62290b629d/packages/core/src/result.js#L63 for failures, so that the types of failures from handlers of ucanto server are all well aligned. So, not strictly necessary, but consistent
filecoin/package.json
Outdated
"@aws-sdk/client-sqs": "^3.226.0", | ||
"@sentry/serverless": "^7.22.0", | ||
"@web3-storage/data-segment": "^3.0.1", | ||
"fr32-sha2-256-trunc254-padded-binary-tree-multihash": "github:web3-storage/fr32-sha2-256-trunc254-padded-binary-tree-multihash", |
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 think this can be npm now?
}) | ||
}) | ||
|
||
test('computes piece cid from a CAR file in the bucket', async t => { |
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.
test('computes piece cid from a CAR file in the bucket', async t => { | |
test('computes piece CID from a CAR file in the bucket', async t => { |
@@ -21,7 +22,7 @@ export default function (app) { | |||
app.setDefaultFunctionProps({ | |||
runtime: 'nodejs16.x', | |||
environment: { | |||
NODE_OPTIONS: "--enable-source-maps", | |||
NODE_OPTIONS: "--enable-source-maps --experimental-fetch", |
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.
ACK, lets get that upgrade done soon!
test/helpers/table.js
Outdated
minTimeout: 1000, | ||
retries: 100 | ||
}) | ||
} catch {} |
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'd let this throw - if we don't find after 100 retries it ain't coming.
Yes, it is mentioned in main comment and will come as follow up PR |
Co-authored-by: Alan Shaw <[email protected]>
CI for integration tests is failing given resources were destroyed for kinesis for this cloudformation |
This is the first of a series of PRs to integrate w3up with w3filecoin.
This PR adds Filecoin Stack, where CARPARK bucket is hooked up with a lambda to compute Piece CIDs via Event Bus events. A queue is in the middle to keep the flow steady. Once a PR is computed, its details are written into a DynamoDB table. This will have all the information users might need to ask, in order to then ask Deal Tracker for information for a given deal. In other words, it maps
piece
,link
(Car CID),aggregate
andinclusionProof
(TBD what it actually is, is it a CID for a stored file in a bucket?).Also integration tests were added.
In a follow up PR, a event will be hooked up from DynamoDB table insert to trigger
segment/add
capability from Aggregator together with writing a claim to equivalency claims.TODO: