Skip to content

Commit

Permalink
fix: force prepend piece
Browse files Browse the repository at this point in the history
  • Loading branch information
vasco-santos committed Feb 6, 2024
1 parent 4204cb1 commit a904867
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 12 deletions.
29 changes: 20 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@ucanto/transport": "^9.0.0",
"@web3-storage/capabilities": "^12.0.3",
"@web3-storage/data-segment": "^5.0.0",
"@web3-storage/filecoin-api": "^4.3.1",
"@web3-storage/filecoin-api": "^4.4.0",
"@web3-storage/filecoin-client": "^3.1.3",
"fzstd": "^0.1.0",
"multiformats": "12.0.1",
Expand Down
3 changes: 2 additions & 1 deletion packages/functions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"@ucanto/core": "^9.0.0",
"@ucanto/server": "^9.0.1",
"@ucanto/transport": "^9.0.0",
"@web3-storage/filecoin-api": "^4.3.1",
"@web3-storage/data-segment": "5.0.0",
"@web3-storage/filecoin-api": "^4.4.0",
"@web3-storage/filecoin-client": "3.0.1",
"@w3filecoin/core": "*"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { createClient as createBufferStoreClient } from '@w3filecoin/core/src/st
import { createClient as createBufferQueueClient, decodeMessage } from '@w3filecoin/core/src/queue/buffer-queue.js'
import { createClient as createAggregateOfferQueueClient } from '@w3filecoin/core/src/queue/aggregate-offer-queue.js'
import * as aggregatorEvents from '@web3-storage/filecoin-api/aggregator/events'
import { Piece } from '@web3-storage/data-segment'

import { mustGetEnv } from '../utils.js'

Expand Down Expand Up @@ -93,7 +94,14 @@ function getContext () {
config: {
maxAggregateSize,
minAggregateSize,
minUtilizationFactor
minUtilizationFactor,
prependBufferedPieces: [{
// Small piece to prepend that is encoded as a CAR file
piece: Piece.fromString('bafkzcibciab3bwd67rgcoiejigar34jguwfasa5327hq3sjdcma3zz2ccupy4oi').link,
// will be prepended, so policy is irrelevant
policy: /** @type {import('@web3-storage/filecoin-api/src/aggregator/api').PiecePolicy} */ (0),
insertedAt: (new Date()).toISOString()
}]
}
}
}
Expand Down

0 comments on commit a904867

Please sign in to comment.