This file contains hidden or 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
# 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 |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"github.com/filecoin-project/go-state-types/abi" | |
"github.com/storacha/piri/pkg/pdp/proof" | |
) | |
func main() { |
This file contains hidden or 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
import createCharm from 'charm' | |
const charm = createCharm() | |
charm.pipe(process.stdout) | |
charm.reset() | |
for (var i = 0; i < 256; i++) { | |
charm.background(i).write(i+'\n') | |
} |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"strconv" | |
"time" | |
"github.com/multiformats/go-multibase" | |
"github.com/multiformats/go-multicodec" | |
"github.com/multiformats/go-multihash" |
This file contains hidden or 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
package main | |
import ( | |
"fmt" | |
"io" | |
"net/http" | |
) | |
func main() { | |
fmt.Println(ResolveDIDKey()) |
This file contains hidden or 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
package main | |
import ( | |
crypto_ed25519 "crypto/ed25519" | |
"crypto/x509" | |
"encoding/pem" | |
"fmt" | |
"os" | |
"github.com/libp2p/go-libp2p/core/crypto" |
This file contains hidden or 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
// 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' |
This file contains hidden or 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
echo 'alantest 2025-05-29' > test.txt | |
storacha up test.txt --verbose | |
# Should get: | |
# bafybeidamzcqbpfirdtrbjjhhybp5nfyl5vnjudbsoszg3jnbrwrjupetm | |
# Does IPNI have the info? | |
curl https://staging.ipni.storacha.network/cid/bafybeidamzcqbpfirdtrbjjhhybp5nfyl5vnjudbsoszg3jnbrwrjupetm | |
# Currently: |
This file contains hidden or 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
$ 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 |
This file contains hidden or 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
// 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 |
NewerOlder