Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
155 changes: 101 additions & 54 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ Sekin orchestrates multiple microservices in a containerized environment:
│ Sekin Infrastructure │
├─────────────────────────────────────────────────────────────┤
│ │
│ ┌──────────┐ ┌──────────┐ ┌───────────────────────┐ │
│ │ Sekai Shidai Interx Manager │ │
│ │ (Cosmos) │ │ (Infra) │ │ (P2P/HTTP Server) │ │
│ └─────────┘ └─────────┘ └───────────┬───────────┘ │
│ ┌──────────────────────────────────────┴───────────┐ │
│ │ Centralized Logging (Syslog-ng)
│ └────────────────────────────────────────────────────┘
│ ┌────────────────────┐ ┌───────────────────────┐
│ │ Sekai + Scaller │ │ Interx Manager │
│ │ (Cosmos + CLI) │ │ (P2P/HTTP Server) │
│ └──────────────────┘ └───────────┬───────────┘
│ ┌───────────────────────────────────┴───────────┐
│ │ Centralized Logging (Syslog-ng)
│ └────────────────────────────────────────────────
│ │
│ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐ │
│ │ Storage │ │ Proxy │ │ MongoDB │ │
Expand All @@ -40,18 +40,13 @@ Sekin orchestrates multiple microservices in a containerized environment:

### Core Services

**Sekai (v0.4.13)**
**Sekai with Scaller**
- KIRA blockchain node built on Cosmos SDK
- Provides consensus, state management, and transaction processing
- Includes scaller CLI for node bootstrapping, management, and monitoring
- Ports: 26657 (RPC), 26656 (P2P), 9090 (gRPC), 1317 (REST API)
- Built from `sekai.Dockerfile` (contains sekaid + scaller)

**Shidai (v0.15.2)**
- Infrastructure management and orchestration service
- Monitors blockchain status and manages container lifecycle
- Provides API endpoint on port 8282
- Built from source in `src/shidai/`

**Syslog-ng (v0.15.2)**
**Syslog-ng**
- Centralized logging server for all services
- Collects logs via UDP/TCP on port 514
- Configured with log rotation and retention policies
Expand Down Expand Up @@ -107,7 +102,6 @@ All services run on a custom bridge network `kiranet` (10.1.0.0/16):
| Syslog-ng | 10.1.0.2 | syslog-ng.local |
| Sekai | 10.1.0.3 | sekai.local |
| Manager | 10.1.0.4 | manager.local |
| Shidai | 10.1.0.5 | shidai.local |
| Proxy | 10.1.0.10 | proxy.local |
| Storage | 10.1.0.11 | storage.local |
| Cosmos Indexer | 10.1.0.12 | cosmos-indexer.local |
Expand Down Expand Up @@ -191,34 +185,18 @@ docker compose logs -f sekai
tail -f ./syslog-data/sekai.log
```

## Building Images Independently

Apart from using Docker Compose, you can build Sekai and Interx independently.
## Building Images

### Build Sekai
Build the sekai image (includes sekaid + scaller):

```bash
./scripts/docker-sekaid-build.sh v0.4.13
docker build -f sekai.Dockerfile -t sekai:latest .
```

### Build Interx
Build the syslog-ng image:

```bash
./scripts/docker-interxd-build.sh v0.7.0
```

### Run Containers

**Run Sekai:**

```bash
./scripts/docker-sekaid-run.sh v0.4.13
```

**Run Interx:**

```bash
./scripts/docker-interxd-run.sh v0.7.0
docker build -f syslog-ng.Dockerfile -t syslog-ng:latest .
```

## Port Mappings
Expand All @@ -243,11 +221,9 @@ Apart from using Docker Compose, you can build Sekai and Interx independently.
|-------|------------|-----------------------------|
| 26658 | Sekai | ABCI |
| 26660 | Sekai | Prometheus Metrics |
| 8181 | Sekai | RPC sCaller |
| 1317 | Sekai | REST API |
| 9090 | Sekai | gRPC |
| 8080 | Manager | HTTP Server |
| 8282 | Shidai | Infrastructure Manager API |
| 514 | Syslog-ng | Syslog Server (UDP/TCP) |

## Configuration
Expand All @@ -274,7 +250,7 @@ Sekin uses GitHub Actions for automated image building, signing, and deployment:
**`ci.yml` - Build and Release**
- Triggers on PR merge to `main` branch
- Creates semantic version tags
- Builds and pushes Shidai and Syslog-ng images to GHCR
- Builds and pushes Sekai and Syslog-ng images to GHCR
- Signs images with Cosign (Sigstore)
- Updates `compose.yml` with new versions

Expand All @@ -294,19 +270,92 @@ Sekin uses GitHub Actions for automated image building, signing, and deployment:
All images are signed using Cosign for supply chain security. Verify signatures:

```bash
cosign verify --key cosign.pub ghcr.io/kiracore/sekin/shidai:v0.15.2
cosign verify --key cosign.pub ghcr.io/kiracore/sekin/sekai:latest
```

## Scaller CLI

Scaller is a Go CLI tool bundled in the sekai container for node bootstrapping, management, and monitoring.

### Commands

| Command | Description |
|---------|-------------|
| `wait` | Wait indefinitely (container entrypoint) |
| `init` | Initialize new sekaid node |
| `keys-add` | Add key to keyring |
| `add-genesis-account` | Add account to genesis |
| `gentx-claim` | Claim validator role in genesis |
| `join` | Initialize node and join existing network |
| `start` | Start sekaid (with optional restart) |
| `status` | Show node and network status |
| `version` | Show scaller version |

### Usage Examples

```bash
# Initialize a new node
docker exec sekin-sekai-1 /scaller init --chain-id testnet-1 --moniker MyNode

# Join an existing network
docker exec sekin-sekai-1 /scaller join \
--chain-id kira-1 \
--rpc "https://rpc.kira.network:26657" \
--moniker MyNode

# Start sekaid (replaces process)
docker exec sekin-sekai-1 /scaller start

# Start with auto-restart (up to 5 retries)
docker exec sekin-sekai-1 /scaller start --restart 5

# Start with auto-restart (max 10 retries)
docker exec sekin-sekai-1 /scaller start --restart always

# Check node status (defaults: rpc=localhost:26657, interx=proxy.local:8080)
docker exec sekin-sekai-1 /scaller status
```

### Status Output

The `status` command displays a table showing:

| Field | Description |
|-------|-------------|
| Sekai | Node health (OK/SYNCING/DOWN) and block height |
| Interx | Interx service health |
| Peers | Number of connected peers |
| Node ID | Unique node identifier (for peer connections) |
| Chain | Network chain ID |
| Moniker | Node's moniker name |
| Validator | Validator status and voting power |

Example output:
```
SERVICE STATUS DETAIL
---------- ------- ------------------------------
Sekai [+] OK height 12345
Interx [+] OK responding
Peers [+] OK 5 connected
Node ID [ ] INFO a1b2c3d4e5f6...
Chain [ ] INFO kira-1
Moniker [ ] INFO MyNode
Validator [+] OK power 100
```

## Monitoring and Maintenance

### View Service Status

```bash
# Check Shidai status
curl http://localhost:8282/status

# Check blockchain status via RPC
curl http://localhost:26657/status

# Check node status with scaller
docker exec sekin-sekai-1 /scaller status

# Check scaller version
docker exec sekin-sekai-1 /scaller version
```

### Access Logs
Expand Down Expand Up @@ -348,11 +397,7 @@ docker compose up -d
```
sekin/
├── src/
│ ├── shidai/ # Infrastructure manager
│ ├── sCaller/ # Sekai command executor
│ ├── iCaller/ # Interx command executor
│ ├── exporter/ # Metrics exporter
│ └── updater/ # Upgrade manager
│ └── sCaller/ # Scaller CLI (node bootstrap & management)
├── manager/ # Interx Manager (P2P/HTTP)
├── proxy/ # Interx Proxy
├── worker/ # Interx Worker services
Expand All @@ -361,6 +406,8 @@ sekin/
│ └── sai-storage-mongo/ # Storage service
├── scripts/ # Utility scripts
├── config/ # Configuration files
├── sekai.Dockerfile # Sekai + Scaller image
├── syslog-ng.Dockerfile # Syslog-ng image
└── compose.yml # Production compose file
```

Expand All @@ -369,8 +416,8 @@ sekin/
Each component can be built independently using its respective Dockerfile:

```bash
# Build Shidai
docker build -f shidai.Dockerfile -t sekin/shidai:custom .
# Build Sekai (includes scaller CLI)
docker build -f sekai.Dockerfile -t sekin/sekai:custom .

# Build Syslog-ng
docker build -f syslog-ng.Dockerfile -t sekin/syslog-ng:custom .
Expand Down Expand Up @@ -400,7 +447,7 @@ docker network inspect kiranet
Check for existing processes using required ports:

```bash
sudo netstat -tulpn | grep -E '26657|26656|8080|8282'
sudo netstat -tulpn | grep -E '26657|26656|8080'
```

### Disk Space
Expand Down
4 changes: 3 additions & 1 deletion src/sCaller/internal/cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ Commands:
add-genesis-account - Add account to genesis
gentx-claim - Claim validator role in genesis
join - Initialize node and join existing network
start - Start sekaid (replaces this process)`,
start - Start sekaid (with optional restart)
status - Show node and network status`,
}

func Execute() error {
Expand All @@ -34,6 +35,7 @@ func init() {
rootCmd.AddCommand(gentxClaimCmd)
rootCmd.AddCommand(joinCmd)
rootCmd.AddCommand(startCmd)
rootCmd.AddCommand(statusCmd)
rootCmd.AddCommand(versionCmd)
}

Expand Down
Loading