Merge pull request #12 from secretflow/chore/doc-update Chore: doc update
Merge pull request #12 from secretflow/chore/doc-update
Chore: doc update
A blockchain-based log attestation system providing transparent, immutable, and multi-dimensional verifiable log storage.
The system follows a layered microservices architecture:
┌─────────────────────────────────────────────────────────────────┐ │ External Clients │ └───────────────┬─────────────────────────────┬───────────────────┘ │ │ ▼ ▼ ┌───────────────────────┐ ┌───────────────────────────────────┐ │ Nginx API Gateway │ │ Benthos Adapters │ │ (mTLS, API Key) │ │ (Syslog, Kafka, S3) │ └───────────┬───────────┘ └───────────────┬───────────────────┘ │ │ ▼ ▼ ┌─────────────────────────────────────────────────────────────────┐ │ Log Ingestion Service │ │ (HTTP/gRPC, SHA256, Kafka) │ └───────────────────────────────┬─────────────────────────────────┘ │ ▼ ┌─────────────────────────────────────────────────────────────────┐ │ Blockchain Engine Service │ │ (Kafka Consumer, ChainMaker) │ └───────────────────────────────┬─────────────────────────────────┘ │ ┌───────────────────┴───────────────────┐ ▼ ▼ ┌───────────────────────┐ ┌─────────────────────────┐ │ PostgreSQL │ │ ChainMaker │ │ (Task Status) │ │ (On-Chain Storage) │ └───────────────────────┘ └─────────────────────────┘
For detailed architecture, see docs/design.md.
# 1. Configure environment cp .env.example .env # Edit .env with your ChainMaker path and node addresses # 2. Generate ChainMaker client config bash scripts/generate-chainmaker-config.sh # 3. Setup Nginx authentication cd ingress bash scripts/generate-ssl-certs.sh # Server certs + CA bash scripts/setup-config.sh # API keys + IP whitelist bash scripts/generate-client-cert.sh member-001 "Member One" # Client cert for mTLS (optional) cd .. # 4. Start all services docker compose up -d
# Check service health curl http://localhost/health # Test log submission via API Gateway (HTTPS) curl -k -X POST https://localhost/v1/logs \ -H "X-API-Key: example-api-key-12345" \ -H "Content-Type: application/json" \ -d '{"log_content": "test log message"}' # Test log submission via Benthos Syslog adapter (UDP) echo "<14>1 $(date -u +%Y-%m-%dT%H:%M:%SZ) localhost test - - - Test syslog message" | nc -u localhost 5514
├── cmd/ # Service entry points │ ├── ingestion/ # Log Ingestion Service │ ├── engine/ # Blockchain Processing Service │ └── query/ # Query Service ├── ingestion/ # Ingestion layer (service + Benthos adapters) ├── ingress/ # API Gateway (Nginx + OpenResty) ├── processing/ # Batch processing worker ├── query/ # Query service implementation ├── blockchain/ # Blockchain client abstraction ├── storage/ # Database store interface ├── config/ # Configuration files ├── scripts/ # Utility and test scripts └── docs/ # Design documents
POST /v1/logs
GET /v1/query/status/{request_id}
POST /v1/query_by_content
GET /v1/audit/log/{log_hash}
.env
config/*.defaults.yml
ingress/nginx/conf.d/api-keys.json
ingress/nginx/conf.d/consortium-ip-whitelist.json
For configuration details, see config/README.md.
# Test API endpoints bash scripts/test-ingestion-query-api.sh # Test consortium audit API (requires mTLS cert) bash scripts/test-consortium-audit-api.sh <log_hash>
See LICENSE and LEGAL.md.
版权所有:中国计算机学会技术支持:开源发展技术委员会 京ICP备13000930号-9 京公网安备 11010802032778号
Trusted Log Attestation System
A blockchain-based log attestation system providing transparent, immutable, and multi-dimensional verifiable log storage.
Architecture
The system follows a layered microservices architecture:
For detailed architecture, see docs/design.md.
Quick Start
Prerequisites
Setup
Verify
Directory Structure
Services
API Endpoints
Log Submission (API Key Authentication)
POST /v1/logs- Submit log for attestationQuery (API Key Authentication)
GET /v1/query/status/{request_id}- Query attestation statusPOST /v1/query_by_content- Query by log contentAudit (mTLS + IP Whitelist)
GET /v1/audit/log/{log_hash}- On-chain audit for consortium membersConfiguration
.envconfig/*.defaults.ymlingress/nginx/conf.d/api-keys.jsoningress/nginx/conf.d/consortium-ip-whitelist.jsonFor configuration details, see config/README.md.
Testing
Documentation
License
See LICENSE and LEGAL.md.