Install the new CLI:
npm install -g @web3-storage/w3cli
Create and register new space:
w3 space create SPACENAME
Install the new CLI:
npm install -g @web3-storage/w3cli
Create and register new space:
w3 space create SPACENAME
Create a keypair for the server
npx ucan-key ed --json
Note down did
and key
values!
// Goals: | |
// 1. Decouple store from agent | |
// 2. Simplify agent creation | |
// 3. Agent governs data format not store | |
// 4. Initialization of agent, not store | |
// 5. DRY initialization in agent, not repeated in each store impl | |
/** | |
* @param {AgentData} [data] Agent data | |
* @param {object} [options] |
import fs from 'fs' | |
import path from 'path' | |
const dir = path.join('ansible', 'inventories', 'bifrost', 'host_vars') | |
const regex = /ipfs_config_identity_peerid: "(.*)"/ig | |
async function main () { | |
const peers = [] | |
for (const f of fs.readdirSync(dir)) { | |
if (!(f.startsWith('ipfs-bank') && f.endsWith('ipfs.gateway.dwebops.net.yml'))) continue |
import { useState } from 'react' | |
import { useUploader } from '@w3ui/react-uploader' | |
export default function Component () { | |
const { uploader } = useUploader() | |
const [file, setFile] = useState(null) | |
const [cid, setCid] = useState('') | |
const handleUploadSubmit = async e => { | |
e.preventDefault() |
An index mapping block CID to linked block CID.
/** | |
* Extract an S3Event from the passed SNSEvent. | |
* @param {import('aws-lambda').SNSEvent} snsEvent | |
* @returns {import('aws-lambda').S3Event} | |
*/ | |
function toS3Event (snsEvent) { | |
const s3Event = { Records: [] } | |
for (const snsRec of snsEvent.Records) { | |
try { | |
for (const s3Rec of JSON.parse(snsRec.Sns.Message).Records || []) { |
review-requested:alanshaw |
// Lambda index CAR //////////////////////////////////////////////////////////// | |
const blocks = Set<CID>() | |
const links = Set<CID>() | |
const car = readCar(path) | |
for (const block in car) { | |
blocks.add(block.cid) | |
getLinks(block).forEach(cid => links.add(cid)) | |
} |
import { NFTStorage } from 'nft.storage' | |
import { getFilesFromPath } from 'files-from-path' | |
import { FsBlockStore as Blockstore } from 'ipfs-car/blockstore/fs' | |
import Path from 'path' | |
const token = 'YOUR_API_TOKEN' | |
// /////////////////////////////////////////////////////////////////////////// | |
// Save DAG to a custom location by changing this path... | |
const bsPath = './blockstore' |