What you need
- Node.js 24 or later.
-
The repository, with its dependencies installed. From the repository root:
Start the server
- Signing keys in
keys/: thedefaultandgatewaykeys that sign authorizations and records. - An approver key in
.parmana-dev/: the stand-in for the person who approves an action. Anyone who holds this private key can approve actions on your local server, so keep it to yourself. - A caller key in
.parmana-dev/caller.json: the key your code sends to the server. The file holds the raw key in itsrawfield, and the server stores only its hash.
.env file in the repository root:
When the server is running it listens on
http://localhost:3000. Stop it with Ctrl+C.
Check that it is running
In a second terminal:"status":"READY".
On Windows PowerShell, curl runs a different command that asks about script execution. Use curl.exe instead:
Use the keys in the Quickstart samples
The Quickstart samples use a demo key,my-secret-api-key, which only a server started from the Quickstart accepts. With npm run dev:setup, use the raw key from .parmana-dev/caller.json in its place, and the approver key at .parmana-dev/local-test-approver__local-test-approver-key-1.private.pem in place of the approver key path the Quickstart shows.
Remember that the dev:setup server allows only the test:fixture-execute capability for this caller, which is the capability the Quickstart samples use.
Start over
To reset, stop the server and delete the folders the script created:npm run dev:setup again. The script creates new keys.
Check the Parmana CLI
Theparmana command-line tool proposes policy changes, signs approvals, and checks the approval log. Build it once:
--helplists eight commands.log verifyreportsThe log verifiesand exits with code 0.- The dry run prints the request and says
Nothing was sent. - The wrong name prints
The file's policyId is "customer-refund", but the command names "wrong-name"and exits with code 2.
npm run dev:setup creates:
envelope.json and prints when it expires. The envelope is valid for 120 seconds. Use a real pending change ID from the server in place of test-pending-001.
To check the live server, start npm run dev:setup in one terminal. In a second terminal, set the caller key and run a command:
403 NON_HUMAN_CALLER_DENIED. That is expected. Policy changes and approvals need a credential for a verified person, and the dev setup provides only a service key. So you can’t complete a proposal or an approval against the local server. The approval steps are covered in the CLI quickstart.
If something goes wrong
- Port 3000 is in use. Another program is using it. Stop that program, then run the command again.
/readyanswers, but the CLI or the server reports401. Another server is answering on port 3000. A common cause is the API container from the Quickstart with Docker, which publishes port 3000. Check withdocker ps. Ifparmana-api-1is listed with3000->3000, stop it withdocker stop parmana-api-1, then runnpm run dev:setupagain. Stopping only the API container leaves the PostgreSQL container running, which the repository’s tests use.Cannot find module './build/Release/re2.node'. The native modulere2was not built, usually because the install skipped install scripts. Runnpm rebuild re2, then start the server again.PARMANA_POLICY_DIR is not setor akill-switch-probeerror. Your copy of the script is out of date. Update the repository and run the command again.- A
DeprecationWarningaboutDEP0190appears. It is harmless. The script still runs. - The script stops during key creation. Read the message above the error. Fix the cause, then run the command again. Finished steps are not repeated.
/readydoes not returnREADY. Read the server’s output in the terminal where you started it.
Next
- Quickstart: the full walkthrough, with each step explained.
- Self hosted: run the server with Docker and a database.