Sequentia Network node for decentralized genomic processing with x402 payments for Genomics Agentic Services and blockchain synchronization
npm install @genobank/biofs-nodebash
npm install -g @genobank/biofs-node
`
š Quick Start
$3
`bash
For master node
biofs-node init --type master --config master-node.yaml
For lab node
biofs-node init --type lab --config lab-node.yaml
`
$3
Edit the generated YAML file with your settings:
`yaml
node:
type: lab
id: augenomics
name: "AUGenomics Genomics Lab"
wallet: "0x..."
url: "https://biofs.augenomics.org"
api:
port: 8080
host: 0.0.0.0
storage:
bucket: "augenomics-genomics"
region: "us-east-1"
master:
url: "https://biofs-master.genobank.io"
registration_token: "biofs_..."
`
$3
`bash
biofs-node register \
--name "AUGenomics" \
--wallet 0xYourLabWallet \
--bucket s3://augenomics-genomics \
--master https://biofs-master.genobank.io \
--email admin@augenomics.org
`
Save the registration token and add it to your config file.
$3
`bash
biofs-node start --config biofs-node.yaml
`
$3
`bash
biofs-node status --config biofs-node.yaml
`
šļø Architecture
`
Master Node (GenoBank.io)
āāā Orchestrates multiple lab nodes
āāā Health monitoring (30s intervals)
āāā Automatic failover activation
āāā Data replication management
āāā API key/gas sponsorship fallback
Lab Node (Institutions)
āāā Serves S3 bucket via API
āāā Sends heartbeat to master
āāā Optional sponsored services
āāā BioNFT-gated file access
`
š” API Endpoints
$3
- GET /health - Basic health check
- GET /status - Detailed node status
- GET /ready - Kubernetes readiness probe
- GET /live - Kubernetes liveness probe
$3
- GET /api/v1/nodes - List all nodes
- GET /api/v1/nodes/:node_id - Get node details
- GET /api/v1/nodes/:node_id/health - Get node health
$3
- POST /api/v1/labs/register - Register new lab
- POST /api/v1/labs/:lab_id/heartbeat - Lab heartbeat
- GET /api/v1/labs/:lab_id/status - Lab status
š§ Configuration
$3
`yaml
node:
type: master
id: genobank-master
name: "GenoBank.io Master Node"
wallet: "0x5f5a60EaEf242c0D51A21c703f520347b96Ed19a"
url: "https://biofs-master.genobank.io"
api:
port: 8080
host: 0.0.0.0
cors_origins:
- "https://genobank.io"
rate_limit:
requests_per_minute: 1000
database:
type: postgresql
url: "postgresql://user:pass@localhost:5432/biofs"
monitoring:
prometheus_enabled: true
port: 9090
services:
anthropic_key: "sk-ant-..." # Master fallback key
story_executor_key: "0x..." # Master fallback executor
`
$3
`yaml
node:
type: lab
id: augenomics
name: "AUGenomics Genomics Lab"
wallet: "0x..."
url: "https://biofs.augenomics.org"
storage:
bucket: "augenomics-genomics"
region: "us-east-1"
master:
url: "https://biofs-master.genobank.io"
registration_token: "biofs_abc123..."
services:
anthropic_key: "sk-ant-..." # Optional: Lab-sponsored
story_executor_key: "0x..." # Optional: Lab-sponsored
`
š Monitoring
$3
Metrics are available at http://localhost:9090/metrics:
- biofs_http_requests_total - Total HTTP requests
- biofs_http_request_duration_seconds - Request latency
- biofs_lab_status - Lab online/offline status
- biofs_replication_lag_hours - Replication lag
$3
`bash
Check if node is healthy
curl http://localhost:8080/health
Get detailed status
curl http://localhost:8080/status
List all nodes (master only)
curl http://localhost:8080/api/v1/nodes
`
š ļø Development
$3
`bash
git clone https://github.com/Genobank/biofs-node.git
cd biofs-node
npm install
npm run build
`
$3
`bash
npm run dev -- start --config dev-config.yaml
`
$3
`bash
npm test
`
š³ Docker Deployment
`bash
docker build -t biofs-node .
docker run -d \
-v /path/to/config.yaml:/etc/biofs/config.yaml \
-p 8080:8080 \
-p 9090:9090 \
biofs-node start --config /etc/biofs/config.yaml
`
š Security
$3
ā ļø NEVER commit secrets to version control!
1. Use Environment Variables for Secrets
`bash
# Create .env file (already in .gitignore)
cp .env.example .env
# Edit .env with your actual values
nano .env
`
2. Environment Variables
`bash
# .env file
ANTHROPIC_API_KEY=sk-ant-api03-...your_key...
AWS_ACCESS_KEY_ID=AKIAA...
AWS_SECRET_ACCESS_KEY=...secret...
STORY_EXECUTOR_KEY=0x...private_key...
DATABASE_URL=postgresql://user:password@localhost/biofs
`
3. Configuration Files
- ā
DO: Use ${VARIABLE_NAME} placeholders in YAML
- ā
DO: Load secrets from environment variables
- ā DON'T: Hardcode API keys in config files
- ā DON'T: Commit production.yaml with secrets
`yaml
# Good - Reference environment variable
services:
anthropic_key: "${ANTHROPIC_API_KEY}"
# Bad - Hardcoded secret (NEVER DO THIS!)
services:
anthropic_key: "sk-ant-api03-RnJYcT28..."
`
4. Code automatically falls back to environment variables:
`typescript
// Priority order:
// 1. Config file value
// 2. Environment variable (process.env.ANTHROPIC_API_KEY)
// 3. null (service disabled)
``