Local Development
Running an attestor locally
Reclaim's attestor is a stateless machine, you can start generating proofs with your local setup, all you need is a private key for your attestor.
Overview
Following this doc, you will be able to run an attestor locally and start generating Reclaim proofs.
Flows
Running the attestor
The workflow is as follows:
- Clone the
attestor-core
repository:git clone https://github.com/reclaimprotocol/attestor-core.git
- Install packages:
npm i
- Create an
.env.producation
with at least thePRIVATE_KEY
variable populated:PRIVATE_KEY=0x...
- Start the server:
NODE_ENV=production npm run start --env-file=.env.production -- src/scripts/start-server
Running the last command will print a WebSocket url for you, you will need this in the next step.
Generating a proof
Now that your attestor is running in the background, you can connect to it and start generating proofs:
-
Create a node.js environment:
npm init --yes
-
Install
attestor-core
:npm i https://github.com/reclaimprotocol/attestor-core
-
Download ZK files:
node node_modules/@reclaimprotocol/zk-symmetric-crypto/lib/scripts/download-files
-
Create a .js file with the following script and plug in your attestor's metadata:
Deploying Your Own Reclaim Server
Deploying a Reclaim server is straightforward using the docker-compose. The server is stateless, allowing for easy horizontal scaling. Follow these steps after running docker compose up
:
- Set up a proxy: Use a reverse proxy, such as Nginx, to make the Reclaim HTTP server accessible over the internet.
- Configure HTTPS: Implement HTTPS on your reverse proxy.
- Configure WebSocket: Configure your reverse proxy to handle WebSocket connections, which are essential for Reclaim's functionality.
You should then have an RPC URL in the format wss://<your-domain>/ws
. To confirm your server is working correctly on mobile devices through a browser-based RPC, navigate to https://<your-domain>/browser-rpc
. If the server is correctly configured, you will see the message "Attestor Core RPC".