CLI
Install
The CLI is the voynich binary of the voynich npm package, the same package that holds the SDK. It needs Node 22 or later.
npm install -g voynichThe three enclave commands load a second package, voynich-enclave, the enclave runtime, which also brings a voynich-enclave binary of its own. An operator installs both:
npm install -g voynich voynich-enclavePoint it at the API#
Every command reads and builds transactions through the Voynich API. Set its address once:
export VOYNICH_API_URL=https://<api host>or pass it per command:
voynich models --api-url https://<api host>Commands#
| Command | Job |
|---|---|
voynich seal <weights file> | Encrypt a weights file, write the ciphertext to chain, seal the model and, with --enclave, grant a first enclave. |
voynich models | List sealed models. |
voynich model price <model> | Set a model's price and operator share, as the model's owner. |
voynich model retire <model> | Retire a model, as the model's owner. |
voynich enclaves | List registered enclaves. |
voynich grant <model> <enclave> | Wrap a model's key to an enclave, as the model's owner. |
voynich model revoke <model> <enclave> | Revoke an enclave's grant, as the model's owner. |
voynich call <model> <input.json> | Call a model and print the output, the receipt and the checks. |
voynich refund <call> | Return the escrow of a call that passed its deadline without a receipt. |
voynich verify <id> | Check a receipt by its address, its call's address or its settling transaction's signature. |
voynich enclave register | Attest an enclave and register it. |
voynich enclave run | Run the enclave runtime. |
voynich enclave status | Print an enclave's address, keys and registration. |
voynich account <wallet> | Print a wallet's models, enclaves, calls and earnings. |
voynich --help, voynich -h and voynich with no command print the usage to stderr and exit with code 0:
voynich models | enclaves | call <model> <input.json> | verify <receipt> | seal <weights.onnx> --manifest <manifest.json> --state <owner.enc.json> --price <base units> --operator-share-bps <bps> --measurement <hex48> --upload-funding <lamports> [--enclave <key>] [--resume]
voynich grant <model> <enclave> --state <owner.enc.json> | refund <call> | enclave register|run|status | account <wallet>
voynich model price <model> --price <base units> [--operator-share-bps <bps>] [--mint <SOL|mint address>] [--decimals <n>] [--symbol <symbol>]
voynich model retire <model> | model revoke <model> <enclave>
Global: --api-url <url> --keypair <Solana JSON file>; VOYNICH_PASSWORD supplies a noninteractive owner-file password. Results are JSON on stdout; prompts and progress go to stderr.Global flags#
Flags can stand anywhere on the line, before or after the command and its arguments.
--api-urlURLThe Voynich API's address. It takes the place of VOYNICH_API_URL for this command.
--keypairfile pathA Solana JSON keypair file to sign with. It takes the place of VOYNICH_KEYPAIR for a command that signs, and of OPERATOR_KEYPAIR for enclave register and enclave run.
--help, -hflagPrint the usage and exit.
Environment variables#
VOYNICH_API_URLURLThe Voynich API's address. Set it to https://<api host>. When it is unset and --api-url is not given, the CLI uses http://127.0.0.1:9702.
VOYNICH_KEYPAIRfile pathThe Solana JSON keypair file the CLI signs with: a JSON array of 64 integers from 0 to 255, the format solana-keygen writes. Only the commands that sign read it.
VOYNICH_PASSWORDstringThe password of the owner key file, for seal and grant where no terminal is attached. When it is set the CLI does not prompt.
The enclave commands read their own variables, listed in enclave.
The signing wallet#
The CLI signs with a keypair file. Which file depends on the command.
seal, grant, call, refund, model price, model retire and model revoke take the first of these that is set:
--keypairVOYNICH_KEYPAIRkeypair_pathin the Solana CLI's config file,~/.config/solana/cli/config.yml. A relative path is read from the config file's folder, and a leading~is the home folder.~/.config/solana/id.json, when the config file does not exist or names nokeypair_path.
enclave register and enclave run sign as the operator and take the first of:
--keypairOPERATOR_KEYPAIR- the Solana CLI's keypair, found the same way as above.
models, enclaves, verify, account and enclave status sign nothing and need no wallet. They do not read --keypair or VOYNICH_KEYPAIR.
A command that signs fails with one of these when its keypair file cannot be used:
| Message | Cause |
|---|---|
VOYNICH_KEYPAIR must name a readable Solana JSON keypair file | The file is missing, unreadable or not JSON. |
VOYNICH_KEYPAIR must name a Solana JSON keypair file | The file is JSON but not an array of 64 bytes. |
Solana CLI config has an invalid quoted keypair_path | The keypair_path in the Solana CLI's config opens a quote that does not close. |
Output and exit codes#
- A command prints its result to stdout as JSON, indented by two spaces. Amounts and slots are decimal strings.
- Progress, the password prompt and the log lines of the
enclavecommands go to stderr, so stdout can be piped into a file or a JSON tool.sealwrites one progress line per step, and one per upload write. - A command that fails prints one line to stderr and exits with code
1. When the failure has a code, the line is the code, a colon and the message, such asRECEIPT_NOT_FOUND: This receipt was not found.Otherwise it is the message alone. - A command that prints its result exits with code
0.voynich verifyprints its result and exits with code1when the receipt is not verified.
voynich models > models.jsonA missing argument fails with Supply <what is missing>., for example Supply receipt address, call address or transaction signature. The codes are the API's error codes and the SDK's errors. A command the CLI does not have fails with Unknown command: <command>. Use --help.