Skip to content

Commit af06870

Browse files
authored
docs: comprehensive README update (#64)
* docs(README): update README to provide comprehensive information about Tezos Key Generation API, including features, architecture, quick start guide, configuration, API endpoints, use cases, and troubleshooting tips * docs(README): update documentation status to indicate work in progress and encourage contributions
1 parent 483e8a7 commit af06870

File tree

1 file changed

+161
-3
lines changed

1 file changed

+161
-3
lines changed

README.md

Lines changed: 161 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,164 @@
1-
Keygen is a tool for creating keys to be used with Teaquito Integration tests
1+
# Tezos Key Generation API
22

3-
# Docker:
3+
> ⚠️ **Documentation Status: Work in Progress** ⚠️
4+
>
5+
> This documentation is currently being developed and may not be complete. Some sections may contain placeholder information or require additional details. We're actively working to improve and expand these docs. If you find any issues or have suggestions, please open an issue or contribute to the documentation.
46
7+
A high-performance, Redis-backed API service for generating and managing Tezos cryptographic keys for integration testing and development environments.
58

6-
# Local Hosting
9+
## What It Does
10+
11+
The Tezos Key Generation API provides:
12+
13+
- **Automated Key Generation**: Creates batches of Tezos keys (secret/public key pairs) on demand
14+
- **Key Pool Management**: Maintains pools of pre-generated keys for fast access
15+
- **Multi-Network Support**: Supports multiple Tezos networks (ghostnet, rionet, seoulnet)
16+
- **Ephemeral Keys**: Temporary keys with configurable expiration for testing
17+
- **Funding Integration**: Automatically funds generated addresses with specified amounts
18+
- **Redis Backend**: Fast, persistent storage for key management
19+
20+
## Architecture
21+
22+
```
23+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
24+
│ API Client │ │ Key Generation │ │ Redis Store │
25+
│ │◄──►│ Service │◄──►│ │
26+
│ (HTTP/REST) │ │ │ │ (Key Pools) │
27+
└─────────────────┘ └─────────────────┘ └─────────────────┘
28+
│ │ │
29+
│ │ │
30+
▼ ▼ ▼
31+
┌─────────────────┐ ┌─────────────────┐ ┌─────────────────┐
32+
│ Tezos RPC │ │ Remote Signer │ │ Metrics & │
33+
│ (Network) │ │ (Signatory) │ │ Monitoring │
34+
└─────────────────┘ └─────────────────┘ └─────────────────┘
35+
```
36+
37+
## Quick Start
38+
39+
### Using Docker (Recommended)
40+
41+
```bash
42+
# Pull the latest image
43+
docker pull ghcr.io/ecadlabs/tezos-key-gen-api:latest
44+
45+
# Run with basic configuration
46+
docker run -d \
47+
--name keygen \
48+
-p 3000:3000 \
49+
-p 3001:3001 \
50+
-e REDIS_HOST=localhost \
51+
-e REDIS_PASSWORD=password123 \
52+
ghcr.io/ecadlabs/tezos-key-gen-api:latest
53+
```
54+
55+
### Local Development
56+
57+
```bash
58+
# Install dependencies
59+
npm install
60+
61+
# Build the project
62+
npm run build
63+
64+
# Start the service
65+
npm start
66+
```
67+
68+
## Configuration
69+
70+
### Environment Variables
71+
72+
| Variable | Default | Description |
73+
|----------|---------|-------------|
74+
| `REDIS_HOST` | `localhost` | Redis server hostname |
75+
| `REDIS_PORT` | `6379` | Redis server port |
76+
| `REDIS_PASSWORD` | `password123` | Redis authentication password |
77+
| `RPC_URL` | `https://ghostnet.ecadinfra.com` | Default Tezos RPC endpoint |
78+
| `TARGET_BUFFER` | `100` | Target number of keys in pool |
79+
| `BATCH_SIZE` | `20` | Number of keys to generate per batch |
80+
| `FUNDING_AMOUNT` | `10` | Amount in tez to fund each address |
81+
82+
### Configuration Files
83+
84+
- **`pools-config.json`**: Network-specific pool configurations
85+
- **`accounts-config.json`**: User account and network mappings
86+
- **`ephemeral-config.json`**: Ephemeral key settings
87+
88+
## API Endpoints
89+
90+
### Key Management
91+
92+
- `POST /{network}` - Get a key from the pool (e.g., `POST /ghostnet`)
93+
- `GET /{network}` - Get pool status and funding balance
94+
- `POST /{network}/ephemeral` - Create a new ephemeral key
95+
- `GET /{network}/ephemeral/{id}/keys/{key}` - Get ephemeral key details
96+
- `POST /{network}/ephemeral/{id}/keys/{key}` - Sign data with ephemeral key
97+
98+
### Metrics
99+
100+
- `GET /metrics` - Prometheus metrics endpoint (port 3001)
101+
102+
### Authentication
103+
104+
All endpoints require Bearer token authentication:
105+
```bash
106+
curl -H "Authorization: Bearer taquito-example" \
107+
http://localhost:3000/ghostnet
108+
```
109+
110+
## Supported Networks
111+
112+
- **Ghostnet**: `https://ghostnet.ecadinfra.com`
113+
- **Rionet**: `http://ecad-tezos-rionet-rolling-1.i.ecadinfra.com`
114+
- **Seoulnet**: `http://ecad-tezos-seoulnet-rolling-1.i.ecadinfra.com`
115+
116+
## Use Cases
117+
118+
- **Integration Testing**: Generate test keys for Tezos application testing
119+
- **Development**: Create development wallets and addresses
120+
- **QA Environments**: Provision test accounts with funding
121+
- **Load Testing**: Generate large numbers of keys for performance testing
122+
123+
## Monitoring
124+
125+
The service exposes Prometheus metrics on port 3001:
126+
127+
- Key pool sizes
128+
- Keys produced/issued counters
129+
- Funding account balances
130+
- HTTP request metrics
131+
132+
## Troubleshooting
133+
134+
### Common Issues
135+
136+
1. **Redis Connection Failures**
137+
- Ensure Redis is running and accessible
138+
- Check network connectivity between containers
139+
- Verify Redis credentials
140+
141+
2. **Key Generation Failures**
142+
- Check Tezos RPC endpoint accessibility
143+
- Verify remote signer (Signatory) is running
144+
- Ensure sufficient funding account balance
145+
146+
3. **Authentication Errors**
147+
- Verify Bearer token is valid
148+
- Check user account configuration in `accounts-config.json`
149+
150+
### Logs
151+
152+
Enable debug logging by setting log level to `debug` in your environment.
153+
154+
## Contributing
155+
156+
1. Fork the repository
157+
2. Create a feature branch
158+
3. Make your changes
159+
4. Add tests if applicable
160+
5. Submit a pull request
161+
162+
## License
163+
164+
ISC License - see LICENSE file for details.

0 commit comments

Comments
 (0)