This guide describes how to use @aleohq/sdk with AlphaZK API service
Introduction
aleohq/sdk does not support authentication. Since the AlphaZK API service requires authentication we created a simple reverse proxy to handle the authentication for aleohq/sdk.
Requirements
- AlphaZK API key (Can be obtained by registering at here)
- Ubuntu 22.04 (Can be another Debian-based Linux distro)
- auth-proxy from AlphaZK
- Git CLI
- Bun (https://bun.sh/)
Install & run auth-proxy
Follow these steps to install and run auth-proxy.
Install Bun:
curl -fsSL https://bun.sh/install | bash
Clone auth-proxy repository:
git clone https://github.com/alpha-zk/auth-proxy.git
cd auth-proxy
Install node_modules:
bun install
Create .env file:
mv env_dist .env
Edit .env file:
ALPHAZK_API_ENDPOINT=aleo-testnet3.alphazk.com
ALPHAZK_API_KEY=PUT_YOUR_ALPHAZK_API_KEY_HERE
Run auth-proxy:
bun run index.ts
At this point, you can use the http://localhost:3033/v1
as your Aleo API endpoint. The auth-proxy will take care of the authentication.
The above workaround is only viable for a development environment. For production deployments; Kong, Nginx or similar software should be used as a reverse proxy.