-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
dc4c898
commit 66ea4e0
Showing
4 changed files
with
136 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Get Aggregate deals | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
piece: | ||
required: true | ||
description: PieceCID of the aggregate | ||
type: string | ||
|
||
jobs: | ||
getDeals: | ||
name: Get Aggregate deals | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
env: ['staging', 'production'] | ||
timeout-minutes: 20 | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- uses: actions/setup-node@v3 | ||
with: | ||
registry-url: 'https://registry.npmjs.org' | ||
node-version: 18 | ||
cache: 'npm' | ||
- run: npm ci | ||
- name: Run job | ||
env: | ||
CF_API_TOKEN: ${{ secrets.CF_GATEWAY_TOKEN }} | ||
run: pm run get-aggregate-deals -w packages/tools ${{ github.event.inputs.piece }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import { Piece } from '@web3-storage/data-segment' | ||
import * as DID from '@ipld/dag-ucan/did' | ||
import * as Signer from '@ucanto/principal/ed25519' | ||
import { DealTracker } from '@web3-storage/filecoin-client' | ||
|
||
const pieceString = process.argv[2] | ||
if (!pieceString) { | ||
throw new Error('no aggregate piece was provided') | ||
} | ||
|
||
const storefront = await Signer.generate() | ||
const res = await DealTracker.dealInfo( | ||
{ | ||
issuer: storefront, | ||
with: storefront.did(), | ||
audience: DID.parse('did:web:web3.storage'), | ||
}, | ||
Piece.fromString(pieceString).link | ||
) | ||
|
||
console.log(`known information for aggregate ${pieceString}:`) | ||
console.log(res.out.ok) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "@w3filecoin/tools", | ||
"version": "0.0.0", | ||
"type": "module", | ||
"scripts": { | ||
"get-aggregate-deals": "node get-aggregate-deals.js" | ||
}, | ||
"dependencies": {}, | ||
"devDependencies": { | ||
"@ipld/dag-ucan": "3.4.0", | ||
"@ucanto/principal": "9.0.0", | ||
"@web3-storage/data-segment": "5.0.0", | ||
"@web3-storage/filecoin-client": "3.1.0" | ||
}, | ||
"engines": { | ||
"node": ">=18.16" | ||
} | ||
} |