From 71ccf73121b27b66ba710cf9209bc906c63fb604 Mon Sep 17 00:00:00 2001 From: Travis Vachon Date: Wed, 17 Jan 2024 09:52:10 -0800 Subject: [PATCH] fix: update "byo agent" example to match website snippet update to match changes from https://github.com/web3-storage/www/pull/72 --- packages/w3up-client/README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/w3up-client/README.md b/packages/w3up-client/README.md index eb041746e..154fe4a1e 100644 --- a/packages/w3up-client/README.md +++ b/packages/w3up-client/README.md @@ -180,6 +180,7 @@ import * as Signer from '@ucanto/principal/ed25519' // Agents on Node should use import { importDAG } from '@ucanto/core/delegation' import { CarReader } from '@ipld/car' import * as Client from '@web3-storage/w3up-client' +import { StoreMemory } from '@web3-storage/w3up-client/stores' async function main () { // from "bring your own Agent" example in `Creating a client object" section` @@ -187,7 +188,8 @@ async function main () { // KEY: `npx ucan-key ed --json` in command line, which returns private key and DID for Agent (the private key is stored in KEY) // PROOF: w3cli used to run `w3 delegation create --can 'store/add' --can 'upload/add' | base64`, which returns the delegation from Space to the Agent we're using (stored in PROOF) const principal = Signer.parse(process.env.KEY) - const client = await Client.create({ principal }) + const store = new StoreMemory() + const client = await Client.create({ principal, store }) // now give Agent the delegation from the Space const proof = await parseProof(process.env.PROOF)