To login...
Client issues:
iss: did:key:agent
aud: did:web:web3.storage
can: access/authorize
with: did:key:agent
nb:| $ echo 'alantest 2025-05-12-1' | w3 up | |
| created shard: 4.414ms | |
| hashing shard: 0.013ms | |
| invoking blob/add: 1.522s | |
| invoking http/put: 181.018ms | |
| invoking ucan/conclude http/put: 935.68ms | |
| polling for receipt: 1.081s | |
| hashing piece: 54.925ms | |
| invoking filecoin/offer: 460.332ms | |
| invoking blob/add: 1.216s |
| // Ported from https://github.com/telegramdesktop/tdesktop/blob/1757dd856b84d23f83d4e562c94dde825f6eb40c/Telegram/SourceFiles/ui/image/image.cpp#L43 | |
| const decodeStrippedThumb = (bytes: Uint8Array) => { | |
| if (bytes.length < 3 || bytes[0] !== 1) throw new Error('invalid thumb') | |
| const real = new Uint8Array(header.length + (bytes.length - 2) + footer.length) | |
| real.set(header) | |
| real[164] = bytes[1] | |
| real[166] = bytes[2] | |
| real.set(bytes.subarray(3), header.length) | |
| real.set(footer, header.length + (bytes.length - 2)) | |
| return real |
To login...
Client issues:
iss: did:key:agent
aud: did:web:web3.storage
can: access/authorize
with: did:key:agent
nb:| package main | |
| import ( | |
| "fmt" | |
| "github.com/libp2p/go-libp2p/core/crypto" | |
| "github.com/libp2p/go-libp2p/core/peer" | |
| ed25519 "github.com/storacha/go-ucanto/principal/ed25519/verifier" | |
| ) |
| # prod | |
| export STORACHA_SERVICE_DID=did:web:up.storacha.network | |
| export STORACHA_SERVICE_URL=https://up.storacha.network | |
| export STORACHA_STORE_NAME=storacha-cli-prod | |
| export STORACHA_RECEIPTS_URL=https://up.storacha.network/receipt/ | |
| # staging | |
| export STORACHA_SERVICE_DID=did:web:staging.up.storacha.network | |
| export STORACHA_SERVICE_URL=https://staging.up.storacha.network | |
| export STORACHA_STORE_NAME=storacha-cli-staging |
| import fs from 'node:fs' | |
| import { Readable } from 'node:stream' | |
| import { CARReaderStream } from 'carstream' | |
| import * as dagCBOR from '@ipld/dag-cbor' | |
| import * as dagJSON from '@ipld/dag-json' | |
| import * as DID from '@ipld/dag-ucan/did' | |
| Readable.toWeb(fs.createReadStream('proof.car')) | |
| .pipeThrough(new CARReaderStream()) | |
| .pipeTo(new WritableStream({ |
| \x01\x55\x00\x00 | |
| bafkqaaa |
| export STORACHA_SERVICE_DID=did:web:staging.up.storacha.network | |
| export STORACHA_SERVICE_URL=https://staging.up.storacha.network | |
| export STORACHA_STORE_NAME=storacha-cli-staging | |
| export STORACHA_RECEIPTS_URL=https://staging.up.storacha.network/receipt/ |
| // node mkdelegate.js <private-key> | |
| import { delegate } from '@ucanto/core' | |
| import * as ed25519 from '@ucanto/principal/ed25519' | |
| import * as Link from 'multiformats/link' | |
| import { identity } from 'multiformats/hashes/identity' | |
| import { base64 } from 'multiformats/bases/base64' | |
| import * as DID from '@ipld/dag-ucan/did' | |
| const indexingServiceDID = 'did:web:staging.indexer.storacha.network' | |
| const uploadServiceDID = 'did:web:staging.up.storacha.network' |
| const cids = [ | |
| 'bafybeiei72mvsmckxh6jliaxtgtmktcucw6zjktmjko6lpdb76uy677nym', | |
| 'bafybeige7or65xqaqzbrsrnyf3alrcmr3mbkiwvbevc3hpkpiydbixjcte', | |
| 'bafybeidovp3gf6h6aye6vv25o3r6ayc32c3znzgijtvqqmqrnsfcljvz7i', | |
| 'bafybeigqhr6wptfw6a2jjvvd6alq73mgnn2ugfmnnzdksmaid44divhnju', | |
| 'bafybeicih3gpoxip4n2ozuqqfskdwymxcr27i6xgtdmnivuhy5q76weklu', | |
| 'bafybeia2fnngg5gzhc6v6ul23j67m4b4j3ekyxnonvyx5n4uo7jtq236my', | |
| 'bafybeieymcyqlnif4rtzt3cfterlyudr6lz6bpt3kkchji7bxgcjq3a4iy', | |
| 'bafybeibh4swn5lir77xo3sdxps5h3kl6xygmhutdkqwewnyrdvjz435nue', | |
| 'bafybeifef47tawlpfdjlrmvohjrnxgozarrwxkrdcqx3mmwigf4fakfr6a', |