-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: get receipt support in client (#1135)
Adds `getReceipt(taskCid)` support in client after endpoint added into w3filecoin earlier this week storacha/w3infra#275 When you get a CID from an invocation, you can look for its receipt and go through receipt chain if you like from the client :)
- Loading branch information
1 parent
aa4ba63
commit 660d088
Showing
8 changed files
with
94 additions
and
2 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
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
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
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
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
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
Binary file not shown.
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 @@ | ||
import { createServer } from 'http' | ||
import fs from 'fs' | ||
import path from 'path' | ||
import { fileURLToPath } from 'url' | ||
|
||
const port = process.env.PORT ?? 9201 | ||
const __dirname = path.dirname(fileURLToPath(import.meta.url)) | ||
const fixtureName = process.env.FIXTURE_NAME || 'workflow.car' | ||
|
||
const server = createServer((req, res) => { | ||
res.setHeader('Access-Control-Allow-Origin', '*') | ||
res.setHeader('Access-Control-Allow-Methods', '*') | ||
res.setHeader('Access-Control-Allow-Headers', '*') | ||
|
||
fs.readFile( | ||
path.resolve(`${__dirname}`, '..', 'fixtures', fixtureName), | ||
(error, content) => { | ||
if (error) { | ||
res.writeHead(500) | ||
res.end() | ||
} | ||
res.writeHead(200, { | ||
'Content-disposition': 'attachment; filename=' + fixtureName, | ||
}) | ||
res.end(content) | ||
} | ||
) | ||
}) | ||
|
||
server.listen(port, () => console.log(`Listening on :${port}`)) |