/w3up-delegation-api

Talk India Blockchain Week/ETHindia

Primary LanguageJavaScript

w3up-delegation-api

HTTP API that can delegate capabilities to the agent DID using w3up-client

Usage

  1. Install HTTP API dependencies:
pnpm i
  1. Install w3up CLI from NPM:
npm install -g @web3-storage/w3up-cli
  1. Create a DID and export your account settings for the HTTP API:
w3up id
w3up register <email>
w3up settings export settings.json
w3up upload <file>
  1. Start your HTTP API Server (same directory where settings.json was exported):
npm run start
  1. Create a new account DID
w3up id --profile secondary
✔ Agent DID: did:key:z6M...
✔ Account DID: did:key:z6M...
  1. Delegate capabilities to a Agent DID:
curl http://127.0.0.1:3000\?did\=did:key:z6M... --output delegation.txt
  1. Import UCAN elegation provided:
w3up delegate import delegation.txt main --profile secondary
  1. List uploads from main account the API uses
w3up delegate switch main --profile secondary
w3up list --profile secondary