A Go-based service that monitors and processes zkCertificate operations from the Galactica Network smart contracts.
ZK Certificates Queue Processor implements the Queue Processor specification for the Galactica Network. It:
- Monitors the certificate queue for pending operations
- Retrieves merkle proofs from the merkle proof service
- Processes certificate issuance and revocation operations
- Submits transactions to update the on-chain merkle tree
The service consists of several components:
- EVM Service: Monitors blockchain events from smart contracts
- Queue Processor: Processes queued certificate operations
- Event Bus: Internal communication between services
- HTTP Server: Health check and monitoring endpoints
- Go 1.21 or higher
- Access to a Galactica Network RPC endpoint
- Access to a Merkle Proof Service instance
- A funded wallet for submitting transactions (if running as processor)
The service supports multiple registry contracts configured in YAML files. See config/ directory for examples.
Example configuration:
registries:
- name: "Main Registry"
address: "0xFe35EF5D1E8488a6b06BD35434613917e7d9760f"
- name: "Secondary Registry"
address: "0x1234567890abcdef1234567890abcdef12345678"Copy .env.example to .env and configure:
cp .env.example .envCONFIG_FILE: Path to configuration file (defaults to config.yaml)- Use
config/cassiopeia.yamlfor testnet - Use
config/mainnet.yamlfor mainnet
- Use
EVM_RPC_URL: Ethereum RPC endpoint (defaults to Galactica Cassiopeia testnet)
PRIVATE_KEY: Private key for submitting transactions (required for processing operations)PORT: HTTP server port (defaults to 8080)MERKLE_SERVICE_URL: Merkle proof service gRPC endpoint (defaults to grpc-merkle.lookhere.tech:443)MERKLE_SERVICE_TLS: Enable TLS for merkle service connection (defaults to true)
Note: The service automatically reads the contract's initialization block from the chain and starts scanning from there.
# Clone the repository
git clone https://github.com/galactica-corp/zkcertificates-queue-processor.git
cd zkcertificates-queue-processor
# Install dependencies
go mod download
# Build the binary
go build -o queue-processor .To run without processing transactions:
go run main.goTo run with transaction processing enabled:
export PRIVATE_KEY=0xYOUR_PRIVATE_KEY_HERE
go run main.go./queue-processor- Guardians add certificates to the queue using
addOperationToQueue() - Queue Processor monitors the queue and for each pending operation:
- For issuance: Gets an empty leaf proof from the merkle service
- For revocation: Gets the existing leaf proof from the merkle service
- Calls
processNextOperation()with the merkle proof - The contract updates the merkle tree and advances the queue pointer
zkcertificates-queue-processor/
├── main.go # Application entry point
├── config/ # Configuration files
│ ├── cassiopeia.yaml # Testnet registry configuration
│ ├── mainnet.yaml # Mainnet registry configuration
│ ├── nixpacks-cassiopeia.toml # Testnet deployment config
│ └── nixpacks-mainnet.toml # Mainnet deployment config
├── service/ # Service management framework
├── evm/ # Ethereum event monitoring
├── queueprocessor/ # Queue processing logic
├── server/ # HTTP server
└── zkregistry/ # Smart contract bindings
To regenerate contract bindings:
abigen --abi zkregistry/abi.json --pkg zkregistry --type ZkCertificateRegistry --out zkregistry/zkcertificate_registry.goThe service includes network-specific Nixpacks configurations for deployment:
nixpacks build . --config config/nixpacks-cassiopeia.tomlnixpacks build . --config config/nixpacks-mainnet.tomlEach configuration:
- Sets the appropriate
CONFIG_FILEenvironment variable - Configures the network-specific RPC endpoint
- Builds and starts the queue processor
The service provides health check endpoints:
GET /health- Basic health checkGET /metrics- Service metrics (if enabled)
Logs are output in structured JSON format for easy parsing and monitoring.