sdk/js-sdk/examples/node-ethers/README.md
A single example demonstrating the full @fhevm/sdk lifecycle using ethers.js v6:
encryption, reading public values, and private decryption.
npm install in the repo root)Optionally provide a wallet private key:
cp .env.local.example .env.local
Without .env.local, a random wallet is used. The full flow still runs but decryption will fail (encrypted values are not on-chain).
npx tsx ./test-run.ts
client.ready (an alias for client.init()) once after creating the client. It resolves the protocol versions and loads the WASM; encryptValues, generateTransportKeyPair, and decryptValue throw if it hasn't run. (decryptPublicValues is the exception — it works without it.)durationSeconds). You can decrypt multiple batches of encrypted values without re-signing.FHE.allow() was not called for the user + encrypted value pair, decryption will fail.