mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
371 lines
8.6 KiB
Markdown
371 lines
8.6 KiB
Markdown
# Highway Service (hway)
|
|||
|
|
|
||
|
|
Highway is a high-performance task processing service for Sonr's decentralized vault system. It provides asynchronous, durable execution of cryptographic operations using WebAssembly enclaves and Redis-backed job queues.
|
||
|
|
|
||
|
|
## Overview
|
||
|
|
|
||
|
|
Highway acts as a distributed task processor that handles secure cryptographic operations for the Sonr blockchain ecosystem. It leverages:
|
||
|
|
|
||
|
|
- **Asynq** for reliable job queue management with Redis
|
||
|
|
- **Proto.Actor** for actor-based concurrency
|
||
|
|
- **WebAssembly enclaves** for secure cryptographic operations
|
||
|
|
- **IPFS integration** for decentralized storage
|
||
|
|
|
||
|
|
## Quick Start
|
||
|
|
|
||
|
|
### Prerequisites
|
||
|
|
|
||
|
|
- Redis server running on `127.0.0.1:6379`
|
||
|
|
- Go 1.24.4 or later
|
||
|
|
|
||
|
|
### Installation
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Build and install the Highway service
|
||
|
|
make install
|
||
|
|
|
||
|
|
# Or build directly
|
||
|
|
cd cmd/hway
|
||
|
|
go build -o hway .
|
||
|
|
```
|
||
|
|
|
||
|
|
### Running the Service
|
||
|
|
|
||
|
|
```bash
|
||
|
|
# Start the Highway service
|
||
|
|
./hway
|
||
|
|
```
|
||
|
|
|
||
|
|
The service will connect to Redis and begin processing vault tasks with the following configuration:
|
||
|
|
|
||
|
|
- **Concurrency**: 10 workers
|
||
|
|
- **Queue Priorities**:
|
||
|
|
- `critical`: 6 workers
|
||
|
|
- `default`: 3 workers
|
||
|
|
- `low`: 1 worker
|
||
|
|
|
||
|
|
## Architecture
|
||
|
|
|
||
|
|
Highway implements a multi-layered architecture for secure task processing:
|
||
|
|
|
||
|
|
```
|
||
|
|
|