Compare commits
1 Commits
main
...
blast-stac
| Author | SHA1 | Date | |
|---|---|---|---|
| a77f120d0d |
@ -1,20 +1,23 @@
|
||||
name: External Stack Test
|
||||
name: Fixturenet-Eth-Plugeth-Arm-Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.gitea/workflows/triggers/test-external-stack'
|
||||
- '.gitea/workflows/test-external-stack.yml'
|
||||
- 'tests/external-stack/run-test.sh'
|
||||
- '.gitea/workflows/triggers/fixturenet-eth-plugeth-arm-test'
|
||||
schedule: # Note: coordinate with other tests to not overload runners at the same time of day
|
||||
- cron: '8 19 * * *'
|
||||
- cron: '2 14 * * *'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
DOCKER_HOST: unix:///var/run/dind.sock
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Run external stack test suite"
|
||||
runs-on: ubuntu-latest
|
||||
name: "Run an Ethereum plugeth fixturenet test"
|
||||
runs-on: ubuntu-latest-arm
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
@ -33,13 +36,13 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
run: ./scripts/build_shiv_package.sh
|
||||
- name: "Run external stack tests"
|
||||
run: ./tests/external-stack/run-test.sh
|
||||
- name: "Run fixturenet-eth tests"
|
||||
run: ./tests/fixturenet-eth-plugeth/run-test.sh
|
||||
- name: Notify Vulcanize Slack on CI failure
|
||||
if: ${{ always() && github.ref_name == 'main' }}
|
||||
uses: ravsamhq/notify-slack-action@v2
|
||||
@ -1,22 +1,23 @@
|
||||
name: K8s Deployment Control Test
|
||||
name: Fixturenet-Eth-Plugeth-Test
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
branches: '*'
|
||||
push:
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.gitea/workflows/triggers/test-k8s-deployment-control'
|
||||
- '.gitea/workflows/test-k8s-deployment-control.yml'
|
||||
- 'tests/k8s-deployment-control/run-test.sh'
|
||||
- '.gitea/workflows/triggers/fixturenet-eth-plugeth-test'
|
||||
schedule: # Note: coordinate with other tests to not overload runners at the same time of day
|
||||
- cron: '3 30 * * *'
|
||||
- cron: '2 14 * * *'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
DOCKER_HOST: unix:///var/run/dind.sock
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Run deployment control suite on kind/k8s"
|
||||
runs-on: ubuntu-22.04
|
||||
name: "Run an Ethereum plugeth fixturenet test"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
@ -35,22 +36,17 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
run: ./scripts/build_shiv_package.sh
|
||||
- name: "Check cgroups version"
|
||||
run: mount | grep cgroup
|
||||
- name: "Install kind"
|
||||
run: ./tests/scripts/install-kind.sh
|
||||
- name: "Install Kubectl"
|
||||
run: ./tests/scripts/install-kubectl.sh
|
||||
- name: "Run k8s deployment control test"
|
||||
- name: Start dockerd # Also needed until we can incorporate into the executor
|
||||
run: |
|
||||
source /opt/bash-utils/cgroup-helper.sh
|
||||
join_cgroup
|
||||
./tests/k8s-deployment-control/run-test.sh
|
||||
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
||||
sleep 5
|
||||
- name: "Run fixturenet-eth tests"
|
||||
run: ./tests/fixturenet-eth-plugeth/run-test.sh
|
||||
- name: Notify Vulcanize Slack on CI failure
|
||||
if: ${{ always() && github.ref_name == 'main' }}
|
||||
uses: ravsamhq/notify-slack-action@v2
|
||||
63
.gitea/workflows/fixturenet-eth-test.yml
Normal file
63
.gitea/workflows/fixturenet-eth-test.yml
Normal file
@ -0,0 +1,63 @@
|
||||
name: Fixturenet-Eth-Test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: '*'
|
||||
paths:
|
||||
- '!**'
|
||||
- '.gitea/workflows/triggers/fixturenet-eth-test'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
DOCKER_HOST: unix:///var/run/dind.sock
|
||||
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Run an Ethereum fixturenet test"
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: "Clone project repository"
|
||||
uses: actions/checkout@v3
|
||||
# At present the stock setup-python action fails on Linux/aarch64
|
||||
# Conditional steps below workaroud this by using deadsnakes for that case only
|
||||
- name: "Install Python for ARM on Linux"
|
||||
if: ${{ runner.arch == 'arm64' && runner.os == 'Linux' }}
|
||||
uses: deadsnakes/action@v3.0.1
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- name: "Install Python cases other than ARM on Linux"
|
||||
if: ${{ ! (runner.arch == 'arm64' && runner.os == 'Linux') }}
|
||||
uses: actions/setup-python@v4
|
||||
with:
|
||||
python-version: '3.8'
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
run: ./scripts/build_shiv_package.sh
|
||||
- name: Start dockerd # Also needed until we can incorporate into the executor
|
||||
run: |
|
||||
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
||||
sleep 5
|
||||
- name: "Run fixturenet-eth tests"
|
||||
run: ./tests/fixturenet-eth/run-test.sh
|
||||
- name: Notify Vulcanize Slack on CI failure
|
||||
if: ${{ always() && github.ref_name == 'main' }}
|
||||
uses: ravsamhq/notify-slack-action@v2
|
||||
with:
|
||||
status: ${{ job.status }}
|
||||
notify_when: 'failure'
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.VULCANIZE_SLACK_CI_ALERTS }}
|
||||
- name: Notify DeepStack Slack on CI failure
|
||||
if: ${{ always() && github.ref_name == 'main' }}
|
||||
uses: ravsamhq/notify-slack-action@v2
|
||||
with:
|
||||
status: ${{ job.status }}
|
||||
notify_when: 'failure'
|
||||
env:
|
||||
SLACK_WEBHOOK_URL: ${{ secrets.DEEPSTACK_SLACK_CI_ALERTS }}
|
||||
@ -39,7 +39,7 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
|
||||
@ -35,7 +35,7 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Build local shiv package"
|
||||
id: build
|
||||
run: |
|
||||
|
||||
@ -33,7 +33,7 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
|
||||
@ -33,7 +33,7 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
|
||||
@ -10,6 +10,9 @@ on:
|
||||
paths-ignore:
|
||||
- '.gitea/workflows/triggers/*'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
DOCKER_HOST: unix:///var/run/dind.sock
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@ -33,11 +36,15 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
run: ./scripts/build_shiv_package.sh
|
||||
- name: Start dockerd # Also needed until we can incorporate into the executor
|
||||
run: |
|
||||
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
||||
sleep 5
|
||||
- name: "Run deploy tests"
|
||||
run: ./tests/deploy/run-deploy-test.sh
|
||||
- name: Notify Vulcanize Slack on CI failure
|
||||
|
||||
@ -35,7 +35,7 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
|
||||
@ -10,6 +10,10 @@ on:
|
||||
paths-ignore:
|
||||
- '.gitea/workflows/triggers/*'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
DOCKER_HOST: unix:///var/run/dind.sock
|
||||
|
||||
jobs:
|
||||
test:
|
||||
name: "Run webapp test suite"
|
||||
@ -32,13 +36,17 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
run: ./scripts/build_shiv_package.sh
|
||||
- name: "Install wget" # 20240109 - Only needed until the executors are updated.
|
||||
run: apt update && apt install -y wget
|
||||
- name: Start dockerd # Also needed until we can incorporate into the executor
|
||||
run: |
|
||||
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
||||
sleep 5
|
||||
- name: "Run webapp tests"
|
||||
run: ./tests/webapp-test/run-webapp-test.sh
|
||||
- name: Notify Vulcanize Slack on CI failure
|
||||
|
||||
@ -10,6 +10,9 @@ on:
|
||||
paths-ignore:
|
||||
- '.gitea/workflows/triggers/*'
|
||||
|
||||
# Needed until we can incorporate docker startup into the executor container
|
||||
env:
|
||||
DOCKER_HOST: unix:///var/run/dind.sock
|
||||
|
||||
jobs:
|
||||
test:
|
||||
@ -33,11 +36,15 @@ jobs:
|
||||
- name: "Print Python version"
|
||||
run: python3 --version
|
||||
- name: "Install shiv"
|
||||
run: pip install shiv==1.0.6
|
||||
run: pip install shiv
|
||||
- name: "Generate build version file"
|
||||
run: ./scripts/create_build_tag_file.sh
|
||||
- name: "Build local shiv package"
|
||||
run: ./scripts/build_shiv_package.sh
|
||||
- name: Start dockerd # Also needed until we can incorporate into the executor
|
||||
run: |
|
||||
dockerd -H $DOCKER_HOST --userland-proxy=false &
|
||||
sleep 5
|
||||
- name: "Run smoke tests"
|
||||
run: ./tests/smoke-test/run-smoke-test.sh
|
||||
- name: Notify Vulcanize Slack on CI failure
|
||||
|
||||
@ -0,0 +1,2 @@
|
||||
Change this file to trigger running the fixturenet-eth-plugeth-arm-test CI job
|
||||
|
||||
3
.gitea/workflows/triggers/fixturenet-eth-plugeth-test
Normal file
3
.gitea/workflows/triggers/fixturenet-eth-plugeth-test
Normal file
@ -0,0 +1,3 @@
|
||||
Change this file to trigger running the fixturenet-eth-plugeth-test CI job
|
||||
trigger
|
||||
trigger
|
||||
2
.gitea/workflows/triggers/fixturenet-eth-test
Normal file
2
.gitea/workflows/triggers/fixturenet-eth-test
Normal file
@ -0,0 +1,2 @@
|
||||
Change this file to trigger running the fixturenet-eth-test CI job
|
||||
|
||||
@ -4,7 +4,3 @@ Trigger
|
||||
Trigger
|
||||
Trigger
|
||||
Trigger
|
||||
Trigger
|
||||
Trigger
|
||||
Trigger
|
||||
Trigger
|
||||
|
||||
@ -1,2 +0,0 @@
|
||||
Change this file to trigger running the external-stack CI job
|
||||
trigger
|
||||
@ -1,151 +0,0 @@
|
||||
# Plan: Make Stack-Orchestrator AI-Friendly
|
||||
|
||||
## Goal
|
||||
|
||||
Make the stack-orchestrator repository easier for AI tools (Claude Code, Cursor, Copilot) to understand and use for generating stacks, including adding a `create-stack` command.
|
||||
|
||||
---
|
||||
|
||||
## Part 1: Documentation & Context Files
|
||||
|
||||
### 1.1 Add CLAUDE.md
|
||||
|
||||
Create a root-level context file for AI assistants.
|
||||
|
||||
**File:** `CLAUDE.md`
|
||||
|
||||
Contents:
|
||||
- Project overview (what stack-orchestrator does)
|
||||
- Stack creation workflow (step-by-step)
|
||||
- File naming conventions
|
||||
- Required vs optional fields in stack.yml
|
||||
- Common patterns and anti-patterns
|
||||
- Links to example stacks (simple, medium, complex)
|
||||
|
||||
### 1.2 Add JSON Schema for stack.yml
|
||||
|
||||
Create formal validation schema.
|
||||
|
||||
**File:** `schemas/stack-schema.json`
|
||||
|
||||
Benefits:
|
||||
- AI tools can validate generated stacks
|
||||
- IDEs provide autocomplete
|
||||
- CI can catch errors early
|
||||
|
||||
### 1.3 Add Template Stack with Comments
|
||||
|
||||
Create an annotated template for reference.
|
||||
|
||||
**File:** `stack_orchestrator/data/stacks/_template/stack.yml`
|
||||
|
||||
```yaml
|
||||
# Stack definition template - copy this directory to create a new stack
|
||||
version: "1.2" # Required: 1.0, 1.1, or 1.2
|
||||
name: my-stack # Required: lowercase, hyphens only
|
||||
description: "Human-readable description" # Optional
|
||||
repos: # Git repositories to clone
|
||||
- github.com/org/repo
|
||||
containers: # Container images to build (must have matching container-build/)
|
||||
- cerc/my-container
|
||||
pods: # Deployment units (must have matching docker-compose-{pod}.yml)
|
||||
- my-pod
|
||||
```
|
||||
|
||||
### 1.4 Document Validation Rules
|
||||
|
||||
Create explicit documentation of constraints currently scattered in code.
|
||||
|
||||
**File:** `docs/stack-format.md`
|
||||
|
||||
Contents:
|
||||
- Container names must start with `cerc/`
|
||||
- Pod names must match compose file: `docker-compose-{pod}.yml`
|
||||
- Repository format: `host/org/repo[@ref]`
|
||||
- Stack directory name should match `name` field
|
||||
- Version field options and differences
|
||||
|
||||
---
|
||||
|
||||
## Part 2: Add `create-stack` Command
|
||||
|
||||
### 2.1 Command Overview
|
||||
|
||||
```bash
|
||||
laconic-so create-stack --repo github.com/org/my-app [--name my-app] [--type webapp]
|
||||
```
|
||||
|
||||
**Behavior:**
|
||||
1. Parse repo URL to extract app name (if --name not provided)
|
||||
2. Create `stacks/{name}/stack.yml`
|
||||
3. Create `container-build/cerc-{name}/Dockerfile` and `build.sh`
|
||||
4. Create `compose/docker-compose-{name}.yml`
|
||||
5. Update list files (repository-list.txt, container-image-list.txt, pod-list.txt)
|
||||
|
||||
### 2.2 Files to Create
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `stack_orchestrator/create/__init__.py` | Package init |
|
||||
| `stack_orchestrator/create/create_stack.py` | Command implementation |
|
||||
|
||||
### 2.3 Files to Modify
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `stack_orchestrator/main.py` | Add import and `cli.add_command()` |
|
||||
|
||||
### 2.4 Command Options
|
||||
|
||||
| Option | Required | Description |
|
||||
|--------|----------|-------------|
|
||||
| `--repo` | Yes | Git repository URL (e.g., github.com/org/repo) |
|
||||
| `--name` | No | Stack name (defaults to repo name) |
|
||||
| `--type` | No | Template type: webapp, service, empty (default: webapp) |
|
||||
| `--force` | No | Overwrite existing files |
|
||||
|
||||
### 2.5 Template Types
|
||||
|
||||
| Type | Base Image | Port | Use Case |
|
||||
|------|------------|------|----------|
|
||||
| webapp | node:20-bullseye-slim | 3000 | React/Vue/Next.js apps |
|
||||
| service | python:3.11-slim | 8080 | Python backend services |
|
||||
| empty | none | none | Custom from scratch |
|
||||
|
||||
---
|
||||
|
||||
## Part 3: Implementation Summary
|
||||
|
||||
### New Files (6)
|
||||
|
||||
1. `CLAUDE.md` - AI assistant context
|
||||
2. `schemas/stack-schema.json` - Validation schema
|
||||
3. `stack_orchestrator/data/stacks/_template/stack.yml` - Annotated template
|
||||
4. `docs/stack-format.md` - Stack format documentation
|
||||
5. `stack_orchestrator/create/__init__.py` - Package init
|
||||
6. `stack_orchestrator/create/create_stack.py` - Command implementation
|
||||
|
||||
### Modified Files (1)
|
||||
|
||||
1. `stack_orchestrator/main.py` - Register create-stack command
|
||||
|
||||
---
|
||||
|
||||
## Verification
|
||||
|
||||
```bash
|
||||
# 1. Command appears in help
|
||||
laconic-so --help | grep create-stack
|
||||
|
||||
# 2. Dry run works
|
||||
laconic-so --dry-run create-stack --repo github.com/org/test-app
|
||||
|
||||
# 3. Creates all expected files
|
||||
laconic-so create-stack --repo github.com/org/test-app
|
||||
ls stack_orchestrator/data/stacks/test-app/
|
||||
ls stack_orchestrator/data/container-build/cerc-test-app/
|
||||
ls stack_orchestrator/data/compose/docker-compose-test-app.yml
|
||||
|
||||
# 4. Build works with generated stack
|
||||
laconic-so --stack test-app build-containers
|
||||
```
|
||||
@ -1,413 +0,0 @@
|
||||
# Implementing `laconic-so create-stack` Command
|
||||
|
||||
A plan for adding a new CLI command to scaffold stack files automatically.
|
||||
|
||||
---
|
||||
|
||||
## Overview
|
||||
|
||||
Add a `create-stack` command that generates all required files for a new stack:
|
||||
|
||||
```bash
|
||||
laconic-so create-stack --name my-stack --type webapp
|
||||
```
|
||||
|
||||
**Output:**
|
||||
```
|
||||
stack_orchestrator/data/
|
||||
├── stacks/my-stack/stack.yml
|
||||
├── container-build/cerc-my-stack/
|
||||
│ ├── Dockerfile
|
||||
│ └── build.sh
|
||||
└── compose/docker-compose-my-stack.yml
|
||||
|
||||
Updated: repository-list.txt, container-image-list.txt, pod-list.txt
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## CLI Architecture Summary
|
||||
|
||||
### Command Registration Pattern
|
||||
|
||||
Commands are Click functions registered in `main.py`:
|
||||
|
||||
```python
|
||||
# main.py (line ~70)
|
||||
from stack_orchestrator.create import create_stack
|
||||
cli.add_command(create_stack.command, "create-stack")
|
||||
```
|
||||
|
||||
### Global Options Access
|
||||
|
||||
```python
|
||||
from stack_orchestrator.opts import opts
|
||||
|
||||
if not opts.o.quiet:
|
||||
print("message")
|
||||
if opts.o.dry_run:
|
||||
print("(would create files)")
|
||||
```
|
||||
|
||||
### Key Utilities
|
||||
|
||||
| Function | Location | Purpose |
|
||||
|----------|----------|---------|
|
||||
| `get_yaml()` | `util.py` | YAML parser (ruamel.yaml) |
|
||||
| `get_stack_path(stack)` | `util.py` | Resolve stack directory path |
|
||||
| `error_exit(msg)` | `util.py` | Print error and exit(1) |
|
||||
|
||||
---
|
||||
|
||||
## Files to Create
|
||||
|
||||
### 1. Command Module
|
||||
|
||||
**`stack_orchestrator/create/__init__.py`**
|
||||
```python
|
||||
# Empty file to make this a package
|
||||
```
|
||||
|
||||
**`stack_orchestrator/create/create_stack.py`**
|
||||
```python
|
||||
import click
|
||||
import os
|
||||
from pathlib import Path
|
||||
from shutil import copy
|
||||
from stack_orchestrator.opts import opts
|
||||
from stack_orchestrator.util import error_exit, get_yaml
|
||||
|
||||
# Template types
|
||||
STACK_TEMPLATES = {
|
||||
"webapp": {
|
||||
"description": "Web application with Node.js",
|
||||
"base_image": "node:20-bullseye-slim",
|
||||
"port": 3000,
|
||||
},
|
||||
"service": {
|
||||
"description": "Backend service",
|
||||
"base_image": "python:3.11-slim",
|
||||
"port": 8080,
|
||||
},
|
||||
"empty": {
|
||||
"description": "Minimal stack with no defaults",
|
||||
"base_image": None,
|
||||
"port": None,
|
||||
},
|
||||
}
|
||||
|
||||
|
||||
def get_data_dir() -> Path:
|
||||
"""Get path to stack_orchestrator/data directory"""
|
||||
return Path(__file__).absolute().parent.parent.joinpath("data")
|
||||
|
||||
|
||||
def validate_stack_name(name: str) -> None:
|
||||
"""Validate stack name follows conventions"""
|
||||
import re
|
||||
if not re.match(r'^[a-z0-9][a-z0-9-]*[a-z0-9]$', name) and len(name) > 2:
|
||||
error_exit(f"Invalid stack name '{name}'. Use lowercase alphanumeric with hyphens.")
|
||||
if name.startswith("cerc-"):
|
||||
error_exit("Stack name should not start with 'cerc-' (container names will add this prefix)")
|
||||
|
||||
|
||||
def create_stack_yml(stack_dir: Path, name: str, template: dict, repo_url: str) -> None:
|
||||
"""Create stack.yml file"""
|
||||
config = {
|
||||
"version": "1.2",
|
||||
"name": name,
|
||||
"description": template.get("description", f"Stack: {name}"),
|
||||
"repos": [repo_url] if repo_url else [],
|
||||
"containers": [f"cerc/{name}"],
|
||||
"pods": [name],
|
||||
}
|
||||
|
||||
stack_dir.mkdir(parents=True, exist_ok=True)
|
||||
with open(stack_dir / "stack.yml", "w") as f:
|
||||
get_yaml().dump(config, f)
|
||||
|
||||
|
||||
def create_dockerfile(container_dir: Path, name: str, template: dict) -> None:
|
||||
"""Create Dockerfile"""
|
||||
base_image = template.get("base_image", "node:20-bullseye-slim")
|
||||
port = template.get("port", 3000)
|
||||
|
||||
dockerfile_content = f'''# Build stage
|
||||
FROM {base_image} AS builder
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
COPY . .
|
||||
RUN npm run build
|
||||
|
||||
# Production stage
|
||||
FROM {base_image}
|
||||
|
||||
WORKDIR /app
|
||||
COPY package*.json ./
|
||||
RUN npm ci --only=production
|
||||
COPY --from=builder /app/dist ./dist
|
||||
|
||||
EXPOSE {port}
|
||||
CMD ["npm", "run", "start"]
|
||||
'''
|
||||
|
||||
container_dir.mkdir(parents=True, exist_ok=True)
|
||||
with open(container_dir / "Dockerfile", "w") as f:
|
||||
f.write(dockerfile_content)
|
||||
|
||||
|
||||
def create_build_script(container_dir: Path, name: str) -> None:
|
||||
"""Create build.sh script"""
|
||||
build_script = f'''#!/usr/bin/env bash
|
||||
# Build cerc/{name}
|
||||
|
||||
source ${{CERC_CONTAINER_BASE_DIR}}/build-base.sh
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${{BASH_SOURCE[0]}}" )" &> /dev/null && pwd )
|
||||
|
||||
docker build -t cerc/{name}:local \\
|
||||
-f ${{SCRIPT_DIR}}/Dockerfile \\
|
||||
${{build_command_args}} \\
|
||||
${{CERC_REPO_BASE_DIR}}/{name}
|
||||
'''
|
||||
|
||||
build_path = container_dir / "build.sh"
|
||||
with open(build_path, "w") as f:
|
||||
f.write(build_script)
|
||||
|
||||
# Make executable
|
||||
os.chmod(build_path, 0o755)
|
||||
|
||||
|
||||
def create_compose_file(compose_dir: Path, name: str, template: dict) -> None:
|
||||
"""Create docker-compose file"""
|
||||
port = template.get("port", 3000)
|
||||
|
||||
compose_content = {
|
||||
"version": "3.8",
|
||||
"services": {
|
||||
name: {
|
||||
"image": f"cerc/{name}:local",
|
||||
"restart": "unless-stopped",
|
||||
"ports": [f"${{HOST_PORT:-{port}}}:{port}"],
|
||||
"environment": {
|
||||
"NODE_ENV": "${NODE_ENV:-production}",
|
||||
},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
with open(compose_dir / f"docker-compose-{name}.yml", "w") as f:
|
||||
get_yaml().dump(compose_content, f)
|
||||
|
||||
|
||||
def update_list_file(data_dir: Path, filename: str, entry: str) -> None:
|
||||
"""Add entry to a list file if not already present"""
|
||||
list_path = data_dir / filename
|
||||
|
||||
# Read existing entries
|
||||
existing = set()
|
||||
if list_path.exists():
|
||||
with open(list_path, "r") as f:
|
||||
existing = set(line.strip() for line in f if line.strip())
|
||||
|
||||
# Add new entry
|
||||
if entry not in existing:
|
||||
with open(list_path, "a") as f:
|
||||
f.write(f"{entry}\n")
|
||||
|
||||
|
||||
@click.command()
|
||||
@click.option("--name", required=True, help="Name of the new stack (lowercase, hyphens)")
|
||||
@click.option("--type", "stack_type", default="webapp",
|
||||
type=click.Choice(list(STACK_TEMPLATES.keys())),
|
||||
help="Stack template type")
|
||||
@click.option("--repo", help="Git repository URL (e.g., github.com/org/repo)")
|
||||
@click.option("--force", is_flag=True, help="Overwrite existing files")
|
||||
@click.pass_context
|
||||
def command(ctx, name: str, stack_type: str, repo: str, force: bool):
|
||||
"""Create a new stack with all required files.
|
||||
|
||||
Examples:
|
||||
|
||||
laconic-so create-stack --name my-app --type webapp
|
||||
|
||||
laconic-so create-stack --name my-service --type service --repo github.com/org/repo
|
||||
"""
|
||||
# Validate
|
||||
validate_stack_name(name)
|
||||
|
||||
template = STACK_TEMPLATES[stack_type]
|
||||
data_dir = get_data_dir()
|
||||
|
||||
# Define paths
|
||||
stack_dir = data_dir / "stacks" / name
|
||||
container_dir = data_dir / "container-build" / f"cerc-{name}"
|
||||
compose_dir = data_dir / "compose"
|
||||
|
||||
# Check for existing files
|
||||
if not force:
|
||||
if stack_dir.exists():
|
||||
error_exit(f"Stack already exists: {stack_dir}\nUse --force to overwrite")
|
||||
if container_dir.exists():
|
||||
error_exit(f"Container build dir exists: {container_dir}\nUse --force to overwrite")
|
||||
|
||||
# Dry run check
|
||||
if opts.o.dry_run:
|
||||
print(f"Would create stack '{name}' with template '{stack_type}':")
|
||||
print(f" - {stack_dir}/stack.yml")
|
||||
print(f" - {container_dir}/Dockerfile")
|
||||
print(f" - {container_dir}/build.sh")
|
||||
print(f" - {compose_dir}/docker-compose-{name}.yml")
|
||||
print(f" - Update repository-list.txt")
|
||||
print(f" - Update container-image-list.txt")
|
||||
print(f" - Update pod-list.txt")
|
||||
return
|
||||
|
||||
# Create files
|
||||
if not opts.o.quiet:
|
||||
print(f"Creating stack '{name}' with template '{stack_type}'...")
|
||||
|
||||
create_stack_yml(stack_dir, name, template, repo)
|
||||
if opts.o.verbose:
|
||||
print(f" Created {stack_dir}/stack.yml")
|
||||
|
||||
create_dockerfile(container_dir, name, template)
|
||||
if opts.o.verbose:
|
||||
print(f" Created {container_dir}/Dockerfile")
|
||||
|
||||
create_build_script(container_dir, name)
|
||||
if opts.o.verbose:
|
||||
print(f" Created {container_dir}/build.sh")
|
||||
|
||||
create_compose_file(compose_dir, name, template)
|
||||
if opts.o.verbose:
|
||||
print(f" Created {compose_dir}/docker-compose-{name}.yml")
|
||||
|
||||
# Update list files
|
||||
if repo:
|
||||
update_list_file(data_dir, "repository-list.txt", repo)
|
||||
if opts.o.verbose:
|
||||
print(f" Added {repo} to repository-list.txt")
|
||||
|
||||
update_list_file(data_dir, "container-image-list.txt", f"cerc/{name}")
|
||||
if opts.o.verbose:
|
||||
print(f" Added cerc/{name} to container-image-list.txt")
|
||||
|
||||
update_list_file(data_dir, "pod-list.txt", name)
|
||||
if opts.o.verbose:
|
||||
print(f" Added {name} to pod-list.txt")
|
||||
|
||||
# Summary
|
||||
if not opts.o.quiet:
|
||||
print(f"\nStack '{name}' created successfully!")
|
||||
print(f"\nNext steps:")
|
||||
print(f" 1. Edit {stack_dir}/stack.yml")
|
||||
print(f" 2. Customize {container_dir}/Dockerfile")
|
||||
print(f" 3. Run: laconic-so --stack {name} build-containers")
|
||||
print(f" 4. Run: laconic-so --stack {name} deploy-system up")
|
||||
```
|
||||
|
||||
### 2. Register Command in main.py
|
||||
|
||||
**Edit `stack_orchestrator/main.py`**
|
||||
|
||||
Add import:
|
||||
```python
|
||||
from stack_orchestrator.create import create_stack
|
||||
```
|
||||
|
||||
Add command registration (after line ~78):
|
||||
```python
|
||||
cli.add_command(create_stack.command, "create-stack")
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Implementation Steps
|
||||
|
||||
### Step 1: Create module structure
|
||||
```bash
|
||||
mkdir -p stack_orchestrator/create
|
||||
touch stack_orchestrator/create/__init__.py
|
||||
```
|
||||
|
||||
### Step 2: Create the command file
|
||||
Create `stack_orchestrator/create/create_stack.py` with the code above.
|
||||
|
||||
### Step 3: Register in main.py
|
||||
Add the import and `cli.add_command()` line.
|
||||
|
||||
### Step 4: Test the command
|
||||
```bash
|
||||
# Show help
|
||||
laconic-so create-stack --help
|
||||
|
||||
# Dry run
|
||||
laconic-so --dry-run create-stack --name test-app --type webapp
|
||||
|
||||
# Create a stack
|
||||
laconic-so create-stack --name test-app --type webapp --repo github.com/org/test-app
|
||||
|
||||
# Verify
|
||||
ls -la stack_orchestrator/data/stacks/test-app/
|
||||
cat stack_orchestrator/data/stacks/test-app/stack.yml
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Template Types
|
||||
|
||||
| Type | Base Image | Port | Use Case |
|
||||
|------|------------|------|----------|
|
||||
| `webapp` | node:20-bullseye-slim | 3000 | React/Vue/Next.js apps |
|
||||
| `service` | python:3.11-slim | 8080 | Python backend services |
|
||||
| `empty` | none | none | Custom from scratch |
|
||||
|
||||
---
|
||||
|
||||
## Future Enhancements
|
||||
|
||||
1. **Interactive mode** - Prompt for values if not provided
|
||||
2. **More templates** - Go, Rust, database stacks
|
||||
3. **Template from existing** - `--from-stack existing-stack`
|
||||
4. **External stack support** - Create in custom directory
|
||||
5. **Validation command** - `laconic-so validate-stack --name my-stack`
|
||||
|
||||
---
|
||||
|
||||
## Files Modified
|
||||
|
||||
| File | Change |
|
||||
|------|--------|
|
||||
| `stack_orchestrator/create/__init__.py` | New (empty) |
|
||||
| `stack_orchestrator/create/create_stack.py` | New (command implementation) |
|
||||
| `stack_orchestrator/main.py` | Add import and `cli.add_command()` |
|
||||
|
||||
---
|
||||
|
||||
## Verification
|
||||
|
||||
```bash
|
||||
# 1. Command appears in help
|
||||
laconic-so --help | grep create-stack
|
||||
|
||||
# 2. Dry run works
|
||||
laconic-so --dry-run create-stack --name verify-test --type webapp
|
||||
|
||||
# 3. Full creation works
|
||||
laconic-so create-stack --name verify-test --type webapp
|
||||
ls stack_orchestrator/data/stacks/verify-test/
|
||||
ls stack_orchestrator/data/container-build/cerc-verify-test/
|
||||
ls stack_orchestrator/data/compose/docker-compose-verify-test.yml
|
||||
|
||||
# 4. Build works
|
||||
laconic-so --stack verify-test build-containers
|
||||
|
||||
# 5. Cleanup
|
||||
rm -rf stack_orchestrator/data/stacks/verify-test
|
||||
rm -rf stack_orchestrator/data/container-build/cerc-verify-test
|
||||
rm stack_orchestrator/data/compose/docker-compose-verify-test.yml
|
||||
```
|
||||
@ -51,7 +51,7 @@ $ laconic-so build-npms --include <package-name>
|
||||
```
|
||||
e.g.
|
||||
```
|
||||
$ laconic-so build-npms --include registry-sdk
|
||||
$ laconic-so build-npms --include laconic-sdk
|
||||
```
|
||||
Build the packages for a stack:
|
||||
```
|
||||
|
||||
@ -1,550 +0,0 @@
|
||||
# Docker Compose Deployment Guide
|
||||
|
||||
## Introduction
|
||||
|
||||
### What is a Deployer?
|
||||
|
||||
In stack-orchestrator, a **deployer** provides a uniform interface for orchestrating containerized applications. This guide focuses on Docker Compose deployments, which is the default and recommended deployment mode.
|
||||
|
||||
While stack-orchestrator also supports Kubernetes (`k8s`) and Kind (`k8s-kind`) deployments, those are out of scope for this guide. See the [Kubernetes Enhancements](./k8s-deployment-enhancements.md) documentation for advanced deployment options.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
To deploy stacks using Docker Compose, you need:
|
||||
|
||||
- Docker Engine (20.10+)
|
||||
- Docker Compose plugin (v2.0+)
|
||||
- Python 3.8+
|
||||
- stack-orchestrator installed (`laconic-so`)
|
||||
|
||||
**That's it!** No additional infrastructure is required. If you have Docker installed, you're ready to deploy.
|
||||
|
||||
## Deployment Workflow
|
||||
|
||||
The typical deployment workflow consists of four main steps:
|
||||
|
||||
1. **Setup repositories and build containers** (first time only)
|
||||
2. **Initialize deployment specification**
|
||||
3. **Create deployment directory**
|
||||
4. **Start and manage services**
|
||||
|
||||
## Quick Start Example
|
||||
|
||||
Here's a complete example using the built-in `test` stack:
|
||||
|
||||
```bash
|
||||
# Step 1: Setup (first time only)
|
||||
laconic-so --stack test setup-repositories
|
||||
laconic-so --stack test build-containers
|
||||
|
||||
# Step 2: Initialize deployment spec
|
||||
laconic-so --stack test deploy init --output test-spec.yml
|
||||
|
||||
# Step 3: Create deployment directory
|
||||
laconic-so --stack test deploy create \
|
||||
--spec-file test-spec.yml \
|
||||
--deployment-dir test-deployment
|
||||
|
||||
# Step 4: Start services
|
||||
laconic-so deployment --dir test-deployment start
|
||||
|
||||
# View running services
|
||||
laconic-so deployment --dir test-deployment ps
|
||||
|
||||
# View logs
|
||||
laconic-so deployment --dir test-deployment logs
|
||||
|
||||
# Stop services (preserves data)
|
||||
laconic-so deployment --dir test-deployment stop
|
||||
```
|
||||
|
||||
## Deployment Workflows
|
||||
|
||||
Stack-orchestrator supports two deployment workflows:
|
||||
|
||||
### 1. Deployment Directory Workflow (Recommended)
|
||||
|
||||
This workflow creates a persistent deployment directory that contains all configuration and data.
|
||||
|
||||
**When to use:**
|
||||
- Production deployments
|
||||
- When you need to preserve configuration
|
||||
- When you want to manage multiple deployments
|
||||
- When you need persistent volume data
|
||||
|
||||
**Example:**
|
||||
|
||||
```bash
|
||||
# Initialize deployment spec
|
||||
laconic-so --stack fixturenet-eth deploy init --output eth-spec.yml
|
||||
|
||||
# Optionally edit eth-spec.yml to customize configuration
|
||||
|
||||
# Create deployment directory
|
||||
laconic-so --stack fixturenet-eth deploy create \
|
||||
--spec-file eth-spec.yml \
|
||||
--deployment-dir my-eth-deployment
|
||||
|
||||
# Start the deployment
|
||||
laconic-so deployment --dir my-eth-deployment start
|
||||
|
||||
# Manage the deployment
|
||||
laconic-so deployment --dir my-eth-deployment ps
|
||||
laconic-so deployment --dir my-eth-deployment logs
|
||||
laconic-so deployment --dir my-eth-deployment stop
|
||||
```
|
||||
|
||||
### 2. Quick Deploy Workflow
|
||||
|
||||
This workflow deploys directly without creating a persistent deployment directory.
|
||||
|
||||
**When to use:**
|
||||
- Quick testing
|
||||
- Temporary deployments
|
||||
- Simple stacks that don't require customization
|
||||
|
||||
**Example:**
|
||||
|
||||
```bash
|
||||
# Start the stack directly
|
||||
laconic-so --stack test deploy up
|
||||
|
||||
# Check service status
|
||||
laconic-so --stack test deploy port test 80
|
||||
|
||||
# View logs
|
||||
laconic-so --stack test deploy logs
|
||||
|
||||
# Stop (preserves volumes)
|
||||
laconic-so --stack test deploy down
|
||||
|
||||
# Stop and remove volumes
|
||||
laconic-so --stack test deploy down --delete-volumes
|
||||
```
|
||||
|
||||
## Real-World Example: Ethereum Fixturenet
|
||||
|
||||
Deploy a local Ethereum testnet with Geth and Lighthouse:
|
||||
|
||||
```bash
|
||||
# Setup (first time only)
|
||||
laconic-so --stack fixturenet-eth setup-repositories
|
||||
laconic-so --stack fixturenet-eth build-containers
|
||||
|
||||
# Initialize with default configuration
|
||||
laconic-so --stack fixturenet-eth deploy init --output eth-spec.yml
|
||||
|
||||
# Create deployment
|
||||
laconic-so --stack fixturenet-eth deploy create \
|
||||
--spec-file eth-spec.yml \
|
||||
--deployment-dir fixturenet-eth-deployment
|
||||
|
||||
# Start the network
|
||||
laconic-so deployment --dir fixturenet-eth-deployment start
|
||||
|
||||
# Check status
|
||||
laconic-so deployment --dir fixturenet-eth-deployment ps
|
||||
|
||||
# Access logs from specific service
|
||||
laconic-so deployment --dir fixturenet-eth-deployment logs fixturenet-eth-geth-1
|
||||
|
||||
# Stop the network (preserves blockchain data)
|
||||
laconic-so deployment --dir fixturenet-eth-deployment stop
|
||||
|
||||
# Start again - blockchain data is preserved
|
||||
laconic-so deployment --dir fixturenet-eth-deployment start
|
||||
|
||||
# Clean up everything including data
|
||||
laconic-so deployment --dir fixturenet-eth-deployment stop --delete-volumes
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
### Passing Configuration Parameters
|
||||
|
||||
Configuration can be passed in three ways:
|
||||
|
||||
**1. At init time via `--config` flag:**
|
||||
|
||||
```bash
|
||||
laconic-so --stack test deploy init --output spec.yml \
|
||||
--config PARAM1=value1,PARAM2=value2
|
||||
```
|
||||
|
||||
**2. Edit the spec file after init:**
|
||||
|
||||
```bash
|
||||
# Initialize
|
||||
laconic-so --stack test deploy init --output spec.yml
|
||||
|
||||
# Edit spec.yml
|
||||
vim spec.yml
|
||||
```
|
||||
|
||||
Example spec.yml:
|
||||
```yaml
|
||||
stack: test
|
||||
config:
|
||||
PARAM1: value1
|
||||
PARAM2: value2
|
||||
```
|
||||
|
||||
**3. Docker Compose defaults:**
|
||||
|
||||
Environment variables defined in the stack's `docker-compose-*.yml` files are used as defaults. Configuration from the spec file overrides these defaults.
|
||||
|
||||
### Port Mapping
|
||||
|
||||
By default, services are accessible on randomly assigned host ports. To find the mapped port:
|
||||
|
||||
```bash
|
||||
# Find the host port for container port 80 on service 'webapp'
|
||||
laconic-so deployment --dir my-deployment port webapp 80
|
||||
|
||||
# Output example: 0.0.0.0:32768
|
||||
```
|
||||
|
||||
To configure fixed ports, edit the spec file before creating the deployment:
|
||||
|
||||
```yaml
|
||||
network:
|
||||
ports:
|
||||
webapp:
|
||||
- '8080:80' # Maps host port 8080 to container port 80
|
||||
api:
|
||||
- '3000:3000'
|
||||
```
|
||||
|
||||
Then create the deployment:
|
||||
|
||||
```bash
|
||||
laconic-so --stack my-stack deploy create \
|
||||
--spec-file spec.yml \
|
||||
--deployment-dir my-deployment
|
||||
```
|
||||
|
||||
### Volume Persistence
|
||||
|
||||
Volumes are preserved between stop/start cycles by default:
|
||||
|
||||
```bash
|
||||
# Stop but keep data
|
||||
laconic-so deployment --dir my-deployment stop
|
||||
|
||||
# Start again - data is still there
|
||||
laconic-so deployment --dir my-deployment start
|
||||
```
|
||||
|
||||
To completely remove all data:
|
||||
|
||||
```bash
|
||||
# Stop and delete all volumes
|
||||
laconic-so deployment --dir my-deployment stop --delete-volumes
|
||||
```
|
||||
|
||||
Volume data is stored in `<deployment-dir>/data/`.
|
||||
|
||||
## Common Operations
|
||||
|
||||
### Viewing Logs
|
||||
|
||||
```bash
|
||||
# All services, continuous follow
|
||||
laconic-so deployment --dir my-deployment logs --follow
|
||||
|
||||
# Last 100 lines from all services
|
||||
laconic-so deployment --dir my-deployment logs --tail 100
|
||||
|
||||
# Specific service only
|
||||
laconic-so deployment --dir my-deployment logs webapp
|
||||
|
||||
# Combine options
|
||||
laconic-so deployment --dir my-deployment logs --tail 50 --follow webapp
|
||||
```
|
||||
|
||||
### Executing Commands in Containers
|
||||
|
||||
```bash
|
||||
# Execute a command in a running service
|
||||
laconic-so deployment --dir my-deployment exec webapp ls -la
|
||||
|
||||
# Interactive shell
|
||||
laconic-so deployment --dir my-deployment exec webapp /bin/bash
|
||||
|
||||
# Run command with specific environment variables
|
||||
laconic-so deployment --dir my-deployment exec webapp env VAR=value command
|
||||
```
|
||||
|
||||
### Checking Service Status
|
||||
|
||||
```bash
|
||||
# List all running services
|
||||
laconic-so deployment --dir my-deployment ps
|
||||
|
||||
# Check using Docker directly
|
||||
docker ps
|
||||
```
|
||||
|
||||
### Updating a Running Deployment
|
||||
|
||||
If you need to change configuration after deployment:
|
||||
|
||||
```bash
|
||||
# 1. Edit the spec file
|
||||
vim my-deployment/spec.yml
|
||||
|
||||
# 2. Regenerate configuration
|
||||
laconic-so deployment --dir my-deployment update
|
||||
|
||||
# 3. Restart services to apply changes
|
||||
laconic-so deployment --dir my-deployment stop
|
||||
laconic-so deployment --dir my-deployment start
|
||||
```
|
||||
|
||||
## Multi-Service Deployments
|
||||
|
||||
Many stacks deploy multiple services that work together:
|
||||
|
||||
```bash
|
||||
# Deploy a stack with multiple services
|
||||
laconic-so --stack laconicd-with-console deploy init --output spec.yml
|
||||
laconic-so --stack laconicd-with-console deploy create \
|
||||
--spec-file spec.yml \
|
||||
--deployment-dir laconicd-deployment
|
||||
|
||||
laconic-so deployment --dir laconicd-deployment start
|
||||
|
||||
# View all services
|
||||
laconic-so deployment --dir laconicd-deployment ps
|
||||
|
||||
# View logs from specific services
|
||||
laconic-so deployment --dir laconicd-deployment logs laconicd
|
||||
laconic-so deployment --dir laconicd-deployment logs console
|
||||
```
|
||||
|
||||
## ConfigMaps
|
||||
|
||||
ConfigMaps allow you to mount configuration files into containers:
|
||||
|
||||
```bash
|
||||
# 1. Create the config directory in your deployment
|
||||
mkdir -p my-deployment/data/my-config
|
||||
echo "database_url=postgres://localhost" > my-deployment/data/my-config/app.conf
|
||||
|
||||
# 2. Reference in spec file
|
||||
vim my-deployment/spec.yml
|
||||
```
|
||||
|
||||
Add to spec.yml:
|
||||
```yaml
|
||||
configmaps:
|
||||
my-config: ./data/my-config
|
||||
```
|
||||
|
||||
```bash
|
||||
# 3. Restart to apply
|
||||
laconic-so deployment --dir my-deployment stop
|
||||
laconic-so deployment --dir my-deployment start
|
||||
```
|
||||
|
||||
The files will be mounted in the container at `/config/` (or as specified by the stack).
|
||||
|
||||
## Deployment Directory Structure
|
||||
|
||||
A typical deployment directory contains:
|
||||
|
||||
```
|
||||
my-deployment/
|
||||
├── compose/
|
||||
│ └── docker-compose-*.yml # Generated compose files
|
||||
├── config.env # Environment variables
|
||||
├── deployment.yml # Deployment metadata
|
||||
├── spec.yml # Deployment specification
|
||||
└── data/ # Volume mounts and configs
|
||||
├── service-data/ # Persistent service data
|
||||
└── config-maps/ # ConfigMap files
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
**Problem: "Cannot connect to Docker daemon"**
|
||||
|
||||
```bash
|
||||
# Ensure Docker is running
|
||||
docker ps
|
||||
|
||||
# Start Docker if needed (macOS)
|
||||
open -a Docker
|
||||
|
||||
# Start Docker (Linux)
|
||||
sudo systemctl start docker
|
||||
```
|
||||
|
||||
**Problem: "Port already in use"**
|
||||
|
||||
```bash
|
||||
# Either stop the conflicting service or use different ports
|
||||
# Edit spec.yml before creating deployment:
|
||||
|
||||
network:
|
||||
ports:
|
||||
webapp:
|
||||
- '8081:80' # Use 8081 instead of 8080
|
||||
```
|
||||
|
||||
**Problem: "Image not found"**
|
||||
|
||||
```bash
|
||||
# Build containers first
|
||||
laconic-so --stack your-stack build-containers
|
||||
```
|
||||
|
||||
**Problem: Volumes not persisting**
|
||||
|
||||
```bash
|
||||
# Check if you used --delete-volumes when stopping
|
||||
# Volume data is in: <deployment-dir>/data/
|
||||
|
||||
# Don't use --delete-volumes if you want to keep data:
|
||||
laconic-so deployment --dir my-deployment stop
|
||||
|
||||
# Only use --delete-volumes when you want to reset completely:
|
||||
laconic-so deployment --dir my-deployment stop --delete-volumes
|
||||
```
|
||||
|
||||
**Problem: Services not starting**
|
||||
|
||||
```bash
|
||||
# Check logs for errors
|
||||
laconic-so deployment --dir my-deployment logs
|
||||
|
||||
# Check Docker container status
|
||||
docker ps -a
|
||||
|
||||
# Try stopping and starting again
|
||||
laconic-so deployment --dir my-deployment stop
|
||||
laconic-so deployment --dir my-deployment start
|
||||
```
|
||||
|
||||
### Inspecting Deployment State
|
||||
|
||||
```bash
|
||||
# Check deployment directory structure
|
||||
ls -la my-deployment/
|
||||
|
||||
# Check running containers
|
||||
docker ps
|
||||
|
||||
# Check container details
|
||||
docker inspect <container-name>
|
||||
|
||||
# Check networks
|
||||
docker network ls
|
||||
|
||||
# Check volumes
|
||||
docker volume ls
|
||||
```
|
||||
|
||||
## CLI Commands Reference
|
||||
|
||||
### Stack Operations
|
||||
|
||||
```bash
|
||||
# Clone required repositories
|
||||
laconic-so --stack <name> setup-repositories
|
||||
|
||||
# Build container images
|
||||
laconic-so --stack <name> build-containers
|
||||
```
|
||||
|
||||
### Deployment Initialization
|
||||
|
||||
```bash
|
||||
# Initialize deployment spec with defaults
|
||||
laconic-so --stack <name> deploy init --output <spec-file>
|
||||
|
||||
# Initialize with configuration
|
||||
laconic-so --stack <name> deploy init --output <spec-file> \
|
||||
--config PARAM1=value1,PARAM2=value2
|
||||
```
|
||||
|
||||
### Deployment Creation
|
||||
|
||||
```bash
|
||||
# Create deployment directory from spec
|
||||
laconic-so --stack <name> deploy create \
|
||||
--spec-file <spec-file> \
|
||||
--deployment-dir <dir>
|
||||
```
|
||||
|
||||
### Deployment Management
|
||||
|
||||
```bash
|
||||
# Start all services
|
||||
laconic-so deployment --dir <dir> start
|
||||
|
||||
# Stop services (preserves volumes)
|
||||
laconic-so deployment --dir <dir> stop
|
||||
|
||||
# Stop and remove volumes
|
||||
laconic-so deployment --dir <dir> stop --delete-volumes
|
||||
|
||||
# List running services
|
||||
laconic-so deployment --dir <dir> ps
|
||||
|
||||
# View logs
|
||||
laconic-so deployment --dir <dir> logs [--tail N] [--follow] [service]
|
||||
|
||||
# Show mapped port
|
||||
laconic-so deployment --dir <dir> port <service> <private-port>
|
||||
|
||||
# Execute command in service
|
||||
laconic-so deployment --dir <dir> exec <service> <command>
|
||||
|
||||
# Update configuration
|
||||
laconic-so deployment --dir <dir> update
|
||||
```
|
||||
|
||||
### Quick Deploy Commands
|
||||
|
||||
```bash
|
||||
# Start stack directly
|
||||
laconic-so --stack <name> deploy up
|
||||
|
||||
# Stop stack
|
||||
laconic-so --stack <name> deploy down [--delete-volumes]
|
||||
|
||||
# View logs
|
||||
laconic-so --stack <name> deploy logs
|
||||
|
||||
# Show port mapping
|
||||
laconic-so --stack <name> deploy port <service> <port>
|
||||
```
|
||||
|
||||
## Related Documentation
|
||||
|
||||
- [CLI Reference](./cli.md) - Complete CLI command documentation
|
||||
- [Adding a New Stack](./adding-a-new-stack.md) - Creating custom stacks
|
||||
- [Specification](./spec.md) - Internal structure and design
|
||||
- [Kubernetes Enhancements](./k8s-deployment-enhancements.md) - Advanced K8s deployment options
|
||||
- [Web App Deployment](./webapp.md) - Deploying web applications
|
||||
|
||||
## Examples
|
||||
|
||||
For more examples, see the test scripts:
|
||||
- `scripts/quick-deploy-test.sh` - Quick deployment example
|
||||
- `tests/deploy/run-deploy-test.sh` - Comprehensive test showing all features
|
||||
|
||||
## Summary
|
||||
|
||||
- Docker Compose is the default and recommended deployment mode
|
||||
- Two workflows: deployment directory (recommended) or quick deploy
|
||||
- The standard workflow is: setup → build → init → create → start
|
||||
- Configuration is flexible with multiple override layers
|
||||
- Volume persistence is automatic unless explicitly deleted
|
||||
- All deployment state is contained in the deployment directory
|
||||
- For Kubernetes deployments, see separate K8s documentation
|
||||
|
||||
You're now ready to deploy stacks using stack-orchestrator with Docker Compose!
|
||||
@ -56,7 +56,7 @@ laconic-so --stack fixturenet-laconicd build-npms
|
||||
Navigate to the Gitea console and switch to the `cerc-io` user then find the `Packages` tab to confirm that these two npm packages have been published:
|
||||
|
||||
- `@cerc-io/laconic-registry-cli`
|
||||
- `@cerc-io/registry-sdk`
|
||||
- `@cerc-io/laconic-sdk`
|
||||
|
||||
### Build and deploy fixturenet containers
|
||||
|
||||
@ -74,7 +74,7 @@ laconic-so --stack fixturenet-laconicd deploy logs
|
||||
### Test with the registry CLI
|
||||
|
||||
```bash
|
||||
laconic-so --stack fixturenet-laconicd deploy exec cli "laconic registry status"
|
||||
laconic-so --stack fixturenet-laconicd deploy exec cli "laconic cns status"
|
||||
```
|
||||
|
||||
Try additional CLI commands, documented [here](https://github.com/cerc-io/laconic-registry-cli#operations).
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
# K8S Deployment Enhancements
|
||||
## Controlling pod placement
|
||||
The placement of pods created as part of a stack deployment can be controlled to either avoid certain nodes, or require certain nodes.
|
||||
### Pod/Node Affinity
|
||||
Node affinity rules applied to pods target node labels. The effect is that a pod can only be placed on a node having the specified label value. Note that other pods that do not have any node affinity rules can also be placed on those same nodes. Thus node affinity for a pod controls where that pod can be placed, but does not control where other pods are placed.
|
||||
|
||||
Node affinity for stack pods is specified in the deployment's `spec.yml` file as follows:
|
||||
```
|
||||
node-affinities:
|
||||
- label: nodetype
|
||||
value: typeb
|
||||
```
|
||||
This example denotes that the stack's pods should only be placed on nodes that have the label `nodetype` with value `typeb`.
|
||||
### Node Taint Toleration
|
||||
K8s nodes can be given one or more "taints". These are special fields (distinct from labels) with a name (key) and optional value.
|
||||
When placing pods, the k8s scheduler will only assign a pod to a tainted node if the pod posesses a corresponding "toleration".
|
||||
This is metadata associated with the pod that specifies that the pod "tolerates" a given taint.
|
||||
Therefore taint toleration provides a mechanism by which only certain pods can be placed on specific nodes, and provides a complementary mechanism to node affinity.
|
||||
|
||||
Taint toleration for stack pods is specified in the deployment's `spec.yml` file as follows:
|
||||
```
|
||||
node-tolerations:
|
||||
- key: nodetype
|
||||
value: typeb
|
||||
```
|
||||
This example denotes that the stack's pods will tolerate a taint: `nodetype=typeb`
|
||||
|
||||
@ -1,8 +1,9 @@
|
||||
# Running a laconicd fixturenet with console
|
||||
|
||||
The following tutorial explains the steps to run a laconicd fixturenet with CLI and web console that displays records in the registry. It is designed as an introduction to Stack Orchestrator and to showcase one component of the Laconic Stack. Prior to Stack Orchestrator, the following repositories had to be cloned and setup manually:
|
||||
The following tutorial explains the steps to run a laconicd fixturenet with CLI and web console that displays records in the registry. It is designed as an introduction to Stack Orchestrator and to showcase one component of the Laconic Stack. Prior to Stack Orchestrator, the following 4 repositories had to be cloned and setup manually:
|
||||
|
||||
- https://git.vdb.to/cerc-io/laconicd
|
||||
- https://git.vdb.to/cerc-io/laconic-sdk
|
||||
- https://git.vdb.to/cerc-io/laconic-registry-cli
|
||||
- https://git.vdb.to/cerc-io/laconic-console
|
||||
|
||||
@ -50,7 +51,7 @@ To avoid hiccups on Mac M1/M2 and any local machine nuances that may affect the
|
||||
1. Get the repositories
|
||||
|
||||
```
|
||||
laconic-so --stack fixturenet-laconic-loaded setup-repositories --include git.vdb.to/cerc-io/laconicd
|
||||
laconic-so --stack fixturenet-laconic-loaded setup-repositories --include git.vdb.to/cerc-io/laconicd,git.vdb.to/cerc-io/laconic-sdk,git.vdb.to/cerc-io/laconic-registry-cli,git.vdb.to/cerc-io/laconic-console
|
||||
```
|
||||
|
||||
1. Build the containers:
|
||||
@ -75,8 +76,6 @@ To avoid hiccups on Mac M1/M2 and any local machine nuances that may affect the
|
||||
1. Create a deployment directory for the stack:
|
||||
```
|
||||
laconic-so --stack fixturenet-laconic-loaded deploy init --output laconic-loaded.spec --map-ports-to-host any-same --config LACONIC_HOSTED_ENDPOINT=$BACKEND_ENDPOINT
|
||||
|
||||
# Update port mapping in the laconic-loaded.spec file to resolve port conflicts on host if any
|
||||
```
|
||||
```
|
||||
laconic-so --stack fixturenet-laconic-loaded deploy create --deployment-dir laconic-loaded-deployment --spec-file laconic-loaded.spec
|
||||
@ -96,51 +95,52 @@ To avoid hiccups on Mac M1/M2 and any local machine nuances that may affect the
|
||||
You'll see output from `laconicd` and the block height should be >1 to confirm it is running:
|
||||
|
||||
```
|
||||
laconicd-1 | 6:12AM INF indexed block events height=16 module=txindex
|
||||
laconicd-1 | 6:12AM INF Timed out dur=2993.893332 height=17 module=consensus round=0 step=RoundStepNewHeight
|
||||
laconicd-1 | 6:12AM INF received proposal module=consensus proposal="Proposal{17/0 (E15D03C180CE607AE8340A1325A0C134DFB4E1ADD992E173C701EBD362523267:1:DF138772FEF0, -1) 6A6F3B0A42B3 @ 2024-07-25T06:12:31.952967053Z}" proposer=86970D950BC9C16F3991A52D9C6DC55BA478A7C6
|
||||
laconicd-1 | 6:12AM INF received complete proposal block hash=E15D03C180CE607AE8340A1325A0C134DFB4E1ADD992E173C701EBD362523267 height=17 module=consensus
|
||||
laconicd-1 | 6:12AM INF finalizing commit of block hash=E15D03C180CE607AE8340A1325A0C134DFB4E1ADD992E173C701EBD362523267 height=17 module=consensus num_txs=0 root=AF4941107DC718ED1425E77A3DC7F1154FB780B7A7DE20288DC43442203527E3
|
||||
laconicd-1 | 6:12AM INF finalized block block_app_hash=26A665360BB1EE64E54F97F2A5AB7F621B33A86D9896574000C05DE63F43F788 height=17 module=state num_txs_res=0 num_val_updates=0
|
||||
laconicd-1 | 6:12AM INF executed block app_hash=26A665360BB1EE64E54F97F2A5AB7F621B33A86D9896574000C05DE63F43F788 height=17 module=state
|
||||
laconicd-1 | 6:12AM INF committed state block_app_hash=AF4941107DC718ED1425E77A3DC7F1154FB780B7A7DE20288DC43442203527E3 height=17 module=state
|
||||
laconicd-1 | 6:12AM INF indexed block events height=17 module=txindex
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:29PM INF indexed block exents height=12 module=txindex server=node
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF Timed out dur=4976.960115 height=13 module=consensus round=0 server=node step=1
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF received proposal module=consensus proposal={"Type":32,"block_id":{"hash":"D26C088A711F912ADB97888C269F628DA33153795621967BE44DCB43C3D03CA4","parts":{"hash":"22411A20B7F14CDA33244420FBDDAF24450C0628C7A06034FF22DAC3699DDCC8","total":1}},"height":13,"pol_round":-1,"round":0,"signature":"DEuqnaQmvyYbUwckttJmgKdpRu6eVm9i+9rQ1pIrV2PidkMNdWRZBLdmNghkIrUzGbW8Xd7UVJxtLRmwRASgBg==","timestamp":"2023-04-18T21:30:01.49450663Z"} server=node
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF received complete proposal block hash=D26C088A711F912ADB97888C269F628DA33153795621967BE44DCB43C3D03CA4 height=13 module=consensus server=node
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF finalizing commit of block hash={} height=13 module=consensus num_txs=0 root=1A8CA1AF139CCC80EC007C6321D8A63A46A793386EE2EDF9A5CA0AB2C90728B7 server=node
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF minted coins from module account amount=2059730459416582643aphoton from=mint module=x/bank
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF executed block height=13 module=state num_invalid_txs=0 num_valid_txs=0 server=node
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF commit synced commit=436F6D6D697449447B5B363520313037203630203232372039352038352032303820313334203231392032303520313433203130372031343920313431203139203139322038362031323720362031383520323533203137362031333820313735203135392031383620323334203135382031323120313431203230342037335D3A447D
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF committed state app_hash=416B3CE35F55D086DBCD8F6B958D13C0567F06B9FDB08AAF9FBAEA9E798DCC49 height=13 module=state num_txs=0 server=node
|
||||
laconic-5cd0a80c1442c3044c8b295d26426bae-laconicd-1 | 9:30PM INF indexed block exents height=13 module=txindex server=node
|
||||
```
|
||||
|
||||
4. Confirm operation of the registry CLI:
|
||||
|
||||
```
|
||||
laconic-so deployment --dir laconic-loaded-deployment exec cli "laconic registry status"
|
||||
laconic-so deployment --dir laconic-loaded-deployment exec cli "laconic cns status"
|
||||
```
|
||||
|
||||
```
|
||||
{
|
||||
"version": "0.3.0",
|
||||
"node": {
|
||||
"id": "6e072894aa1f5d9535a1127a0d7a7f8e65100a2c",
|
||||
"id": "4216af2ac9f68bda33a38803fc1b5c9559312c1d",
|
||||
"network": "laconic_9000-1",
|
||||
"moniker": "localtestnet"
|
||||
},
|
||||
"sync": {
|
||||
"latestBlockHash": "260102C283D0411CFBA0270F7DC182650FFCA737A2F6F652A985F6065696F590",
|
||||
"latestBlockHeight": "49",
|
||||
"latestBlockTime": "2024-07-25 06:14:05.626744215 +0000 UTC",
|
||||
"catchingUp": false
|
||||
"latest_block_hash": "1BDF4CB9AE2390DA65BCF997C83133C18014FCDDCAE03708488F0B56FCEEA429",
|
||||
"latest_block_height": "5",
|
||||
"latest_block_time": "2023-08-09 16:00:30.386903172 +0000 UTC",
|
||||
"catching_up": false
|
||||
},
|
||||
"validator": {
|
||||
"address": "86970D950BC9C16F3991A52D9C6DC55BA478A7C6",
|
||||
"votingPower": "1000000000000000"
|
||||
"address": "651FBC700B747C76E90ACFC18CC9508C3D0905B9",
|
||||
"voting_power": "1000000000000000"
|
||||
},
|
||||
"validators": [
|
||||
{
|
||||
"address": "86970D950BC9C16F3991A52D9C6DC55BA478A7C6",
|
||||
"votingPower": "1000000000000000",
|
||||
"proposerPriority": "0"
|
||||
"address": "651FBC700B747C76E90ACFC18CC9508C3D0905B9",
|
||||
"voting_power": "1000000000000000",
|
||||
"proposer_priority": "0"
|
||||
}
|
||||
],
|
||||
"numPeers": "0",
|
||||
"num_peers": "0",
|
||||
"peers": [],
|
||||
"diskUsage": "688K"
|
||||
"disk_usage": "292.0K"
|
||||
}
|
||||
```
|
||||
|
||||
@ -186,13 +186,13 @@ wns
|
||||
1. The following command will create a bond and publish a record:
|
||||
|
||||
```
|
||||
laconic-so deployment --dir laconic-loaded-deployment exec cli ./scripts/create-demo-records.sh
|
||||
laconic-so --stack fixturenet-laconic-loaded deploy exec cli ./scripts/create-demo-records.sh
|
||||
```
|
||||
|
||||
You'll get an output like:
|
||||
|
||||
```
|
||||
Balance is: 9.9999e+25
|
||||
Balance is: 99998999999999998999600000
|
||||
Created bond with id: dd88e8d6f9567b32b28e70552aea4419c5dd3307ebae85a284d1fe38904e301a
|
||||
Published demo-record-1.yml with id: bafyreierh3xnfivexlscdwubvczmddsnf46uytyfvrbdhkjzztvsz6ruly
|
||||
```
|
||||
@ -223,5 +223,5 @@ record:
|
||||
- e.g,:
|
||||
|
||||
```
|
||||
laconic-so deployment --dir laconic-loaded-deployment exec cli "laconic registry record list"
|
||||
laconic-so --stack fixturenet-laconic-loaded deploy exec cli "laconic cns record list"
|
||||
```
|
||||
|
||||
@ -1,128 +0,0 @@
|
||||
# Deploying to the Laconic Network
|
||||
|
||||
## Overview
|
||||
|
||||
The Laconic network uses a **registry-based deployment model** where everything is published as blockchain records.
|
||||
|
||||
## Key Documentation in stack-orchestrator
|
||||
|
||||
- `docs/laconicd-with-console.md` - Setting up a laconicd network
|
||||
- `docs/webapp.md` - Webapp building/running
|
||||
- `stack_orchestrator/deploy/webapp/` - Implementation (14 modules)
|
||||
|
||||
## Core Concepts
|
||||
|
||||
### LRN (Laconic Resource Name)
|
||||
Format: `lrn://laconic/[namespace]/[name]`
|
||||
|
||||
Examples:
|
||||
- `lrn://laconic/deployers/my-deployer-name`
|
||||
- `lrn://laconic/dns/example.com`
|
||||
- `lrn://laconic/deployments/example.com`
|
||||
|
||||
### Registry Record Types
|
||||
|
||||
| Record Type | Purpose |
|
||||
|-------------|---------|
|
||||
| `ApplicationRecord` | Published app metadata |
|
||||
| `WebappDeployer` | Deployment service offering |
|
||||
| `ApplicationDeploymentRequest` | User's request to deploy |
|
||||
| `ApplicationDeploymentAuction` | Optional bidding for deployers |
|
||||
| `ApplicationDeploymentRecord` | Completed deployment result |
|
||||
|
||||
## Deployment Workflows
|
||||
|
||||
### 1. Direct Deployment
|
||||
|
||||
```
|
||||
User publishes ApplicationDeploymentRequest
|
||||
→ targets specific WebappDeployer (by LRN)
|
||||
→ includes payment TX hash
|
||||
→ Deployer picks up request, builds, deploys, publishes result
|
||||
```
|
||||
|
||||
### 2. Auction-Based Deployment
|
||||
|
||||
```
|
||||
User publishes ApplicationDeploymentAuction
|
||||
→ Deployers bid (commit/reveal phases)
|
||||
→ Winner selected
|
||||
→ User publishes request targeting winner
|
||||
```
|
||||
|
||||
## Key CLI Commands
|
||||
|
||||
### Publish a Deployer Service
|
||||
```bash
|
||||
laconic-so publish-webapp-deployer --laconic-config config.yml \
|
||||
--api-url https://deployer-api.example.com \
|
||||
--name my-deployer \
|
||||
--payment-address laconic1... \
|
||||
--minimum-payment 1000alnt
|
||||
```
|
||||
|
||||
### Request Deployment (User Side)
|
||||
```bash
|
||||
laconic-so request-webapp-deployment --laconic-config config.yml \
|
||||
--app lrn://laconic/apps/my-app \
|
||||
--deployer lrn://laconic/deployers/xyz \
|
||||
--make-payment auto
|
||||
```
|
||||
|
||||
### Run Deployer Service (Deployer Side)
|
||||
```bash
|
||||
laconic-so deploy-webapp-from-registry --laconic-config config.yml --discover
|
||||
```
|
||||
|
||||
## Laconic Config File
|
||||
|
||||
All tools require a laconic config file (`laconic.toml`):
|
||||
|
||||
```toml
|
||||
[cosmos]
|
||||
address_prefix = "laconic"
|
||||
chain_id = "laconic_9000-1"
|
||||
endpoint = "http://localhost:26657"
|
||||
key = "<account-name>"
|
||||
password = "<account-password>"
|
||||
```
|
||||
|
||||
## Setting Up a Local Laconicd Network
|
||||
|
||||
```bash
|
||||
# Clone and build
|
||||
laconic-so --stack fixturenet-laconic-loaded setup-repositories
|
||||
laconic-so --stack fixturenet-laconic-loaded build-containers
|
||||
laconic-so --stack fixturenet-laconic-loaded deploy create
|
||||
laconic-so deployment --dir laconic-loaded-deployment start
|
||||
|
||||
# Check status
|
||||
laconic-so deployment --dir laconic-loaded-deployment exec cli "laconic registry status"
|
||||
```
|
||||
|
||||
## Key Implementation Files
|
||||
|
||||
| File | Purpose |
|
||||
|------|---------|
|
||||
| `publish_webapp_deployer.py` | Register deployment service on network |
|
||||
| `publish_deployment_auction.py` | Create auction for deployers to bid on |
|
||||
| `handle_deployment_auction.py` | Monitor and bid on auctions (deployer-side) |
|
||||
| `request_webapp_deployment.py` | Create deployment request (user-side) |
|
||||
| `deploy_webapp_from_registry.py` | Process requests and deploy (deployer-side) |
|
||||
| `request_webapp_undeployment.py` | Request app removal |
|
||||
| `undeploy_webapp_from_registry.py` | Process removal requests |
|
||||
| `util.py` | LaconicRegistryClient - all registry interactions |
|
||||
|
||||
## Payment System
|
||||
|
||||
- **Token Denom**: `alnt` (Laconic network tokens)
|
||||
- **Payment Options**:
|
||||
- `--make-payment`: Create new payment with amount (or "auto" for deployer's minimum)
|
||||
- `--use-payment`: Reference existing payment TX
|
||||
|
||||
## What's NOT Well-Documented
|
||||
|
||||
1. No end-to-end tutorial for full deployment workflow
|
||||
2. Stack publishing (vs webapp) process unclear
|
||||
3. LRN naming conventions not formally specified
|
||||
4. Payment economics and token mechanics
|
||||
@ -11,5 +11,3 @@ tomli==2.0.1
|
||||
validators==0.22.0
|
||||
kubernetes>=28.1.0
|
||||
humanfriendly>=10.0
|
||||
python-gnupg>=0.5.2
|
||||
requests>=2.3.2
|
||||
|
||||
4
setup.py
4
setup.py
@ -4,11 +4,9 @@ with open("README.md", "r", encoding="utf-8") as fh:
|
||||
long_description = fh.read()
|
||||
with open("requirements.txt", "r", encoding="utf-8") as fh:
|
||||
requirements = fh.read()
|
||||
with open("stack_orchestrator/data/version.txt", "r", encoding="utf-8") as fh:
|
||||
version = fh.readlines()[-1].strip(" \n")
|
||||
setup(
|
||||
name='laconic-stack-orchestrator',
|
||||
version=version,
|
||||
version='1.0.12',
|
||||
author='Cerc',
|
||||
author_email='info@cerc.io',
|
||||
license='GNU Affero General Public License',
|
||||
|
||||
@ -71,7 +71,7 @@ def process_container(build_context: BuildContext) -> bool:
|
||||
|
||||
# Check if this is in an external stack
|
||||
if stack_is_external(build_context.stack):
|
||||
container_parent_dir = Path(build_context.stack).parent.parent.joinpath("container-build")
|
||||
container_parent_dir = Path(build_context.stack).joinpath("container-build")
|
||||
temp_build_dir = container_parent_dir.joinpath(build_context.container.replace("/", "-"))
|
||||
temp_build_script_filename = temp_build_dir.joinpath("build.sh")
|
||||
# Now check if the container exists in the external stack.
|
||||
|
||||
@ -21,6 +21,11 @@ from stack_orchestrator.util import get_parsed_stack_config, warn_exit
|
||||
|
||||
def get_containers_in_scope(stack: str):
|
||||
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from stack_orchestrator import data
|
||||
with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file:
|
||||
all_containers = container_list_file.read().splitlines()
|
||||
|
||||
containers_in_scope = []
|
||||
if stack:
|
||||
stack_config = get_parsed_stack_config(stack)
|
||||
@ -28,10 +33,7 @@ def get_containers_in_scope(stack: str):
|
||||
warn_exit(f"stack {stack} does not define any containers")
|
||||
containers_in_scope = stack_config['containers']
|
||||
else:
|
||||
# See: https://stackoverflow.com/a/20885799/1701505
|
||||
from stack_orchestrator import data
|
||||
with importlib.resources.open_text(data, "container-image-list.txt") as container_list_file:
|
||||
containers_in_scope = container_list_file.read().splitlines()
|
||||
containers_in_scope = all_containers
|
||||
|
||||
if opts.o.verbose:
|
||||
print(f'Containers: {containers_in_scope}')
|
||||
|
||||
@ -34,8 +34,5 @@ volumes_key = "volumes"
|
||||
security_key = "security"
|
||||
annotations_key = "annotations"
|
||||
labels_key = "labels"
|
||||
replicas_key = "replicas"
|
||||
node_affinities_key = "node-affinities"
|
||||
node_tolerations_key = "node-tolerations"
|
||||
kind_config_filename = "kind-config.yml"
|
||||
kube_config_filename = "kubeconfig.yml"
|
||||
|
||||
@ -2,11 +2,10 @@ services:
|
||||
laconicd:
|
||||
restart: unless-stopped
|
||||
image: cerc/laconicd:local
|
||||
command: ["bash", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||
environment:
|
||||
TEST_AUCTION_ENABLED: ${TEST_AUCTION_ENABLED:-false}
|
||||
TEST_REGISTRY_EXPIRY: ${TEST_REGISTRY_EXPIRY:-false}
|
||||
ONBOARDING_ENABLED: ${ONBOARDING_ENABLED:-false}
|
||||
TEST_AUCTION_ENABLED: ${TEST_AUCTION_ENABLED}
|
||||
TEST_REGISTRY_EXPIRY: ${TEST_REGISTRY_EXPIRY}
|
||||
volumes:
|
||||
# The cosmos-sdk node's database directory:
|
||||
- laconicd-data:/root/.laconicd
|
||||
@ -20,9 +19,11 @@ services:
|
||||
- "26657"
|
||||
- "26656"
|
||||
- "9473"
|
||||
- "8545"
|
||||
- "8546"
|
||||
- "9090"
|
||||
- "9091"
|
||||
- "1317"
|
||||
|
||||
cli:
|
||||
image: cerc/laconic-registry-cli:local
|
||||
volumes:
|
||||
|
||||
@ -6,7 +6,6 @@ services:
|
||||
- ../config/fixturenet-eth/fixturenet-eth.env
|
||||
environment:
|
||||
RUN_BOOTNODE: "true"
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
image: cerc/fixturenet-plugeth-plugeth:local
|
||||
volumes:
|
||||
- fixturenet_plugeth_bootnode_geth_data:/root/ethdata
|
||||
|
||||
@ -2,24 +2,16 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
grafana:
|
||||
image: grafana/grafana:10.2.3
|
||||
image: grafana/grafana:10.2.2
|
||||
restart: always
|
||||
environment:
|
||||
GF_SERVER_ROOT_URL: ${GF_SERVER_ROOT_URL}
|
||||
CERC_GRAFANA_ALERTS_SUBGRAPH_IDS: ${CERC_GRAFANA_ALERTS_SUBGRAPH_IDS}
|
||||
volumes:
|
||||
- ../config/monitoring/grafana/provisioning:/etc/grafana/provisioning
|
||||
- ../config/monitoring/grafana/dashboards:/etc/grafana/dashboards
|
||||
- ../config/monitoring/update-grafana-alerts-config.sh:/update-grafana-alerts-config.sh
|
||||
- grafana_storage:/var/lib/grafana
|
||||
user: root
|
||||
entrypoint: ["bash", "-c"]
|
||||
command: |
|
||||
"/update-grafana-alerts-config.sh && /run.sh"
|
||||
ports:
|
||||
- "3000"
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3000"]
|
||||
interval: 30s
|
||||
|
||||
@ -16,13 +16,8 @@ services:
|
||||
postgres_pass: password
|
||||
postgres_db: graph-node
|
||||
ethereum: ${ETH_NETWORKS:-lotus-fixturenet:http://lotus-node-1:1234/rpc/v1}
|
||||
# Env varaibles reference: https://git.vdb.to/cerc-io/graph-node/src/branch/master/docs/environment-variables.md
|
||||
GRAPH_LOG: debug
|
||||
ETHEREUM_REORG_THRESHOLD: 3
|
||||
GRAPH_ETHEREUM_JSON_RPC_TIMEOUT: ${GRAPH_ETHEREUM_JSON_RPC_TIMEOUT:-180}
|
||||
GRAPH_ETHEREUM_REQUEST_RETRIES: ${GRAPH_ETHEREUM_REQUEST_RETRIES:-10}
|
||||
GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE: ${GRAPH_ETHEREUM_MAX_BLOCK_RANGE_SIZE:-2000}
|
||||
GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEIPTS: ${GRAPH_ETHEREUM_BLOCK_INGESTOR_MAX_CONCURRENT_JSON_RPC_CALLS_FOR_TXN_RECEIPTS:-1000}
|
||||
entrypoint: ["bash", "-c"]
|
||||
# Wait for ETH RPC endpoint to be up when running with fixturenet-lotus
|
||||
command: |
|
||||
@ -32,7 +27,6 @@ services:
|
||||
- "8001"
|
||||
- "8020"
|
||||
- "8030"
|
||||
- "8040"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "localhost", "8020"]
|
||||
interval: 30s
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
services:
|
||||
laconic-explorer:
|
||||
restart: unless-stopped
|
||||
image: cerc/ping-pub:local
|
||||
environment:
|
||||
- LACONIC_LACONICD_API_URL=${LACONIC_LACONICD_API_URL:-http://localhost:1317}
|
||||
- LACONIC_LACONICD_RPC_URL=${LACONIC_LACONICD_RPC_URL:-http://localhost:26657}
|
||||
- LACONIC_LACONICD_CHAIN_ID=${LACONIC_LACONICD_CHAIN_ID:-chain-id-not-set}
|
||||
ports:
|
||||
- "5173"
|
||||
@ -53,6 +53,8 @@ services:
|
||||
--nodiscover
|
||||
--maxpeers=0
|
||||
--rollup.disabletxpoolgossip=true
|
||||
--override.canyon="${OVERRIDE_CANYON:-0}"
|
||||
--override.ecotone="${OVERRIDE_ECOTONE:-1716843599}"
|
||||
env_file:
|
||||
- ../config/mainnet-blast/${NETWORK:-mainnet}.config
|
||||
depends_on:
|
||||
@ -67,13 +69,14 @@ services:
|
||||
- "7300"
|
||||
command: >
|
||||
op-node
|
||||
--l1="https://eth-mainnet-1.vdb.to/"
|
||||
--metrics.enabled
|
||||
--l1="${L1_RPC:-https://eth-mainnet-1.vdb.to/}"
|
||||
--l1.beacon="${L1_RPC_BEACON:-https://eth-mainnet-1.vdb.to/}"
|
||||
--l1.rpckind="any"
|
||||
--l1.trustrpc=true
|
||||
--l2="http://blast-geth:8551"
|
||||
--l2="${L2_RPC:-http://blast-geth:8551}"
|
||||
--l2.jwt-secret=/blast/jwt.txt
|
||||
--rollup.config="/blast/rollup.json"
|
||||
--metrics.enabled
|
||||
depends_on:
|
||||
- blast-geth
|
||||
env_file:
|
||||
|
||||
@ -28,37 +28,15 @@ services:
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
ethereum-chain-head-exporter:
|
||||
chain-head-exporter:
|
||||
image: cerc/watcher-ts:local
|
||||
restart: always
|
||||
working_dir: /app/packages/cli
|
||||
environment:
|
||||
ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT:-https://mainnet.infura.io/v3}
|
||||
ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
|
||||
FIL_RPC_ENDPOINT: ${CERC_FIL_RPC_ENDPOINT}
|
||||
ETH_RPC_API_KEY: ${CERC_INFURA_KEY}
|
||||
command: ["sh", "-c", "yarn export-metrics:chain-heads"]
|
||||
ports:
|
||||
- '5000'
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
filecoin-chain-head-exporter:
|
||||
image: cerc/watcher-ts:local
|
||||
restart: always
|
||||
working_dir: /app/packages/cli
|
||||
environment:
|
||||
ETH_RPC_ENDPOINT: ${CERC_FIL_RPC_ENDPOINT:-https://api.node.glif.io/rpc/v1}
|
||||
command: ["sh", "-c", "yarn export-metrics:chain-heads"]
|
||||
ports:
|
||||
- '5000'
|
||||
extra_hosts:
|
||||
- "host.docker.internal:host-gateway"
|
||||
|
||||
graph-node-upstream-head-exporter:
|
||||
image: cerc/watcher-ts:local
|
||||
restart: always
|
||||
working_dir: /app/packages/cli
|
||||
environment:
|
||||
ETH_RPC_ENDPOINT: ${GRAPH_NODE_RPC_ENDPOINT}
|
||||
PORT: ${CERC_METRICS_PORT}
|
||||
command: ["sh", "-c", "yarn export-metrics:chain-heads"]
|
||||
ports:
|
||||
- '5000'
|
||||
|
||||
@ -0,0 +1,13 @@
|
||||
services:
|
||||
snowballtools-base-backend:
|
||||
image: cerc/snowballtools-base-backend:local
|
||||
restart: always
|
||||
volumes:
|
||||
- data:/data
|
||||
- config:/config:ro
|
||||
ports:
|
||||
- 8000
|
||||
|
||||
volumes:
|
||||
data:
|
||||
config:
|
||||
@ -29,7 +29,7 @@ services:
|
||||
image: cerc/watcher-ajna:local
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
|
||||
command: ["bash", "./start-job-runner.sh"]
|
||||
volumes:
|
||||
- ../config/watcher-ajna/watcher-config-template.toml:/app/environments/watcher-config-template.toml
|
||||
@ -37,7 +37,7 @@ services:
|
||||
ports:
|
||||
- "9000"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"]
|
||||
test: ["CMD", "nc", "-v", "localhost", "9000"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -55,17 +55,16 @@ services:
|
||||
image: cerc/watcher-ajna:local
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
|
||||
command: ["bash", "./start-server.sh"]
|
||||
volumes:
|
||||
- ../config/watcher-ajna/watcher-config-template.toml:/app/environments/watcher-config-template.toml
|
||||
- ../config/watcher-ajna/start-server.sh:/app/start-server.sh
|
||||
- ajna_watcher_gql_logs_data:/app/gql-logs
|
||||
ports:
|
||||
- "3008"
|
||||
- "9001"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3008"]
|
||||
test: ["CMD", "nc", "-v", "localhost", "3008"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -75,4 +74,3 @@ services:
|
||||
|
||||
volumes:
|
||||
ajna_watcher_db_data:
|
||||
ajna_watcher_gql_logs_data:
|
||||
|
||||
@ -32,8 +32,8 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
CERC_HISTORICAL_BLOCK_RANGE: 500
|
||||
CONTRACT_ADDRESS: 0x223c067F8CF28ae173EE5CafEa60cA44C335fecB
|
||||
CONTRACT_NAME: Azimuth
|
||||
@ -47,7 +47,7 @@ services:
|
||||
ports:
|
||||
- "9000"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "9000"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -66,20 +66,18 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
working_dir: /app/packages/azimuth-watcher
|
||||
command: "./start-server.sh"
|
||||
volumes:
|
||||
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/azimuth-watcher/environments/watcher-config-template.toml
|
||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/azimuth-watcher/merge-toml.js
|
||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/azimuth-watcher/start-server.sh
|
||||
- azimuth_watcher_gql_logs_data:/app/packages/azimuth-watcher/gql-logs
|
||||
ports:
|
||||
- "3001"
|
||||
- "9001"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3001"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3001"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -96,8 +94,8 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
CONTRACT_ADDRESS: 0x325f68d32BdEe6Ed86E7235ff2480e2A433D6189
|
||||
CONTRACT_NAME: Censures
|
||||
STARTING_BLOCK: 6784954
|
||||
@ -110,7 +108,7 @@ services:
|
||||
ports:
|
||||
- "9002"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9002"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "9002"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -129,20 +127,18 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
working_dir: /app/packages/censures-watcher
|
||||
command: "./start-server.sh"
|
||||
volumes:
|
||||
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/censures-watcher/environments/watcher-config-template.toml
|
||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/censures-watcher/merge-toml.js
|
||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/censures-watcher/start-server.sh
|
||||
- censures_watcher_gql_logs_data:/app/packages/censures-watcher/gql-logs
|
||||
ports:
|
||||
- "3002"
|
||||
- "9003"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3002"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3002"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -159,8 +155,8 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
CONTRACT_ADDRESS: 0xe7e7f69b34D7d9Bd8d61Fb22C33b22708947971A
|
||||
CONTRACT_NAME: Claims
|
||||
STARTING_BLOCK: 6784941
|
||||
@ -173,7 +169,7 @@ services:
|
||||
ports:
|
||||
- "9004"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9004"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "9004"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -192,20 +188,18 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
working_dir: /app/packages/claims-watcher
|
||||
command: "./start-server.sh"
|
||||
volumes:
|
||||
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/claims-watcher/environments/watcher-config-template.toml
|
||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/claims-watcher/merge-toml.js
|
||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/claims-watcher/start-server.sh
|
||||
- claims_watcher_gql_logs_data:/app/packages/claims-watcher/gql-logs
|
||||
ports:
|
||||
- "3003"
|
||||
- "9005"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3003"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3003"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -222,8 +216,8 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
CONTRACT_ADDRESS: 0x8C241098C3D3498Fe1261421633FD57986D74AeA
|
||||
CONTRACT_NAME: ConditionalStarRelease
|
||||
STARTING_BLOCK: 6828004
|
||||
@ -236,7 +230,7 @@ services:
|
||||
ports:
|
||||
- "9006"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9006"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "9006"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -255,20 +249,18 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
working_dir: /app/packages/conditional-star-release-watcher
|
||||
command: "./start-server.sh"
|
||||
volumes:
|
||||
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/conditional-star-release-watcher/environments/watcher-config-template.toml
|
||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/conditional-star-release-watcher/merge-toml.js
|
||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/conditional-star-release-watcher/start-server.sh
|
||||
- conditional_star_release_watcher_gql_logs_data:/app/packages/conditional-star-release-watcher/gql-logs
|
||||
ports:
|
||||
- "3004"
|
||||
- "9007"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3004"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3004"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -285,8 +277,8 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
CONTRACT_ADDRESS: 0xf6b461fE1aD4bd2ce25B23Fe0aff2ac19B3dFA76
|
||||
CONTRACT_NAME: DelegatedSending
|
||||
STARTING_BLOCK: 6784956
|
||||
@ -299,7 +291,7 @@ services:
|
||||
ports:
|
||||
- "9008"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9008"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "9008"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -318,20 +310,18 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
working_dir: /app/packages/delegated-sending-watcher
|
||||
command: "./start-server.sh"
|
||||
volumes:
|
||||
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/delegated-sending-watcher/environments/watcher-config-template.toml
|
||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/delegated-sending-watcher/merge-toml.js
|
||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/delegated-sending-watcher/start-server.sh
|
||||
- delegated_sending_watcher_gql_logs_data:/app/packages/delegated-sending-watcher/gql-logs
|
||||
ports:
|
||||
- "3005"
|
||||
- "9009"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3005"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3005"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -348,8 +338,8 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
CONTRACT_ADDRESS: 0x33EeCbf908478C10614626A9D304bfe18B78DD73
|
||||
CONTRACT_NAME: Ecliptic
|
||||
STARTING_BLOCK: 13692129
|
||||
@ -362,7 +352,7 @@ services:
|
||||
ports:
|
||||
- "9010"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9010"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "9010"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -381,20 +371,18 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
working_dir: /app/packages/ecliptic-watcher
|
||||
command: "./start-server.sh"
|
||||
volumes:
|
||||
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/ecliptic-watcher/environments/watcher-config-template.toml
|
||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/ecliptic-watcher/merge-toml.js
|
||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/ecliptic-watcher/start-server.sh
|
||||
- ecliptic_watcher_gql_logs_data:/app/packages/ecliptic-watcher/gql-logs
|
||||
ports:
|
||||
- "3006"
|
||||
- "9011"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3006"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3006"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -411,8 +399,8 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
CONTRACT_ADDRESS: 0x86cd9cd0992F04231751E3761De45cEceA5d1801
|
||||
CONTRACT_NAME: LinearStarRelease
|
||||
STARTING_BLOCK: 6784943
|
||||
@ -425,7 +413,7 @@ services:
|
||||
ports:
|
||||
- "9012"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9012"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "9012"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -444,20 +432,18 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
working_dir: /app/packages/linear-star-release-watcher
|
||||
command: "./start-server.sh"
|
||||
volumes:
|
||||
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/linear-star-release-watcher/environments/watcher-config-template.toml
|
||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/linear-star-release-watcher/merge-toml.js
|
||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/linear-star-release-watcher/start-server.sh
|
||||
- linear_star_release_watcher_gql_logs_data:/app/packages/linear-star-release-watcher/gql-logs
|
||||
ports:
|
||||
- "3007"
|
||||
- "9013"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3007"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3007"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -474,8 +460,8 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
CONTRACT_ADDRESS: 0x7fEcaB617c868Bb5996d99D95200D2Fa708218e4
|
||||
CONTRACT_NAME: Polls
|
||||
STARTING_BLOCK: 6784912
|
||||
@ -488,7 +474,7 @@ services:
|
||||
ports:
|
||||
- "9014"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9014"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "9014"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -507,20 +493,18 @@ services:
|
||||
condition: service_healthy
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_IPLD_ETH_GQL_ENDPOINT: ${CERC_IPLD_ETH_GQL_ENDPOINT}
|
||||
CERC_IPLD_ETH_RPC: ${CERC_IPLD_ETH_RPC}
|
||||
CERC_IPLD_ETH_GQL: ${CERC_IPLD_ETH_GQL}
|
||||
working_dir: /app/packages/polls-watcher
|
||||
command: "./start-server.sh"
|
||||
volumes:
|
||||
- ../config/watcher-azimuth/watcher-config-template.toml:/app/packages/polls-watcher/environments/watcher-config-template.toml
|
||||
- ../config/watcher-azimuth/merge-toml.js:/app/packages/polls-watcher/merge-toml.js
|
||||
- ../config/watcher-azimuth/start-server.sh:/app/packages/polls-watcher/start-server.sh
|
||||
- polls_watcher_gql_logs_data:/app/packages/polls-watcher/gql-logs
|
||||
ports:
|
||||
- "3008"
|
||||
- "9015"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3008"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "3008"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -558,7 +542,7 @@ services:
|
||||
ports:
|
||||
- "0.0.0.0:4000:4000"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "4000"]
|
||||
test: ["CMD", "nc", "-vz", "localhost", "4000"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -568,11 +552,3 @@ services:
|
||||
|
||||
volumes:
|
||||
watcher_db_data:
|
||||
azimuth_watcher_gql_logs_data:
|
||||
censures_watcher_gql_logs_data:
|
||||
claims_watcher_gql_logs_data:
|
||||
conditional_star_release_watcher_gql_logs_data:
|
||||
delegated_sending_watcher_gql_logs_data:
|
||||
ecliptic_watcher_gql_logs_data:
|
||||
linear_star_release_watcher_gql_logs_data:
|
||||
polls_watcher_gql_logs_data:
|
||||
|
||||
@ -29,7 +29,7 @@ services:
|
||||
image: cerc/watcher-merkl-sushiswap-v3:local
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
|
||||
command: ["bash", "./start-job-runner.sh"]
|
||||
volumes:
|
||||
- ../config/watcher-merkl-sushiswap-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml
|
||||
@ -37,7 +37,7 @@ services:
|
||||
ports:
|
||||
- "9002:9000"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"]
|
||||
test: ["CMD", "nc", "-v", "localhost", "9000"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -55,17 +55,16 @@ services:
|
||||
image: cerc/watcher-merkl-sushiswap-v3:local
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
|
||||
command: ["bash", "./start-server.sh"]
|
||||
volumes:
|
||||
- ../config/watcher-merkl-sushiswap-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml
|
||||
- ../config/watcher-merkl-sushiswap-v3/start-server.sh:/app/start-server.sh
|
||||
- merkl_sushiswap_v3_watcher_gql_logs_data:/app/gql-logs
|
||||
ports:
|
||||
- "127.0.0.1:3007:3008"
|
||||
- "9003:9001"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3008"]
|
||||
test: ["CMD", "nc", "-v", "localhost", "3008"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -75,4 +74,3 @@ services:
|
||||
|
||||
volumes:
|
||||
merkl_sushiswap_v3_watcher_db_data:
|
||||
merkl_sushiswap_v3_watcher_gql_logs_data:
|
||||
|
||||
@ -29,7 +29,7 @@ services:
|
||||
image: cerc/watcher-sushiswap-v3:local
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
|
||||
command: ["bash", "./start-job-runner.sh"]
|
||||
volumes:
|
||||
- ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml
|
||||
@ -37,7 +37,7 @@ services:
|
||||
ports:
|
||||
- "9000:9000"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "9000"]
|
||||
test: ["CMD", "nc", "-v", "localhost", "9000"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -55,17 +55,16 @@ services:
|
||||
image: cerc/watcher-sushiswap-v3:local
|
||||
environment:
|
||||
CERC_SCRIPT_DEBUG: ${CERC_SCRIPT_DEBUG}
|
||||
CERC_ETH_RPC_ENDPOINTS: ${CERC_ETH_RPC_ENDPOINTS}
|
||||
CERC_ETH_RPC_ENDPOINT: ${CERC_ETH_RPC_ENDPOINT}
|
||||
command: ["bash", "./start-server.sh"]
|
||||
volumes:
|
||||
- ../config/watcher-sushiswap-v3/watcher-config-template.toml:/app/environments/watcher-config-template.toml
|
||||
- ../config/watcher-sushiswap-v3/start-server.sh:/app/start-server.sh
|
||||
- sushiswap_v3_watcher_gql_logs_data:/app/gql-logs
|
||||
ports:
|
||||
- "127.0.0.1:3008:3008"
|
||||
- "9001:9001"
|
||||
healthcheck:
|
||||
test: ["CMD", "nc", "-vz", "127.0.0.1", "3008"]
|
||||
test: ["CMD", "nc", "-v", "localhost", "3008"]
|
||||
interval: 20s
|
||||
timeout: 5s
|
||||
retries: 15
|
||||
@ -75,4 +74,3 @@ services:
|
||||
|
||||
volumes:
|
||||
sushiswap_v3_watcher_db_data:
|
||||
sushiswap_v3_watcher_gql_logs_data:
|
||||
|
||||
@ -23,6 +23,3 @@ CERC_STATEDIFF_WORKERS=2
|
||||
|
||||
CERC_GETH_VMODULE="statediff/*=5,rpc/*=5"
|
||||
CERC_GETH_VERBOSITY=${CERC_GETH_VERBOSITY:-3}
|
||||
|
||||
# Used by Lighthouse
|
||||
SECONDS_PER_ETH1_BLOCK=${SECONDS_PER_ETH1_BLOCK:-3}
|
||||
|
||||
@ -8,68 +8,68 @@ KEY="mykey"
|
||||
CHAINID="laconic_9000-1"
|
||||
MONIKER="localtestnet"
|
||||
KEYRING="test"
|
||||
KEYALGO="secp256k1"
|
||||
LOGLEVEL="${LOGLEVEL:-info}"
|
||||
DENOM="alnt"
|
||||
|
||||
KEYALGO="eth_secp256k1"
|
||||
LOGLEVEL="info"
|
||||
# trace evm
|
||||
TRACE="--trace"
|
||||
# TRACE=""
|
||||
|
||||
if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
||||
# validate dependencies are installed
|
||||
command -v jq > /dev/null 2>&1 || {
|
||||
echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"
|
||||
exit 1
|
||||
}
|
||||
command -v jq > /dev/null 2>&1 || { echo >&2 "jq not installed. More info: https://stedolan.github.io/jq/download/"; exit 1; }
|
||||
|
||||
# remove existing daemon and client
|
||||
rm -rf $HOME/.laconicd/*
|
||||
rm -rf $HOME/.laconic/*
|
||||
|
||||
if [ -n "`which make`" ]; then
|
||||
make install
|
||||
fi
|
||||
|
||||
laconicd config set client chain-id $CHAINID
|
||||
laconicd config set client keyring-backend $KEYRING
|
||||
laconicd config keyring-backend $KEYRING
|
||||
laconicd config chain-id $CHAINID
|
||||
|
||||
# if $KEY exists it should be deleted
|
||||
laconicd keys add $KEY --keyring-backend $KEYRING --algo $KEYALGO
|
||||
|
||||
# Set moniker and chain-id for Ethermint (Moniker can be anything, chain-id must be an integer)
|
||||
laconicd init $MONIKER --chain-id $CHAINID --default-denom $DENOM
|
||||
laconicd init $MONIKER --chain-id $CHAINID
|
||||
|
||||
update_genesis() {
|
||||
jq "$1" $HOME/.laconicd/config/genesis.json > $HOME/.laconicd/config/tmp_genesis.json &&
|
||||
mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
}
|
||||
# Change parameter token denominations to aphoton
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["staking"]["params"]["bond_denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["crisis"]["constant_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["gov"]["deposit_params"]["min_deposit"][0]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["mint"]["params"]["mint_denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
# Custom modules
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["record_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_commit_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_reveal_fee"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_minimum_bid"]["denom"]="aphoton"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
|
||||
if [[ "$TEST_REGISTRY_EXPIRY" == "true" ]]; then
|
||||
echo "Setting timers for expiry tests."
|
||||
|
||||
update_genesis '.app_state["registry"]["params"]["record_rent_duration"]="60s"'
|
||||
update_genesis '.app_state["registry"]["params"]["authority_grace_period"]="60s"'
|
||||
update_genesis '.app_state["registry"]["params"]["authority_rent_duration"]="60s"'
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["record_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_grace_period"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
fi
|
||||
|
||||
if [[ "$TEST_AUCTION_ENABLED" == "true" ]]; then
|
||||
echo "Enabling auction and setting timers."
|
||||
|
||||
update_genesis '.app_state["registry"]["params"]["authority_auction_enabled"]=true'
|
||||
update_genesis '.app_state["registry"]["params"]["authority_rent_duration"]="60s"'
|
||||
update_genesis '.app_state["registry"]["params"]["authority_grace_period"]="300s"'
|
||||
update_genesis '.app_state["registry"]["params"]["authority_auction_commits_duration"]="60s"'
|
||||
update_genesis '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"'
|
||||
fi
|
||||
|
||||
if [[ "$ONBOARDING_ENABLED" == "true" ]]; then
|
||||
echo "Enabling validator onboarding."
|
||||
|
||||
update_genesis '.app_state["onboarding"]["params"]["onboarding_enabled"]=true'
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_enabled"]=true' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_rent_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_grace_period"]="300s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_commits_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.app_state["registry"]["params"]["authority_auction_reveals_duration"]="60s"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
fi
|
||||
|
||||
# increase block time (?)
|
||||
update_genesis '.consensus["params"]["block"]["time_iota_ms"]="1000"'
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.consensus_params["block"]["time_iota_ms"]="1000"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
|
||||
# Set gas limit in genesis
|
||||
update_genesis '.consensus["params"]["block"]["max_gas"]="10000000"'
|
||||
cat $HOME/.laconicd/config/genesis.json | jq '.consensus_params["block"]["max_gas"]="10000000"' > $HOME/.laconicd/config/tmp_genesis.json && mv $HOME/.laconicd/config/tmp_genesis.json $HOME/.laconicd/config/genesis.json
|
||||
|
||||
# disable produce empty block
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
@ -78,39 +78,48 @@ if [ "$1" == "clean" ] || [ ! -d "$HOME/.laconicd/data/blockstore.db" ]; then
|
||||
sed -i 's/create_empty_blocks = true/create_empty_blocks = false/g' $HOME/.laconicd/config/config.toml
|
||||
fi
|
||||
|
||||
# Enable telemetry (prometheus metrics: http://localhost:1317/metrics?format=prometheus)
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
sed -i '' 's/enabled = false/enabled = true/g' $HOME/.laconicd/config/app.toml
|
||||
sed -i '' 's/prometheus-retention-time = 0/prometheus-retention-time = 60/g' $HOME/.laconicd/config/app.toml
|
||||
sed -i '' 's/prometheus = false/prometheus = true/g' $HOME/.laconicd/config/config.toml
|
||||
else
|
||||
sed -i 's/enabled = false/enabled = true/g' $HOME/.laconicd/config/app.toml
|
||||
sed -i 's/prometheus-retention-time = 0/prometheus-retention-time = 60/g' $HOME/.laconicd/config/app.toml
|
||||
sed -i 's/prometheus = false/prometheus = true/g' $HOME/.laconicd/config/config.toml
|
||||
if [[ $1 == "pending" ]]; then
|
||||
if [[ "$OSTYPE" == "darwin"* ]]; then
|
||||
sed -i '' 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i '' 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i '' 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i '' 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i '' 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i '' 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i '' 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i '' 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i '' 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
||||
else
|
||||
sed -i 's/create_empty_blocks_interval = "0s"/create_empty_blocks_interval = "30s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i 's/timeout_propose = "3s"/timeout_propose = "30s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i 's/timeout_propose_delta = "500ms"/timeout_propose_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i 's/timeout_prevote = "1s"/timeout_prevote = "10s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i 's/timeout_prevote_delta = "500ms"/timeout_prevote_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i 's/timeout_precommit = "1s"/timeout_precommit = "10s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i 's/timeout_precommit_delta = "500ms"/timeout_precommit_delta = "5s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i 's/timeout_commit = "5s"/timeout_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
||||
sed -i 's/timeout_broadcast_tx_commit = "10s"/timeout_broadcast_tx_commit = "150s"/g' $HOME/.laconicd/config/config.toml
|
||||
fi
|
||||
fi
|
||||
|
||||
# Allocate genesis accounts (cosmos formatted addresses)
|
||||
# 10^30 alnt | 10^12 lnt
|
||||
laconicd genesis add-genesis-account $KEY 1000000000000000000000000000000$DENOM --keyring-backend $KEYRING
|
||||
laconicd add-genesis-account $KEY 100000000000000000000000000aphoton --keyring-backend $KEYRING
|
||||
|
||||
# Sign genesis transaction
|
||||
# 10^24 alnt | 10^6 lnt
|
||||
laconicd genesis gentx $KEY 1000000000000000000000000$DENOM --keyring-backend $KEYRING --chain-id $CHAINID
|
||||
laconicd gentx $KEY 1000000000000000000000aphoton --keyring-backend $KEYRING --chain-id $CHAINID
|
||||
|
||||
# Collect genesis tx
|
||||
laconicd genesis collect-gentxs
|
||||
laconicd collect-gentxs
|
||||
|
||||
# Run this to ensure everything worked and that the genesis file is setup correctly
|
||||
laconicd genesis validate
|
||||
laconicd validate-genesis
|
||||
|
||||
if [[ $1 == "pending" ]]; then
|
||||
echo "pending mode is on, please wait for the first block committed."
|
||||
fi
|
||||
else
|
||||
echo "Using existing database at $HOME/.laconicd. To replace, run '`basename $0` clean'"
|
||||
fi
|
||||
|
||||
# Start the node (remove the --pruning=nothing flag if historical queries are not needed)
|
||||
laconicd start \
|
||||
--pruning=nothing \
|
||||
--log_level $LOGLEVEL \
|
||||
--minimum-gas-prices=1$DENOM \
|
||||
--api.enable \
|
||||
--rpc.laddr="tcp://0.0.0.0:26657" \
|
||||
--gql-server --gql-playground
|
||||
laconicd start --pruning=nothing --evm.tracer=json $TRACE --log_level $LOGLEVEL --minimum-gas-prices=0.0001aphoton --json-rpc.api eth,txpool,personal,net,debug,web3,miner --api.enable --gql-server --gql-playground
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
services:
|
||||
registry:
|
||||
rpcEndpoint: 'http://laconicd:26657'
|
||||
cns:
|
||||
restEndpoint: 'http://laconicd:1317'
|
||||
gqlEndpoint: 'http://laconicd:9473/api'
|
||||
userKey: REPLACE_WITH_MYKEY
|
||||
bondId:
|
||||
chainId: laconic_9000-1
|
||||
gas: 350000
|
||||
fees: 2000000alnt
|
||||
fees: 200000aphoton
|
||||
|
||||
@ -1,9 +1,9 @@
|
||||
services:
|
||||
registry:
|
||||
rpcEndpoint: 'http://laconicd:26657'
|
||||
cns:
|
||||
restEndpoint: 'http://laconicd:1317'
|
||||
gqlEndpoint: 'http://laconicd:9473/api'
|
||||
userKey: REPLACE_WITH_MYKEY
|
||||
bondId:
|
||||
chainId: laconic_9000-1
|
||||
gas: 250000
|
||||
fees: 2000000alnt
|
||||
fees: 200000aphoton
|
||||
|
||||
@ -1,15 +1,18 @@
|
||||
#!/bin/sh
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
#TODO: pass these in from the caller
|
||||
TRACE="--trace"
|
||||
LOGLEVEL="info"
|
||||
|
||||
laconicd start \
|
||||
--pruning=nothing \
|
||||
--evm.tracer=json $TRACE \
|
||||
--log_level $LOGLEVEL \
|
||||
--minimum-gas-prices=1alnt \
|
||||
--minimum-gas-prices=0.0001aphoton \
|
||||
--json-rpc.api eth,txpool,personal,net,debug,web3,miner \
|
||||
--api.enable \
|
||||
--gql-server \
|
||||
--gql-playground
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@ -1,20 +0,0 @@
|
||||
apiVersion: 1
|
||||
|
||||
datasources:
|
||||
- name: Graph Node Postgres
|
||||
type: postgres
|
||||
jsonData:
|
||||
database: graph-node
|
||||
sslmode: 'disable'
|
||||
maxOpenConns: 100
|
||||
maxIdleConns: 100
|
||||
maxIdleConnsAuto: true
|
||||
connMaxLifetime: 14400
|
||||
postgresVersion: 1411 # 903=9.3, 1000=10, 1411=14.11
|
||||
timescaledb: false
|
||||
user: graph-node
|
||||
# # Add URL for graph-node database
|
||||
# url: graph-node-db:5432
|
||||
# # Set password for graph-node database
|
||||
# secureJsonData:
|
||||
# password: 'password'
|
||||
@ -45,18 +45,7 @@ scrape_configs:
|
||||
metrics_path: /metrics
|
||||
scheme: http
|
||||
static_configs:
|
||||
- targets: ['ethereum-chain-head-exporter:5000']
|
||||
labels:
|
||||
instance: 'external'
|
||||
chain: 'ethereum'
|
||||
- targets: ['filecoin-chain-head-exporter:5000']
|
||||
labels:
|
||||
instance: 'external'
|
||||
chain: 'filecoin'
|
||||
- targets: ['graph-node-upstream-head-exporter:5000']
|
||||
labels:
|
||||
instance: 'graph-node'
|
||||
chain: 'filecoin'
|
||||
- targets: ['chain-head-exporter:5000']
|
||||
|
||||
- job_name: 'postgres'
|
||||
scrape_interval: 30s
|
||||
@ -76,20 +65,3 @@ scrape_configs:
|
||||
target_label: instance
|
||||
- target_label: __address__
|
||||
replacement: postgres-exporter:9187
|
||||
|
||||
- job_name: laconicd
|
||||
metrics_path: /metrics
|
||||
scrape_interval: 30s
|
||||
static_configs:
|
||||
# Add laconicd REST endpoint target with host and port (1317)
|
||||
# - targets: ['example-host:1317']
|
||||
params:
|
||||
format: ['prometheus']
|
||||
|
||||
- job_name: graph-node
|
||||
metrics_path: /metrics
|
||||
scrape_interval: 30s
|
||||
scheme: http
|
||||
static_configs:
|
||||
# Add graph-node targets to be monitored below
|
||||
# - targets: ['graph-node:8040']
|
||||
|
||||
@ -1,64 +0,0 @@
|
||||
apiVersion: 1
|
||||
groups:
|
||||
- orgId: 1
|
||||
name: subgraph
|
||||
folder: SubgraphAlerts
|
||||
interval: 30s
|
||||
rules:
|
||||
- uid: b2a9144b-6104-46fc-92b5-352f4e643c4c
|
||||
title: subgraph_head_tracking
|
||||
condition: condition
|
||||
data:
|
||||
- refId: diff
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: PBFA97CFB590B2093
|
||||
model:
|
||||
datasource:
|
||||
type: prometheus
|
||||
uid: PBFA97CFB590B2093
|
||||
editorMode: code
|
||||
expr: ethereum_chain_head_number - on(network) group_right deployment_head{deployment=~"REPLACE_WITH_SUBGRAPH_IDS"}
|
||||
instant: true
|
||||
intervalMs: 1000
|
||||
legendFormat: __auto
|
||||
maxDataPoints: 43200
|
||||
range: false
|
||||
refId: diff
|
||||
- refId: condition
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: __expr__
|
||||
model:
|
||||
conditions:
|
||||
- evaluator:
|
||||
params:
|
||||
- 15
|
||||
- 0
|
||||
type: gt
|
||||
operator:
|
||||
type: and
|
||||
query:
|
||||
params: []
|
||||
reducer:
|
||||
params: []
|
||||
type: avg
|
||||
type: query
|
||||
datasource:
|
||||
name: Expression
|
||||
type: __expr__
|
||||
uid: __expr__
|
||||
expression: diff
|
||||
intervalMs: 1000
|
||||
maxDataPoints: 43200
|
||||
refId: condition
|
||||
type: threshold
|
||||
noDataState: OK
|
||||
execErrState: Alerting
|
||||
for: 5m
|
||||
annotations:
|
||||
summary: Subgraph deployment {{ index $labels "deployment" }} is falling behind head by {{ index $values "diff" }}
|
||||
labels: {}
|
||||
isPaused: false
|
||||
@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo Using CERC_GRAFANA_ALERTS_SUBGRAPH_IDS ${CERC_GRAFANA_ALERTS_SUBGRAPH_IDS}
|
||||
|
||||
# Replace subgraph ids in subgraph alerting config
|
||||
# Note: Requires the grafana container to be run with user root
|
||||
if [ -n "$CERC_GRAFANA_ALERTS_SUBGRAPH_IDS" ]; then
|
||||
sed -i "s/REPLACE_WITH_SUBGRAPH_IDS/$CERC_GRAFANA_ALERTS_SUBGRAPH_IDS/g" /etc/grafana/provisioning/alerting/subgraph-alert-rules.yml
|
||||
fi
|
||||
@ -24,7 +24,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="azimuth", instance="azimuth", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="azimuth", instance="azimuth", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -100,7 +100,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="azimuth", instance="censures", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="azimuth", instance="censures", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -176,7 +176,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="azimuth", instance="claims", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="azimuth", instance="claims", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -252,7 +252,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="azimuth", instance="conditional_star_release", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="azimuth", instance="conditional_star_release", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -328,7 +328,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="azimuth", instance="delegated_sending", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="azimuth", instance="delegated_sending", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -404,7 +404,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="azimuth", instance="ecliptic", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="azimuth", instance="ecliptic", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -480,7 +480,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="azimuth", instance="linear_star_release", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="azimuth", instance="linear_star_release", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -556,7 +556,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="azimuth", instance="polls", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="azimuth", instance="polls", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -634,7 +634,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="sushi", instance="sushiswap", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="sushi", instance="sushiswap", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
@ -710,163 +710,7 @@ groups:
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="sushi", instance="merkl_sushiswap", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
intervalMs: 1000
|
||||
legendFormat: __auto
|
||||
maxDataPoints: 43200
|
||||
range: false
|
||||
refId: diff
|
||||
useBackend: false
|
||||
- refId: latest_external
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: PBFA97CFB590B2093
|
||||
model:
|
||||
datasource:
|
||||
type: prometheus
|
||||
uid: PBFA97CFB590B2093
|
||||
editorMode: code
|
||||
expr: latest_block_number{chain="filecoin"}
|
||||
hide: false
|
||||
instant: true
|
||||
legendFormat: __auto
|
||||
range: false
|
||||
refId: latest_external
|
||||
- refId: condition
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: __expr__
|
||||
model:
|
||||
conditions:
|
||||
- evaluator:
|
||||
params:
|
||||
- 0
|
||||
- 0
|
||||
type: gt
|
||||
operator:
|
||||
type: and
|
||||
query:
|
||||
params: []
|
||||
reducer:
|
||||
params: []
|
||||
type: avg
|
||||
type: query
|
||||
datasource:
|
||||
name: Expression
|
||||
type: __expr__
|
||||
uid: __expr__
|
||||
expression: ${diff} >= 16
|
||||
intervalMs: 1000
|
||||
maxDataPoints: 43200
|
||||
refId: condition
|
||||
type: math
|
||||
noDataState: Alerting
|
||||
execErrState: Alerting
|
||||
for: 15m
|
||||
annotations:
|
||||
summary: Watcher {{ index $labels "instance" }} of group {{ index $labels "job" }} is falling behind external head by {{ index $values "diff" }}
|
||||
isPaused: false
|
||||
|
||||
# Ajna
|
||||
- uid: ajna_diff_external
|
||||
title: ajna_watcher_head_tracking
|
||||
condition: condition
|
||||
data:
|
||||
- refId: diff
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: PBFA97CFB590B2093
|
||||
model:
|
||||
datasource:
|
||||
type: prometheus
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="ajna", instance="ajna", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
intervalMs: 1000
|
||||
legendFormat: __auto
|
||||
maxDataPoints: 43200
|
||||
range: false
|
||||
refId: diff
|
||||
useBackend: false
|
||||
- refId: latest_external
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: PBFA97CFB590B2093
|
||||
model:
|
||||
datasource:
|
||||
type: prometheus
|
||||
uid: PBFA97CFB590B2093
|
||||
editorMode: code
|
||||
expr: latest_block_number{chain="filecoin"}
|
||||
hide: false
|
||||
instant: true
|
||||
legendFormat: __auto
|
||||
range: false
|
||||
refId: latest_external
|
||||
- refId: condition
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: __expr__
|
||||
model:
|
||||
conditions:
|
||||
- evaluator:
|
||||
params:
|
||||
- 0
|
||||
- 0
|
||||
type: gt
|
||||
operator:
|
||||
type: and
|
||||
query:
|
||||
params: []
|
||||
reducer:
|
||||
params: []
|
||||
type: avg
|
||||
type: query
|
||||
datasource:
|
||||
name: Expression
|
||||
type: __expr__
|
||||
uid: __expr__
|
||||
expression: ${diff} >= 16
|
||||
intervalMs: 1000
|
||||
maxDataPoints: 43200
|
||||
refId: condition
|
||||
type: math
|
||||
noDataState: Alerting
|
||||
execErrState: Alerting
|
||||
for: 15m
|
||||
annotations:
|
||||
summary: Watcher {{ index $labels "instance" }} of group {{ index $labels "job" }} is falling behind external head by {{ index $values "diff" }}
|
||||
isPaused: false
|
||||
|
||||
# Secured Finance
|
||||
- uid: secured_finance_diff_external
|
||||
title: secured_finance_watcher_head_tracking
|
||||
condition: condition
|
||||
data:
|
||||
- refId: diff
|
||||
relativeTimeRange:
|
||||
from: 600
|
||||
to: 0
|
||||
datasourceUid: PBFA97CFB590B2093
|
||||
model:
|
||||
datasource:
|
||||
type: prometheus
|
||||
uid: PBFA97CFB590B2093
|
||||
disableTextWrap: false
|
||||
editorMode: code
|
||||
expr: latest_block_number{instance="external"} - on(chain) group_right sync_status_block_number{job="secured-finance", instance="secured-finance", kind="latest_indexed"}
|
||||
expr: latest_block_number - on(chain) group_right sync_status_block_number{job="sushi", instance="merkl_sushiswap", kind="latest_indexed"}
|
||||
fullMetaSearch: false
|
||||
includeNullMetadata: true
|
||||
instant: true
|
||||
|
||||
@ -6,16 +6,12 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
fi
|
||||
set -u
|
||||
|
||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
||||
echo "Using ETH RPC endpoint ${CERC_ETH_RPC_ENDPOINT}"
|
||||
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
|
||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
||||
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ")
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINT|${CERC_ETH_RPC_ENDPOINT}| ")
|
||||
|
||||
# Write the modified content to a new file
|
||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
||||
|
||||
@ -6,16 +6,12 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
fi
|
||||
set -u
|
||||
|
||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
||||
echo "Using ETH RPC endpoint ${CERC_ETH_RPC_ENDPOINT}"
|
||||
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
|
||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
||||
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ")
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINT|${CERC_ETH_RPC_ENDPOINT}| ")
|
||||
|
||||
# Write the modified content to a new file
|
||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
host = "0.0.0.0"
|
||||
port = 3008
|
||||
kind = "active"
|
||||
gqlPath = "/"
|
||||
|
||||
# Checkpointing state.
|
||||
checkpointing = true
|
||||
@ -21,30 +22,23 @@
|
||||
# Interval in number of blocks at which to clear entities cache.
|
||||
clearEntitiesCacheInterval = 1000
|
||||
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
|
||||
# Flag to specify whether RPC endpoint supports block hash as block tag parameter
|
||||
rpcSupportsBlockHashParam = false
|
||||
|
||||
# Server GQL config
|
||||
[server.gql]
|
||||
path = "/"
|
||||
# GQL cache settings
|
||||
[server.gqlCache]
|
||||
enabled = true
|
||||
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
|
||||
# Log directory for GQL requests
|
||||
logDir = "./gql-logs"
|
||||
|
||||
# GQL cache settings
|
||||
[server.gql.cache]
|
||||
enabled = true
|
||||
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
timeTravelMaxAge = 86400 # 1 day
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
timeTravelMaxAge = 86400 # 1 day
|
||||
|
||||
[metrics]
|
||||
host = "0.0.0.0"
|
||||
@ -64,7 +58,7 @@
|
||||
|
||||
[upstream]
|
||||
[upstream.ethServer]
|
||||
rpcProviderEndpoints = REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS
|
||||
rpcProviderEndpoint = "REPLACE_WITH_CERC_ETH_RPC_ENDPOINT"
|
||||
|
||||
# Boolean flag to specify if rpc-eth-client should be used for RPC endpoint instead of ipld-eth-client (ipld-eth-server GQL client)
|
||||
rpcClient = true
|
||||
@ -91,9 +85,6 @@
|
||||
# Filecoin block time: https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocktime
|
||||
blockDelayInMilliSecs = 30000
|
||||
|
||||
# Number of blocks by which block processing lags behind head
|
||||
blockProcessingOffset = 0
|
||||
|
||||
# Boolean to switch between modes of processing events when starting the server.
|
||||
# Setting to true will fetch filtered events and required blocks in a range of blocks and then process them.
|
||||
# Setting to false will fetch blocks consecutively with its events and then process them (Behaviour is followed in realtime processing near head).
|
||||
@ -105,6 +96,3 @@
|
||||
# Max block range of historical processing after which it waits for completion of events processing
|
||||
# If set to -1 historical processing does not wait for events processing and completes till latest canonical block
|
||||
historicalMaxFetchAhead = 10000
|
||||
|
||||
# Max number of retries to fetch new block after which watcher will failover to other RPC endpoints
|
||||
maxNewBlockRetries = 3
|
||||
|
||||
@ -4,19 +4,16 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
||||
echo "Using IPLD GQL endpoint ${CERC_IPLD_ETH_GQL_ENDPOINT}"
|
||||
echo "Using IPLD ETH RPC endpoint ${CERC_IPLD_ETH_RPC}"
|
||||
echo "Using IPLD GQL endpoint ${CERC_IPLD_ETH_GQL}"
|
||||
echo "Using historicalLogsBlockRange ${CERC_HISTORICAL_BLOCK_RANGE:-2000}"
|
||||
|
||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
||||
|
||||
# Replace env variables in template TOML file
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}|g; \
|
||||
s|REPLACE_WITH_CERC_IPLD_ETH_GQL_ENDPOINT|${CERC_IPLD_ETH_GQL_ENDPOINT}|g; \
|
||||
sed -E "s|REPLACE_WITH_CERC_IPLD_ETH_RPC|${CERC_IPLD_ETH_RPC}|g; \
|
||||
s|REPLACE_WITH_CERC_IPLD_ETH_GQL|${CERC_IPLD_ETH_GQL}|g; \
|
||||
s|REPLACE_WITH_CERC_HISTORICAL_BLOCK_RANGE|${CERC_HISTORICAL_BLOCK_RANGE:-2000}| ")
|
||||
|
||||
# Write the modified content to a new file
|
||||
|
||||
@ -4,19 +4,16 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
||||
echo "Using IPLD GQL endpoint ${CERC_IPLD_ETH_GQL_ENDPOINT}"
|
||||
echo "Using IPLD ETH RPC endpoint ${CERC_IPLD_ETH_RPC}"
|
||||
echo "Using IPLD GQL endpoint ${CERC_IPLD_ETH_GQL}"
|
||||
echo "Using historicalLogsBlockRange ${CERC_HISTORICAL_BLOCK_RANGE:-2000}"
|
||||
|
||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
||||
|
||||
# Replace env variables in template TOML file
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}|g; \
|
||||
s|REPLACE_WITH_CERC_IPLD_ETH_GQL_ENDPOINT|${CERC_IPLD_ETH_GQL_ENDPOINT}|g; \
|
||||
sed -E "s|REPLACE_WITH_CERC_IPLD_ETH_RPC|${CERC_IPLD_ETH_RPC}|g; \
|
||||
s|REPLACE_WITH_CERC_IPLD_ETH_GQL|${CERC_IPLD_ETH_GQL}|g; \
|
||||
s|REPLACE_WITH_CERC_HISTORICAL_BLOCK_RANGE|${CERC_HISTORICAL_BLOCK_RANGE:-2000}| ")
|
||||
|
||||
# Write the modified content to a new file
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
[server]
|
||||
host = "0.0.0.0"
|
||||
[server.gql]
|
||||
maxSimultaneousRequests = -1
|
||||
maxSimultaneousRequests = -1
|
||||
|
||||
[metrics]
|
||||
host = "0.0.0.0"
|
||||
@ -14,8 +13,8 @@
|
||||
|
||||
[upstream]
|
||||
[upstream.ethServer]
|
||||
gqlApiEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_GQL_ENDPOINT"
|
||||
rpcProviderEndpoints = REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS
|
||||
gqlApiEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_GQL"
|
||||
rpcProviderEndpoint = "REPLACE_WITH_CERC_IPLD_ETH_RPC"
|
||||
|
||||
[jobQueue]
|
||||
historicalLogsBlockRange = REPLACE_WITH_CERC_HISTORICAL_BLOCK_RANGE
|
||||
|
||||
@ -6,16 +6,12 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
fi
|
||||
set -u
|
||||
|
||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
||||
echo "Using ETH RPC endpoint ${CERC_ETH_RPC_ENDPOINT}"
|
||||
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
|
||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
||||
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ")
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINT|${CERC_ETH_RPC_ENDPOINT}| ")
|
||||
|
||||
# Write the modified content to a new file
|
||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
||||
|
||||
@ -6,16 +6,12 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
fi
|
||||
set -u
|
||||
|
||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
||||
echo "Using ETH RPC endpoint ${CERC_ETH_RPC_ENDPOINT}"
|
||||
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
|
||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
||||
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ")
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINT|${CERC_ETH_RPC_ENDPOINT}| ")
|
||||
|
||||
# Write the modified content to a new file
|
||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
host = "0.0.0.0"
|
||||
port = 3008
|
||||
kind = "active"
|
||||
gqlPath = '/'
|
||||
|
||||
# Checkpointing state.
|
||||
checkpointing = true
|
||||
@ -21,30 +22,23 @@
|
||||
# Interval in number of blocks at which to clear entities cache.
|
||||
clearEntitiesCacheInterval = 1000
|
||||
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
|
||||
# Flag to specify whether RPC endpoint supports block hash as block tag parameter
|
||||
rpcSupportsBlockHashParam = false
|
||||
|
||||
# Server GQL config
|
||||
[server.gql]
|
||||
path = "/"
|
||||
# GQL cache settings
|
||||
[server.gqlCache]
|
||||
enabled = true
|
||||
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
|
||||
# Log directory for GQL requests
|
||||
logDir = "./gql-logs"
|
||||
|
||||
# GQL cache settings
|
||||
[server.gql.cache]
|
||||
enabled = true
|
||||
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
timeTravelMaxAge = 86400 # 1 day
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
timeTravelMaxAge = 86400 # 1 day
|
||||
|
||||
[metrics]
|
||||
host = "0.0.0.0"
|
||||
@ -64,7 +58,7 @@
|
||||
|
||||
[upstream]
|
||||
[upstream.ethServer]
|
||||
rpcProviderEndpoints = REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS
|
||||
rpcProviderEndpoint = "REPLACE_WITH_CERC_ETH_RPC_ENDPOINT"
|
||||
|
||||
# Boolean flag to specify if rpc-eth-client should be used for RPC endpoint instead of ipld-eth-client (ipld-eth-server GQL client)
|
||||
rpcClient = true
|
||||
@ -75,7 +69,7 @@
|
||||
# Boolean flag to filter event logs by contracts
|
||||
filterLogsByAddresses = true
|
||||
# Boolean flag to filter event logs by topics
|
||||
filterLogsByTopics = true
|
||||
filterLogsByTopics = false
|
||||
|
||||
[upstream.cache]
|
||||
name = "requests"
|
||||
@ -91,9 +85,6 @@
|
||||
# Filecoin block time: https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocktime
|
||||
blockDelayInMilliSecs = 30000
|
||||
|
||||
# Number of blocks by which block processing lags behind head
|
||||
blockProcessingOffset = 0
|
||||
|
||||
# Boolean to switch between modes of processing events when starting the server.
|
||||
# Setting to true will fetch filtered events and required blocks in a range of blocks and then process them.
|
||||
# Setting to false will fetch blocks consecutively with its events and then process them (Behaviour is followed in realtime processing near head).
|
||||
@ -105,6 +96,3 @@
|
||||
# Max block range of historical processing after which it waits for completion of events processing
|
||||
# If set to -1 historical processing does not wait for events processing and completes till latest canonical block
|
||||
historicalMaxFetchAhead = 10000
|
||||
|
||||
# Max number of retries to fetch new block after which watcher will failover to other RPC endpoints
|
||||
maxNewBlockRetries = 3
|
||||
|
||||
@ -6,16 +6,12 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
fi
|
||||
set -u
|
||||
|
||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
||||
echo "Using ETH RPC endpoint ${CERC_ETH_RPC_ENDPOINT}"
|
||||
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
|
||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
||||
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ")
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINT|${CERC_ETH_RPC_ENDPOINT}| ")
|
||||
|
||||
# Write the modified content to a new file
|
||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
||||
|
||||
@ -6,16 +6,12 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
fi
|
||||
set -u
|
||||
|
||||
echo "Using ETH RPC endpoints ${CERC_ETH_RPC_ENDPOINTS}"
|
||||
echo "Using ETH RPC endpoint ${CERC_ETH_RPC_ENDPOINT}"
|
||||
|
||||
# Read in the config template TOML file and modify it
|
||||
WATCHER_CONFIG_TEMPLATE=$(cat environments/watcher-config-template.toml)
|
||||
|
||||
# Convert the comma-separated list in CERC_ETH_RPC_ENDPOINTS to a JSON array
|
||||
RPC_ENDPOINTS_ARRAY=$(echo "$CERC_ETH_RPC_ENDPOINTS" | tr ',' '\n' | awk '{print "\"" $0 "\""}' | paste -sd, - | sed 's/^/[/; s/$/]/')
|
||||
|
||||
WATCHER_CONFIG=$(echo "$WATCHER_CONFIG_TEMPLATE" | \
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS|${RPC_ENDPOINTS_ARRAY}| ")
|
||||
sed -E "s|REPLACE_WITH_CERC_ETH_RPC_ENDPOINT|${CERC_ETH_RPC_ENDPOINT}| ")
|
||||
|
||||
# Write the modified content to a new file
|
||||
echo "$WATCHER_CONFIG" > environments/local.toml
|
||||
|
||||
@ -2,6 +2,7 @@
|
||||
host = "0.0.0.0"
|
||||
port = 3008
|
||||
kind = "active"
|
||||
gqlPath = "/"
|
||||
|
||||
# Checkpointing state.
|
||||
checkpointing = true
|
||||
@ -21,30 +22,23 @@
|
||||
# Interval in number of blocks at which to clear entities cache.
|
||||
clearEntitiesCacheInterval = 1000
|
||||
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
|
||||
# Flag to specify whether RPC endpoint supports block hash as block tag parameter
|
||||
rpcSupportsBlockHashParam = false
|
||||
|
||||
# Server GQL config
|
||||
[server.gql]
|
||||
path = "/"
|
||||
# GQL cache settings
|
||||
[server.gqlCache]
|
||||
enabled = true
|
||||
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
|
||||
# Log directory for GQL requests
|
||||
logDir = "./gql-logs"
|
||||
|
||||
# GQL cache settings
|
||||
[server.gql.cache]
|
||||
enabled = true
|
||||
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
timeTravelMaxAge = 86400 # 1 day
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
timeTravelMaxAge = 86400 # 1 day
|
||||
|
||||
[metrics]
|
||||
host = "0.0.0.0"
|
||||
@ -64,7 +58,7 @@
|
||||
|
||||
[upstream]
|
||||
[upstream.ethServer]
|
||||
rpcProviderEndpoints = REPLACE_WITH_CERC_ETH_RPC_ENDPOINTS
|
||||
rpcProviderEndpoint = "REPLACE_WITH_CERC_ETH_RPC_ENDPOINT"
|
||||
|
||||
# Boolean flag to specify if rpc-eth-client should be used for RPC endpoint instead of ipld-eth-client (ipld-eth-server GQL client)
|
||||
rpcClient = true
|
||||
@ -91,9 +85,6 @@
|
||||
# Filecoin block time: https://docs.filecoin.io/basics/the-blockchain/blocks-and-tipsets#blocktime
|
||||
blockDelayInMilliSecs = 30000
|
||||
|
||||
# Number of blocks by which block processing lags behind head
|
||||
blockProcessingOffset = 0
|
||||
|
||||
# Boolean to switch between modes of processing events when starting the server.
|
||||
# Setting to true will fetch filtered events and required blocks in a range of blocks and then process them.
|
||||
# Setting to false will fetch blocks consecutively with its events and then process them (Behaviour is followed in realtime processing near head).
|
||||
@ -105,6 +96,3 @@
|
||||
# Max block range of historical processing after which it waits for completion of events processing
|
||||
# If set to -1 historical processing does not wait for events processing and completes till latest canonical block
|
||||
historicalMaxFetchAhead = 10000
|
||||
|
||||
# Max number of retries to fetch new block after which watcher will failover to other RPC endpoints
|
||||
maxNewBlockRetries = 3
|
||||
|
||||
@ -68,5 +68,5 @@ ENV PATH="${PATH}:/scripts"
|
||||
COPY entrypoint.sh .
|
||||
ENTRYPOINT ["./entrypoint.sh"]
|
||||
# Placeholder CMD : generally this will be overridden at run time like :
|
||||
# docker run -it -v /home/builder/cerc/registry-sdk:/workspace cerc/builder-js sh -c 'cd /workspace && yarn && yarn build'
|
||||
# docker run -it -v /home/builder/cerc/laconic-sdk:/workspace cerc/builder-js sh -c 'cd /workspace && yarn && yarn build'
|
||||
CMD node --version
|
||||
|
||||
@ -1,23 +1,26 @@
|
||||
FROM ethpandaops/ethereum-genesis-generator:3.0.0 AS ethgen
|
||||
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
||||
|
||||
FROM golang:1.20-alpine as builder
|
||||
|
||||
RUN apk add --no-cache python3 py3-pip make bash envsubst jq
|
||||
RUN apk add --no-cache python3 py3-pip
|
||||
|
||||
COPY genesis /opt/genesis
|
||||
|
||||
# Install ethereum-genesis-generator tools
|
||||
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/
|
||||
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/
|
||||
COPY --from=ethgen /apps /apps
|
||||
RUN cd /apps/el-gen && pip3 install --break-system-packages -r requirements.txt
|
||||
RUN pip3 install --break-system-packages --upgrade "web3==v6.15.1"
|
||||
# web3==5.24.0 used by el-gen is broken on python 3.11
|
||||
RUN pip3 install --break-system-packages --upgrade "web3==6.5.0"
|
||||
RUN pip3 install --break-system-packages --upgrade "typing-extensions"
|
||||
|
||||
# Install tool to generate initial block
|
||||
RUN go install github.com/cerc-io/eth-dump-genblock@b29516740fc01cf1d1d623acbfd0e9a2b6440a96
|
||||
|
||||
# Build genesis config
|
||||
COPY genesis /opt/genesis
|
||||
RUN apk add --no-cache make bash envsubst jq
|
||||
RUN cd /opt/genesis && make genesis-el
|
||||
|
||||
# Snag the genesis block info.
|
||||
RUN go install github.com/cerc-io/eth-dump-genblock@latest
|
||||
RUN eth-dump-genblock /opt/genesis/build/el/geth.json > /opt/genesis/build/el/genesis_block.json
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
@ -9,8 +9,32 @@ mkdir -p ../build/el
|
||||
tmp_dir=$(mktemp -d -t ci-XXXXXXXXXX)
|
||||
envsubst < el-config.yaml > $tmp_dir/genesis-config.yaml
|
||||
|
||||
python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml | \
|
||||
jq 'del(.config.pragueTime)' \
|
||||
> ../build/el/geth.json
|
||||
ttd=`cat $tmp_dir/genesis-config.yaml | grep terminal_total_difficulty | awk '{ print $2 }'`
|
||||
homestead_block=`cat $tmp_dir/genesis-config.yaml | grep homestead_block | awk '{ print $2 }'`
|
||||
eip150_block=`cat $tmp_dir/genesis-config.yaml | grep eip150_block | awk '{ print $2 }'`
|
||||
eip155_block=`cat $tmp_dir/genesis-config.yaml | grep eip155_block | awk '{ print $2 }'`
|
||||
eip158_block=`cat $tmp_dir/genesis-config.yaml | grep eip158_block | awk '{ print $2 }'`
|
||||
byzantium_block=`cat $tmp_dir/genesis-config.yaml | grep byzantium_block | awk '{ print $2 }'`
|
||||
constantinople_block=`cat $tmp_dir/genesis-config.yaml | grep constantinople_block | awk '{ print $2 }'`
|
||||
petersburg_block=`cat $tmp_dir/genesis-config.yaml | grep petersburg_block | awk '{ print $2 }'`
|
||||
istanbul_block=`cat $tmp_dir/genesis-config.yaml | grep istanbul_block | awk '{ print $2 }'`
|
||||
berlin_block=`cat $tmp_dir/genesis-config.yaml | grep berlin_block | awk '{ print $2 }'`
|
||||
london_block=`cat $tmp_dir/genesis-config.yaml | grep london_block | awk '{ print $2 }'`
|
||||
merge_fork_block=`cat $tmp_dir/genesis-config.yaml | grep merge_fork_block | awk '{ print $2 }'`
|
||||
|
||||
python3 /apps/el-gen/genesis_geth.py $tmp_dir/genesis-config.yaml | \
|
||||
jq ".config.terminalTotalDifficulty=$ttd" | \
|
||||
jq ".config.homesteadBlock=$homestead_block" | \
|
||||
jq ".config.eip150Block=$eip150_block" | \
|
||||
jq ".config.eip155Block=$eip155_block" | \
|
||||
jq ".config.eip158Block=$eip158_block" | \
|
||||
jq ".config.byzantiumBlock=$byzantium_block" | \
|
||||
jq ".config.constantinopleBlock=$constantinople_block" | \
|
||||
jq ".config.petersburgBlock=$petersburg_block" | \
|
||||
jq ".config.istanbulBlock=$istanbul_block" | \
|
||||
jq ".config.berlinBlock=$berlin_block" | \
|
||||
jq ".config.londonBlock=$london_block" | \
|
||||
jq ".config.mergeForkBlock=$merge_fork_block" | \
|
||||
jq ".config.mergeNetsplitBlock=$merge_fork_block" \
|
||||
> ../build/el/geth.json
|
||||
python3 ../accounts/mnemonic_to_csv.py $tmp_dir/genesis-config.yaml > ../build/el/accounts.csv
|
||||
|
||||
@ -10,8 +10,22 @@ el_premine_addrs: {}
|
||||
chain_id: 1212
|
||||
deposit_contract_address: "0x1212121212121212121212121212121212121212"
|
||||
genesis_timestamp: 0
|
||||
genesis_delay: 0
|
||||
deneb_fork_epoch: 0
|
||||
# note: only needed as workaround https://github.com/ethpandaops/ethereum-genesis-generator/pull/105
|
||||
electra_fork_epoch: 0
|
||||
slot_duration_in_seconds: 3
|
||||
terminal_total_difficulty: 1000
|
||||
homestead_block: 1
|
||||
eip150_block: 1
|
||||
eip155_block: 1
|
||||
eip158_block: 1
|
||||
byzantium_block: 1
|
||||
constantinople_block: 1
|
||||
petersburg_block: 1
|
||||
istanbul_block: 1
|
||||
berlin_block: 1
|
||||
london_block: 1
|
||||
merge_fork_block: 1
|
||||
|
||||
clique:
|
||||
enabled: false
|
||||
signers:
|
||||
- 36d56343bc308d4ffaac2f793d121aba905fa6cc
|
||||
- 5e762d4a3847cadaf40a4b0c39574b0ff6698c78
|
||||
- 15d7acc1019fdf8ab4f0f7bd31ec1487ecb5a2bd
|
||||
|
||||
@ -6,7 +6,7 @@ fi
|
||||
|
||||
ETHERBASE=`cat /opt/testnet/build/el/accounts.csv | head -1 | cut -d',' -f2`
|
||||
NETWORK_ID=`cat /opt/testnet/el/el-config.yaml | grep 'chain_id' | awk '{ print $2 }'`
|
||||
NETRESTRICT=`ip addr | grep -w inet | grep -v '127.0' | awk '{print $2}'`
|
||||
NETRESTRICT=`ip addr | grep inet | grep -v '127.0' | awk '{print $2}'`
|
||||
CERC_ETH_DATADIR="${CERC_ETH_DATADIR:-$HOME/ethdata}"
|
||||
CERC_PLUGINS_DIR="${CERC_PLUGINS_DIR:-/usr/local/lib/plugeth}"
|
||||
|
||||
@ -102,13 +102,6 @@ else
|
||||
fi
|
||||
fi
|
||||
|
||||
OTHER_OPTS=""
|
||||
# miner options were removed in v1.12
|
||||
GETH_VERSION=$(geth --version | grep -io '[0-9][0-9a-z.-]*')
|
||||
if echo -e "$GETH_VERSION\n1.12" | sort -Vc; then
|
||||
OTHER_OPTS="--miner.threads=1"
|
||||
fi
|
||||
|
||||
$START_CMD \
|
||||
--datadir="${CERC_ETH_DATADIR}" \
|
||||
--bootnodes="${ENODE}" \
|
||||
@ -133,12 +126,12 @@ else
|
||||
--cache.preimages \
|
||||
--syncmode=full \
|
||||
--mine \
|
||||
--miner.threads=1 \
|
||||
--metrics \
|
||||
--metrics.addr="0.0.0.0" \
|
||||
--verbosity=${CERC_GETH_VERBOSITY:-3} \
|
||||
--log.vmodule="${CERC_GETH_VMODULE:-statediff/*=5}" \
|
||||
--miner.etherbase="${ETHERBASE}" \
|
||||
${OTHER_OPTS} \
|
||||
${STATEDIFF_OPTS} \
|
||||
&
|
||||
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
FROM cerc/lighthouse-cli:local AS lcli
|
||||
FROM skylenet/ethereum-genesis-generator@sha256:210353ce7c898686bc5092f16c61220a76d357f51eff9c451e9ad1b9ad03d4d3 AS ethgen
|
||||
FROM cerc/fixturenet-eth-genesis:local AS fnetgen
|
||||
|
||||
FROM cerc/lighthouse:local
|
||||
@ -11,13 +12,16 @@ RUN apt-get update && apt-get -y upgrade && apt-get install -y --no-install-reco
|
||||
&& apt-get clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli
|
||||
COPY --from=fnetgen /opt/genesis/el /opt/testnet/el
|
||||
COPY --from=fnetgen /opt/genesis/build/el /opt/testnet/build/el
|
||||
|
||||
COPY genesis /opt/testnet
|
||||
COPY run-cl.sh /opt/testnet/run.sh
|
||||
|
||||
COPY --from=lcli /usr/local/bin/lcli /usr/local/bin/lcli
|
||||
COPY --from=ethgen /usr/local/bin/eth2-testnet-genesis /usr/local/bin/eth2-testnet-genesis
|
||||
COPY --from=ethgen /usr/local/bin/eth2-val-tools /usr/local/bin/eth2-val-tools
|
||||
COPY --from=ethgen /apps /apps
|
||||
COPY --from=fnetgen /opt/genesis/el /opt/testnet/el
|
||||
COPY --from=fnetgen /opt/genesis/build/el /opt/testnet/build/el
|
||||
|
||||
RUN cd /opt/testnet && make genesis-cl
|
||||
|
||||
# Work around some bugs in lcli where the default path is always used.
|
||||
|
||||
@ -10,6 +10,7 @@ set -Eeuo pipefail
|
||||
source ./vars.env
|
||||
|
||||
SUBSCRIBE_ALL_SUBNETS=
|
||||
DEBUG_LEVEL=${DEBUG_LEVEL:-debug}
|
||||
|
||||
# Get positional arguments
|
||||
data_dir=$DATADIR/node_${NODE_NUMBER}
|
||||
|
||||
@ -9,6 +9,8 @@ set -Eeuo pipefail
|
||||
|
||||
source ./vars.env
|
||||
|
||||
DEBUG_LEVEL=${1:-info}
|
||||
|
||||
echo "Starting bootnode"
|
||||
|
||||
# Clean up existing ENR dir to avoid node connectivity issues on a restart
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# See https://github.com/sigp/lighthouse/scripts/local_testnet/setup.sh
|
||||
#
|
||||
# Deploys the deposit contract and makes deposits for $VALIDATOR_COUNT insecure deterministic validators.
|
||||
# Produces a testnet specification and a genesis state where the genesis time
|
||||
@ -25,26 +24,23 @@ echo "(Note: errors of the form 'WARN: Scrypt parameters are too weak...' below
|
||||
lcli \
|
||||
new-testnet \
|
||||
--spec $SPEC_PRESET \
|
||||
--testnet-dir $TESTNET_DIR \
|
||||
--deposit-contract-address $ETH1_DEPOSIT_CONTRACT_ADDRESS \
|
||||
--testnet-dir $TESTNET_DIR \
|
||||
--min-genesis-active-validator-count $GENESIS_VALIDATOR_COUNT \
|
||||
--validator-count $VALIDATOR_COUNT \
|
||||
--min-genesis-time $GENESIS_TIME \
|
||||
--genesis-delay $GENESIS_DELAY \
|
||||
--genesis-fork-version $GENESIS_FORK_VERSION \
|
||||
--altair-fork-epoch $ALTAIR_FORK_EPOCH \
|
||||
--bellatrix-fork-epoch $BELLATRIX_FORK_EPOCH \
|
||||
--capella-fork-epoch $CAPELLA_FORK_EPOCH \
|
||||
--deneb-fork-epoch $DENEB_FORK_EPOCH \
|
||||
--bellatrix-fork-epoch $MERGE_FORK_EPOCH \
|
||||
--eth1-id $ETH1_CHAIN_ID \
|
||||
--eth1-block-hash $ETH1_BLOCK_HASH \
|
||||
--eth1-follow-distance 1 \
|
||||
--seconds-per-slot $SECONDS_PER_SLOT \
|
||||
--seconds-per-eth1-block $SECONDS_PER_ETH1_BLOCK \
|
||||
--interop-genesis-state \
|
||||
--force
|
||||
|
||||
echo Specification and genesis.ssz generated at $TESTNET_DIR.
|
||||
echo Specification generated at $TESTNET_DIR.
|
||||
echo "Generating $VALIDATOR_COUNT validators concurrently... (this may take a while)"
|
||||
|
||||
lcli \
|
||||
@ -54,3 +50,13 @@ lcli \
|
||||
--node-count $BN_COUNT
|
||||
|
||||
echo Validators generated with keystore passwords at $DATADIR.
|
||||
echo "Building genesis state... (this might take a while)"
|
||||
|
||||
lcli \
|
||||
interop-genesis \
|
||||
--spec $SPEC_PRESET \
|
||||
--genesis-time $GENESIS_TIME \
|
||||
--testnet-dir $TESTNET_DIR \
|
||||
$GENESIS_VALIDATOR_COUNT
|
||||
|
||||
echo Created genesis state in $TESTNET_DIR
|
||||
|
||||
@ -8,6 +8,8 @@ set -Eeuo pipefail
|
||||
|
||||
source ./vars.env
|
||||
|
||||
DEBUG_LEVEL=info
|
||||
|
||||
BUILDER_PROPOSALS=
|
||||
|
||||
# Get options
|
||||
|
||||
@ -25,9 +25,7 @@ BOOTNODE_PORT=${BOOTNODE_PORT:-4242}
|
||||
|
||||
# Hard fork configuration
|
||||
ALTAIR_FORK_EPOCH=${ALTAIR_FORK_EPOCH:-0}
|
||||
BELLATRIX_FORK_EPOCH=${BELLATRIX_FORK_EPOCH:-0}
|
||||
CAPELLA_FORK_EPOCH=${CAPELLA_FORK_EPOCH:-0}
|
||||
DENEB_FORK_EPOCH=${DENEB_FORK_EPOCH:-0}
|
||||
MERGE_FORK_EPOCH=${MERGE_FORK_EPOCH:-0}
|
||||
|
||||
# Spec version (mainnet or minimal)
|
||||
SPEC_PRESET=${SPEC_PRESET:-mainnet}
|
||||
@ -53,6 +51,3 @@ ETH1_TTD=${ETH1_TTD:-`cat $ETH1_GENESIS_JSON | jq -r '.config.terminalTotalDiffi
|
||||
ETH1_DEPOSIT_CONTRACT_ADDRESS=${ETH1_DEPOSIT_CONTRACT_ADDRESS:-`cat $ETH1_CONFIG_YAML | grep 'deposit_contract_address' | awk '{ print $2 }' | sed 's/"//g'`}
|
||||
ETH1_DEPOSIT_CONTRACT_BLOCK=${ETH1_DEPOSIT_CONTRACT_BLOCK:-0x0}
|
||||
SUGGESTED_FEE_RECIPIENT=`cat ../build/el/accounts.csv | head -1 | cut -d',' -f2`
|
||||
|
||||
# --debug-level
|
||||
DEBUG_LEVEL=${LIGHTHOUSE_DEBUG_LEVEL:-debug}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build cerc/laconic-console-host
|
||||
# Build cerc/laconic-registry-cli
|
||||
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
|
||||
|
||||
@ -5,16 +5,16 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
registry_command="laconic registry"
|
||||
registry_command="laconic cns"
|
||||
demo_records_dir="scripts/demo-records"
|
||||
|
||||
# Check we have funds
|
||||
funds_response=$(${registry_command} account get --address $(cat my-address.txt))
|
||||
funds_balance=$(echo ${funds_response} | jq -r ".[0].balance[0].quantity")
|
||||
funds_balance=$(echo ${funds_response} | jq -r .[0].balance[0].quantity)
|
||||
echo "Balance is: ${funds_balance}"
|
||||
|
||||
# Create a bond
|
||||
bond_create_result=$(${registry_command} bond create --type alnt --quantity 1000000000)
|
||||
bond_create_result=$(${registry_command} bond create --type aphoton --quantity 1000000000)
|
||||
bond_id=$(echo ${bond_create_result} | jq -r .bondId)
|
||||
echo "Created bond with id: ${bond_id}"
|
||||
|
||||
|
||||
@ -7,9 +7,9 @@ record:
|
||||
env:
|
||||
ENV_VAR_A: A
|
||||
ENV_VAR_B: B
|
||||
lrn:
|
||||
- lrn://foo.bar
|
||||
- lrn://bar.baz
|
||||
crn:
|
||||
- crn://foo.bar
|
||||
- crn://bar.baz
|
||||
meta:
|
||||
foo: bar
|
||||
tags:
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
FROM sigp/lighthouse:v5.1.2
|
||||
ARG TAG_SUFFIX="-modern"
|
||||
FROM sigp/lighthouse:v4.3.0${TAG_SUFFIX}
|
||||
|
||||
RUN apt-get update && apt-get -y upgrade \
|
||||
&& apt-get -y install bash netcat curl less jq wget \
|
||||
&& apt-get clean && rm -rf /var/lib/apt/lists/*
|
||||
RUN apt-get update; apt-get install bash netcat curl less jq wget -y;
|
||||
|
||||
WORKDIR /root
|
||||
WORKDIR /root/
|
||||
ADD start-lighthouse.sh .
|
||||
|
||||
ENTRYPOINT [ "./start-lighthouse.sh" ]
|
||||
|
||||
@ -6,4 +6,4 @@ source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
# See: https://stackoverflow.com/a/246128/1701505
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
docker build -t cerc/lighthouse:local ${build_command_args} ${SCRIPT_DIR}
|
||||
docker build -t cerc/lighthouse:local ${build_command_args} --build-arg TAG_SUFFIX="" ${SCRIPT_DIR}
|
||||
|
||||
@ -28,8 +28,6 @@ RUN \
|
||||
&& su ${USERNAME} -c "umask 0002 && npm install -g semver" \
|
||||
# Install pnpm
|
||||
&& su ${USERNAME} -c "umask 0002 && npm install -g pnpm" \
|
||||
# Install bun
|
||||
&& su ${USERNAME} -c "umask 0002 && npm install -g bun@1.1.x" \
|
||||
&& npm cache clean --force > /dev/null 2>&1
|
||||
|
||||
# [Optional] Uncomment this section to install additional OS packages.
|
||||
|
||||
@ -14,8 +14,6 @@ if [ -z "$CERC_BUILD_TOOL" ]; then
|
||||
CERC_BUILD_TOOL=pnpm
|
||||
elif [ -f "yarn.lock" ]; then
|
||||
CERC_BUILD_TOOL=yarn
|
||||
elif [ -f "bun.lockb" ]; then
|
||||
CERC_BUILD_TOOL=bun
|
||||
else
|
||||
CERC_BUILD_TOOL=npm
|
||||
fi
|
||||
|
||||
@ -5,19 +5,14 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
fi
|
||||
|
||||
CERC_MIN_NEXTVER=13.4.2
|
||||
CERC_DEFAULT_WEBPACK_VER="5.93.0"
|
||||
|
||||
CERC_NEXT_VERSION="${CERC_NEXT_VERSION:-keep}"
|
||||
CERC_WEBPACK_VERSION="${CERC_WEBPACK_VERSION:-keep}"
|
||||
|
||||
CERC_BUILD_TOOL="${CERC_BUILD_TOOL}"
|
||||
if [ -z "$CERC_BUILD_TOOL" ]; then
|
||||
if [ -f "pnpm-lock.yaml" ]; then
|
||||
CERC_BUILD_TOOL=pnpm
|
||||
elif [ -f "yarn.lock" ]; then
|
||||
CERC_BUILD_TOOL=yarn
|
||||
elif [ -f "bun.lockb" ]; then
|
||||
CERC_BUILD_TOOL=bun
|
||||
else
|
||||
CERC_BUILD_TOOL=npm
|
||||
fi
|
||||
@ -26,29 +21,15 @@ fi
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
WORK_DIR="${1:-/app}"
|
||||
|
||||
if [ -f "${WORK_DIR}/build-webapp.sh" ]; then
|
||||
echo "Building webapp with ${WORK_DIR}/build-webapp.sh ..."
|
||||
cd "${WORK_DIR}" || exit 1
|
||||
|
||||
./build-webapp.sh || exit 1
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ -f "next.config.mjs" ]; then
|
||||
NEXT_CONFIG_JS="next.config.mjs"
|
||||
IMPORT_OR_REQUIRE="import"
|
||||
else
|
||||
NEXT_CONFIG_JS="next.config.js"
|
||||
IMPORT_OR_REQUIRE="require"
|
||||
fi
|
||||
|
||||
# If this file doesn't exist at all, we'll get errors below.
|
||||
if [ ! -f "${NEXT_CONFIG_JS}" ]; then
|
||||
touch ${NEXT_CONFIG_JS}
|
||||
if [ ! -f "next.config.js" ]; then
|
||||
touch next.config.js
|
||||
fi
|
||||
|
||||
if [ ! -f "next.config.dist" ]; then
|
||||
cp $NEXT_CONFIG_JS next.config.dist
|
||||
cp next.config.js next.config.dist
|
||||
fi
|
||||
|
||||
which js-beautify >/dev/null
|
||||
@ -56,34 +37,17 @@ if [ $? -ne 0 ]; then
|
||||
npm i -g js-beautify
|
||||
fi
|
||||
|
||||
# js-beautify formats NEXTJS_CONFIG_FILE (ie next.config.js / next.config.mjs) so we can reliably transformable later
|
||||
js-beautify next.config.dist > ${NEXT_CONFIG_JS}
|
||||
echo "" >> ${NEXT_CONFIG_JS}
|
||||
js-beautify next.config.dist > next.config.js
|
||||
echo "" >> next.config.js
|
||||
|
||||
if [ "${IMPORT_OR_REQUIRE}" == "require" ]; then
|
||||
WEBPACK_REQ_LINE=$(grep -n "require([\'\"]webpack[\'\"])" ${NEXT_CONFIG_JS} | cut -d':' -f1)
|
||||
if [ -z "$WEBPACK_REQ_LINE" ]; then
|
||||
cat > ${NEXT_CONFIG_JS}.0 <<EOF
|
||||
WEBPACK_REQ_LINE=$(grep -n "require([\'\"]webpack[\'\"])" next.config.js | cut -d':' -f1)
|
||||
if [ -z "$WEBPACK_REQ_LINE" ]; then
|
||||
cat > next.config.js.0 <<EOF
|
||||
const webpack = require('webpack');
|
||||
EOF
|
||||
fi
|
||||
else
|
||||
WEBPACK_IMPORT_LINE=$(grep -n "^import .*[\'\"]webpack[\'\"];?$" ${NEXT_CONFIG_JS} | cut -d':' -f1)
|
||||
if [ -z "$WEBPACK_IMPORT_LINE" ]; then
|
||||
cat > ${NEXT_CONFIG_JS}.0 <<EOF
|
||||
import webpack from 'webpack';
|
||||
EOF
|
||||
fi
|
||||
CREATE_REQUIRE_LINE=$(grep -n "require = createRequire" ${NEXT_CONFIG_JS} | cut -d':' -f1)
|
||||
if [ -z "$CREATE_REQUIRE_LINE" ]; then
|
||||
cat >> ${NEXT_CONFIG_JS}.0 <<EOF
|
||||
import { createRequire } from "module";
|
||||
const require = createRequire(import.meta.url);
|
||||
EOF
|
||||
fi
|
||||
fi
|
||||
|
||||
cat > ${NEXT_CONFIG_JS}.1 <<EOF
|
||||
cat > next.config.js.1 <<EOF
|
||||
let envMap;
|
||||
try {
|
||||
// .env-list.json provides us a list of identifiers which should be replaced at runtime.
|
||||
@ -91,8 +55,7 @@ try {
|
||||
a[v] = \`"CERC_RUNTIME_ENV_\${v.split(/\./).pop()}"\`;
|
||||
return a;
|
||||
}, {});
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
} catch {
|
||||
// If .env-list.json cannot be loaded, we are probably running in dev mode, so use process.env instead.
|
||||
envMap = Object.keys(process.env).reduce((a, v) => {
|
||||
if (v.startsWith('CERC_')) {
|
||||
@ -101,80 +64,40 @@ try {
|
||||
return a;
|
||||
}, {});
|
||||
}
|
||||
console.log(envMap);
|
||||
EOF
|
||||
|
||||
grep 'withPWA' ${NEXT_CONFIG_JS} >/dev/null && HAS_WITHPWA=true || HAS_WITHPWA=false
|
||||
CONFIG_LINES=$(wc -l next.config.js | awk '{ print $1 }')
|
||||
ENV_LINE=$(grep -n 'env:' next.config.js | cut -d':' -f1)
|
||||
WEBPACK_CONF_LINE=$(egrep -n 'webpack:\s+\([^,]+,' next.config.js | cut -d':' -f1)
|
||||
NEXT_SECTION_ADJUSTMENT=0
|
||||
|
||||
if [ "$HAS_WITHPWA" == "true" ]; then
|
||||
if [ "$IMPORT_OR_REQUIRE" == "import" ]; then
|
||||
cat > ${NEXT_CONFIG_JS}.2 <<EOF
|
||||
const __xPWA__ = (p) => {
|
||||
const realPWA = withPWA(p);
|
||||
return (nextConfig) => {
|
||||
const modConfig = {...nextConfig};
|
||||
|
||||
modConfig.webpack = (config) => {
|
||||
if [ -n "$WEBPACK_CONF_LINE" ]; then
|
||||
WEBPACK_CONF_VAR=$(egrep -n 'webpack:\s+\([^,]+,' next.config.js | cut -d',' -f1 | cut -d'(' -f2)
|
||||
head -$(( ${WEBPACK_CONF_LINE} )) next.config.js > next.config.js.2
|
||||
cat > next.config.js.3 <<EOF
|
||||
$WEBPACK_CONF_VAR.plugins.push(new webpack.DefinePlugin(envMap));
|
||||
EOF
|
||||
NEXT_SECTION_LINE=$((WEBPACK_CONF_LINE))
|
||||
elif [ -n "$ENV_LINE" ]; then
|
||||
head -$(( ${ENV_LINE} - 1 )) next.config.js > next.config.js.2
|
||||
cat > next.config.js.3 <<EOF
|
||||
webpack: (config) => {
|
||||
config.plugins.push(new webpack.DefinePlugin(envMap));
|
||||
return nextConfig.webpack ? nextConfig.webpack(config) : config;
|
||||
};
|
||||
|
||||
return realPWA(modConfig);
|
||||
};
|
||||
};
|
||||
return config;
|
||||
},
|
||||
EOF
|
||||
else
|
||||
cat > ${NEXT_CONFIG_JS}.3 <<EOF
|
||||
const __xPWA__ = (nextConfig) => {
|
||||
const modConfig = {...nextConfig};
|
||||
|
||||
modConfig.webpack = (config) => {
|
||||
config.plugins.push(new webpack.DefinePlugin(envMap));
|
||||
return nextConfig.webpack ? nextConfig.webpack(config) : config;
|
||||
};
|
||||
|
||||
return withPWA(modConfig);
|
||||
};
|
||||
EOF
|
||||
fi
|
||||
|
||||
cat ${NEXT_CONFIG_JS} | js-beautify | sed 's/withPWA(/__xPWA__(/g' > ${NEXT_CONFIG_JS}.4
|
||||
NEXT_SECTION_ADJUSTMENT=1
|
||||
NEXT_SECTION_LINE=$ENV_LINE
|
||||
else
|
||||
cat > ${NEXT_CONFIG_JS}.3 <<EOF
|
||||
const __xCfg__ = (nextConfig) => {
|
||||
const modConfig = {...nextConfig};
|
||||
|
||||
modConfig.webpack = (config) => {
|
||||
config.plugins.push(new webpack.DefinePlugin(envMap));
|
||||
return nextConfig.webpack ? nextConfig.webpack(config) : config;
|
||||
};
|
||||
|
||||
return modConfig;
|
||||
};
|
||||
EOF
|
||||
if [ "$IMPORT_OR_REQUIRE" == "import" ]; then
|
||||
cat ${NEXT_CONFIG_JS} | js-beautify | sed 's/export\s\+default\s\+/const __orig_cfg__ = /g' > ${NEXT_CONFIG_JS}.4
|
||||
echo "export default __xCfg__(__orig_cfg__);" > ${NEXT_CONFIG_JS}.5
|
||||
else
|
||||
cat ${NEXT_CONFIG_JS} | js-beautify | sed 's/module.exports\s\+=\s\+/const __orig_cfg__ = /g' > ${NEXT_CONFIG_JS}.4
|
||||
echo "module.exports = __xCfg__(__orig_cfg__);" > ${NEXT_CONFIG_JS}.5
|
||||
fi
|
||||
echo "WARNING: Cannot find location to insert environment variable map in next.config.js" 1>&2
|
||||
rm -f next.config.js.*
|
||||
NEXT_SECTION_LINE=0
|
||||
fi
|
||||
|
||||
tail -$(( ${CONFIG_LINES} - ${NEXT_SECTION_LINE} + ${NEXT_SECTION_ADJUSTMENT} )) next.config.js > next.config.js.5
|
||||
|
||||
rm -f ${NEXT_CONFIG_JS}
|
||||
for ((i=0; i <= 10; i++)); do
|
||||
if [ -s "${NEXT_CONFIG_JS}.${i}" ]; then
|
||||
if [ $i -le 2 ] ; then
|
||||
cat ${NEXT_CONFIG_JS}.${i} >> ${NEXT_CONFIG_JS}
|
||||
else
|
||||
cat ${NEXT_CONFIG_JS}.${i} | sed 's/^ *//g' | js-beautify | grep -v 'process\.\env\.' | js-beautify >> ${NEXT_CONFIG_JS}
|
||||
fi
|
||||
fi
|
||||
done
|
||||
rm ${NEXT_CONFIG_JS}.*
|
||||
cat ${NEXT_CONFIG_JS} | js-beautify > ${NEXT_CONFIG_JS}.pretty
|
||||
mv ${NEXT_CONFIG_JS}.pretty ${NEXT_CONFIG_JS}
|
||||
cat next.config.js.* | sed 's/^ *//g' | js-beautify | grep -v 'process\.\env\.' | js-beautify > next.config.js
|
||||
rm next.config.js.*
|
||||
|
||||
"${SCRIPT_DIR}/find-env.sh" "$(pwd)" > .env-list.json
|
||||
|
||||
@ -182,6 +105,8 @@ if [ ! -f "package.dist" ]; then
|
||||
cp package.json package.dist
|
||||
fi
|
||||
|
||||
cat package.dist | jq '.scripts.cerc_compile = "next experimental-compile"' | jq '.scripts.cerc_generate = "next experimental-generate"' > package.json
|
||||
|
||||
CUR_NEXT_VERSION="`jq -r '.dependencies.next' package.json`"
|
||||
|
||||
if [ "$CERC_NEXT_VERSION" != "keep" ] && [ "$CUR_NEXT_VERSION" != "$CERC_NEXT_VERSION" ]; then
|
||||
@ -190,38 +115,10 @@ if [ "$CERC_NEXT_VERSION" != "keep" ] && [ "$CUR_NEXT_VERSION" != "$CERC_NEXT_VE
|
||||
mv package.json.$$ package.json
|
||||
fi
|
||||
|
||||
CUR_WEBPACK_VERSION="`jq -r '.dependencies.webpack' package.json`"
|
||||
if [ -z "$CUR_WEBPACK_VERSION" ]; then
|
||||
CUR_WEBPACK_VERSION="`jq -r '.devDependencies.webpack' package.json`"
|
||||
fi
|
||||
if [ "${CERC_WEBPACK_VERSION}" != "keep" ] || [ "${CUR_WEBPACK_VERSION}" == "null" ]; then
|
||||
if [ -z "$CERC_WEBPACK_VERSION" ] || [ "$CERC_WEBPACK_VERSION" == "keep" ]; then
|
||||
CERC_WEBPACK_VERSION="${CERC_DEFAULT_WEBPACK_VER}"
|
||||
fi
|
||||
echo "Webpack is required for env variable substitution. Adding to webpack@$CERC_WEBPACK_VERSION to dependencies..." 1>&2
|
||||
cat package.json | jq ".dependencies.webpack = \"$CERC_WEBPACK_VERSION\"" > package.json.$$
|
||||
mv package.json.$$ package.json
|
||||
fi
|
||||
|
||||
time $CERC_BUILD_TOOL install || exit 1
|
||||
|
||||
CUR_NEXT_VERSION=`jq -r '.version' node_modules/next/package.json`
|
||||
|
||||
# See https://github.com/vercel/next.js/discussions/46544
|
||||
semver -p -r ">=14.2.0" "$CUR_NEXT_VERSION"
|
||||
if [ $? -eq 0 ]; then
|
||||
# For >= 14.2.0
|
||||
CERC_NEXT_COMPILE_COMMAND="next build --experimental-build-mode compile"
|
||||
CERC_NEXT_GENERATE_COMMAND="next build --experimental-build-mode generate"
|
||||
else
|
||||
# For 13.4.2 to 14.1.x
|
||||
CERC_NEXT_COMPILE_COMMAND="next experimental-compile"
|
||||
CERC_NEXT_GENERATE_COMMAND="next experimental-generate"
|
||||
fi
|
||||
|
||||
cat package.json | jq ".scripts.cerc_compile = \"$CERC_NEXT_COMPILE_COMMAND\"" | jq ".scripts.cerc_generate = \"$CERC_NEXT_GENERATE_COMMAND\"" > package.json.$$
|
||||
mv package.json.$$ package.json
|
||||
|
||||
semver -p -r ">=$CERC_MIN_NEXTVER" $CUR_NEXT_VERSION
|
||||
if [ $? -ne 0 ]; then
|
||||
cat <<EOF
|
||||
|
||||
@ -20,11 +20,9 @@ for d in $(find . -maxdepth 1 -type d | grep -v '\./\.' | grep '/' | cut -d'/' -
|
||||
done
|
||||
done
|
||||
|
||||
NEXT_CONF="next.config.mjs next.config.js next.config.dist"
|
||||
NEXT_CONF="next.config.js next.config.dist"
|
||||
for f in $NEXT_CONF; do
|
||||
if [ -f "$f" ]; then
|
||||
cat "$f" | tr -s '[:blank:]' '\n' | tr -s '[{},()]' '\n' | egrep -o 'process.env.[A-Za-z0-9_]+' >> $TMPF
|
||||
fi
|
||||
cat "$f" | tr -s '[:blank:]' '\n' | tr -s '[{},()]' '\n' | egrep -o 'process.env.[A-Za-z0-9_]+' >> $TMPF
|
||||
done
|
||||
|
||||
cat $TMPF | sort -u | jq --raw-input . | jq --slurp .
|
||||
|
||||
@ -5,7 +5,7 @@ fi
|
||||
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
CERC_MAX_GENERATE_TIME=${CERC_MAX_GENERATE_TIME:-120}
|
||||
CERC_MAX_GENERATE_TIME=${CERC_MAX_GENERATE_TIME:-60}
|
||||
tpid=""
|
||||
|
||||
ctrl_c() {
|
||||
@ -20,8 +20,6 @@ if [ -z "$CERC_BUILD_TOOL" ]; then
|
||||
CERC_BUILD_TOOL=pnpm
|
||||
elif [ -f "yarn.lock" ]; then
|
||||
CERC_BUILD_TOOL=yarn
|
||||
elif [ -f "bun.lockb" ]; then
|
||||
CERC_BUILD_TOOL=bun
|
||||
else
|
||||
CERC_BUILD_TOOL=npm
|
||||
fi
|
||||
@ -30,44 +28,36 @@ fi
|
||||
CERC_WEBAPP_FILES_DIR="${CERC_WEBAPP_FILES_DIR:-/app}"
|
||||
cd "$CERC_WEBAPP_FILES_DIR"
|
||||
|
||||
if [ -f "./run-webapp.sh" ]; then
|
||||
echo "Running webapp with run-webapp.sh ..."
|
||||
cd "${WORK_DIR}" || exit 1
|
||||
./run-webapp.sh &
|
||||
tpid=$!
|
||||
wait $tpid
|
||||
else
|
||||
"$SCRIPT_DIR/apply-runtime-env.sh" "`pwd`" .next .next-r
|
||||
mv .next .next.old
|
||||
mv .next-r/.next .
|
||||
"$SCRIPT_DIR/apply-runtime-env.sh" "`pwd`" .next .next-r
|
||||
mv .next .next.old
|
||||
mv .next-r/.next .
|
||||
|
||||
if [ "$CERC_NEXTJS_SKIP_GENERATE" != "true" ]; then
|
||||
jq -e '.scripts.cerc_generate' package.json >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
npm run cerc_generate > gen.out 2>&1 &
|
||||
tail -f gen.out &
|
||||
tpid=$!
|
||||
if [ "$CERC_NEXTJS_SKIP_GENERATE" != "true" ]; then
|
||||
jq -e '.scripts.cerc_generate' package.json >/dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
npm run cerc_generate > gen.out 2>&1 &
|
||||
tail -f gen.out &
|
||||
tpid=$!
|
||||
|
||||
count=0
|
||||
generate_done="false"
|
||||
while [ $count -lt $CERC_MAX_GENERATE_TIME ] && [ "$generate_done" == "false" ]; do
|
||||
sleep 1
|
||||
count=$((count + 1))
|
||||
grep 'rendered as static' gen.out > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
generate_done="true"
|
||||
fi
|
||||
done
|
||||
|
||||
if [ $generate_done != "true" ]; then
|
||||
echo "ERROR: 'npm run cerc_generate' not successful within CERC_MAX_GENERATE_TIME" 1>&2
|
||||
exit 1
|
||||
count=0
|
||||
generate_done="false"
|
||||
while [ $count -lt $CERC_MAX_GENERATE_TIME ] && [ "$generate_done" == "false" ]; do
|
||||
sleep 1
|
||||
count=$((count + 1))
|
||||
grep 'rendered as static' gen.out > /dev/null
|
||||
if [ $? -eq 0 ]; then
|
||||
generate_done="true"
|
||||
fi
|
||||
done
|
||||
|
||||
kill $tpid $(ps -ef | grep node | grep next | grep generate | awk '{print $2}') 2>/dev/null
|
||||
tpid=""
|
||||
if [ $generate_done != "true" ]; then
|
||||
echo "ERROR: 'npm run cerc_generate' not successful within CERC_MAX_GENERATE_TIME" 1>&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
$CERC_BUILD_TOOL start . -- -p ${CERC_LISTEN_PORT:-80}
|
||||
kill $tpid $(ps -ef | grep node | grep next | grep generate | awk '{print $2}') 2>/dev/null
|
||||
tpid=""
|
||||
fi
|
||||
fi
|
||||
|
||||
$CERC_BUILD_TOOL start . -- -p ${CERC_LISTEN_PORT:-80}
|
||||
|
||||
@ -1,10 +0,0 @@
|
||||
FROM cerc/ping-pub-base:local
|
||||
|
||||
COPY ./scripts/update-explorer-config.sh /scripts
|
||||
COPY ./scripts/start-serving-explorer.sh /scripts
|
||||
COPY ./config/laconic-chaindata-template.json /config/chains/laconic-chaindata-template.json
|
||||
|
||||
EXPOSE 5173
|
||||
|
||||
WORKDIR /app
|
||||
CMD ["/scripts/start-serving-explorer.sh"]
|
||||
@ -1,8 +0,0 @@
|
||||
FROM cerc/webapp-base:local
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN yarn
|
||||
|
||||
@ -1,12 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build the ping pub image
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
# Two-stage build is to allow us to pick up both the upstream repo's files, and local files here for config
|
||||
docker build -t cerc/ping-pub-base:local ${build_command_args} -f $SCRIPT_DIR/Dockerfile.base $CERC_REPO_BASE_DIR/cosmos-explorer
|
||||
if [[ $? -ne 0 ]]; then
|
||||
echo "FATAL: Base container build failed, exiting"
|
||||
exit 1
|
||||
fi
|
||||
docker build -t cerc/ping-pub:local ${build_command_args} -f $SCRIPT_DIR/Dockerfile $SCRIPT_DIR
|
||||
docker build -t cerc/ping-pub:local ${build_command_args} -f $CERC_REPO_BASE_DIR/explorer/Dockerfile $CERC_REPO_BASE_DIR/explorer
|
||||
|
||||
@ -1,22 +0,0 @@
|
||||
{
|
||||
"chain_name": "LACONIC_LACONICD_CHAIN_ID",
|
||||
"registry_name": "LACONIC_LACONICD_CHAIN_ID",
|
||||
"api": [
|
||||
{"provider": "LX-one-tree-one-seven", "address": "LACONIC_LACONICD_API_URL"}
|
||||
],
|
||||
"rpc": [
|
||||
{"provider": "LX-tendermint-rpc", "address": "LACONIC_LACONICD_RPC_URL"}
|
||||
],
|
||||
"sdk_version": "0.50.3",
|
||||
"coin_type": "118",
|
||||
"min_tx_fee": "800",
|
||||
"addr_prefix": "laconic",
|
||||
"logo": "/logos/cosmos.svg",
|
||||
"assets": [{
|
||||
"base": "alnt",
|
||||
"symbol": "LNT",
|
||||
"exponent": "18",
|
||||
"coingecko_id": "cosmos",
|
||||
"logo": "/logos/cosmos.svg"
|
||||
}]
|
||||
}
|
||||
@ -1,13 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
${SCRIPT_DIR}/update-explorer-config.sh
|
||||
|
||||
echo "Starting serving explorer"
|
||||
# Force cache re-build because vite is dumb and can't be restarted otherwise
|
||||
yarn serve --host --force
|
||||
@ -1,52 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
set -e
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Verify that we have the config variables we need
|
||||
if [[ -z ${LACONIC_LACONICD_API_URL} ]]; then
|
||||
echo "Error: LACONIC_LACONICD_API_URL not defined"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z ${LACONIC_LACONICD_RPC_URL} ]]; then
|
||||
echo "Error: LACONIC_LACONICD_RPC_URL not defined"
|
||||
exit 1
|
||||
fi
|
||||
if [[ -z ${LACONIC_LACONICD_CHAIN_ID} ]]; then
|
||||
echo "Error: LACONIC_LACONICD_CHAIN_ID not defined"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Ping-pub explorer has endlessly confusing behavior where it
|
||||
# infers the directory from which to load chain configuration files
|
||||
# by the presence or absense of the substring "testnet" in the host name
|
||||
# (browser side -- the host name of the host in the address bar of the browser)
|
||||
# Accordingly we configure our network in both directories in order to
|
||||
# subvert this lunacy.
|
||||
explorer_mainnet_config_dir=/app/chains/mainnet
|
||||
explorer_testnet_config_dir=/app/chains/testnet
|
||||
config_template_file=/config/chains/laconic-chaindata-template.json
|
||||
chain_config_name=laconic.json
|
||||
mainnet_config_file=${explorer_mainnet_config_dir}/${chain_config_name}
|
||||
testnet_config_file=${explorer_testnet_config_dir}/${chain_config_name}
|
||||
|
||||
# Delete the stock config files
|
||||
rm -f ${explorer_testnet_config_dir}/*
|
||||
rm -f ${explorer_mainnet_config_dir}/*
|
||||
|
||||
# Copy in our template file
|
||||
cp ${config_template_file} ${mainnet_config_file}
|
||||
|
||||
# Update the file with the config variables
|
||||
sed -i "s#LACONIC_LACONICD_API_URL#${LACONIC_LACONICD_API_URL}#g" ${mainnet_config_file}
|
||||
sed -i "s#LACONIC_LACONICD_RPC_URL#${LACONIC_LACONICD_RPC_URL}#g" ${mainnet_config_file}
|
||||
sed -i "s#LACONIC_LACONICD_CHAIN_ID#${LACONIC_LACONICD_CHAIN_ID}#g" ${mainnet_config_file}
|
||||
|
||||
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||
echo "Updated chaindata file:"
|
||||
cat ${mainnet_config_file}
|
||||
fi
|
||||
|
||||
# Copy over to the testnet directory
|
||||
cp ${mainnet_config_file} ${testnet_config_file}
|
||||
@ -0,0 +1,6 @@
|
||||
FROM cerc/snowballtools-base-backend-base:local
|
||||
|
||||
WORKDIR /app/packages/backend
|
||||
COPY run.sh .
|
||||
|
||||
ENTRYPOINT ["./run.sh"]
|
||||
@ -0,0 +1,26 @@
|
||||
FROM ubuntu:22.04 as builder
|
||||
|
||||
RUN apt update && \
|
||||
apt install -y --no-install-recommends --no-install-suggests \
|
||||
ca-certificates curl gnupg
|
||||
|
||||
# Node
|
||||
ARG NODE_MAJOR=20
|
||||
RUN curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg && \
|
||||
echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" | tee /etc/apt/sources.list.d/nodesource.list && \
|
||||
apt update && apt install -y nodejs
|
||||
|
||||
# npm setup
|
||||
RUN npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/ && npm install -g yarn
|
||||
|
||||
COPY . /app/
|
||||
WORKDIR /app/
|
||||
|
||||
RUN find . -name 'node_modules' | xargs -n1 rm -rf
|
||||
RUN yarn && yarn build --ignore frontend
|
||||
|
||||
FROM cerc/webapp-base:local
|
||||
|
||||
COPY --from=builder /app /app
|
||||
|
||||
WORKDIR /app/packages/backend
|
||||
@ -0,0 +1,10 @@
|
||||
#!/usr/bin/env bash
|
||||
# Build cerc/webapp-deployer-backend
|
||||
|
||||
source ${CERC_CONTAINER_BASE_DIR}/build-base.sh
|
||||
|
||||
# See: https://stackoverflow.com/a/246128/1701505
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
|
||||
docker build -t cerc/snowballtools-base-backend-base:local ${build_command_args} -f ${SCRIPT_DIR}/Dockerfile-base ${CERC_REPO_BASE_DIR}/snowballtools-base
|
||||
docker build -t cerc/snowballtools-base-backend:local ${build_command_args} ${SCRIPT_DIR}
|
||||
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
|
||||
LACONIC_HOSTED_CONFIG_FILE=${LACONIC_HOSTED_CONFIG_FILE}
|
||||
if [ -z "${LACONIC_HOSTED_CONFIG_FILE}" ]; then
|
||||
if [ -f "/config/laconic-hosted-config.yml" ]; then
|
||||
LACONIC_HOSTED_CONFIG_FILE="/config/laconic-hosted-config.yml"
|
||||
elif [ -f "/config/config.yml" ]; then
|
||||
LACONIC_HOSTED_CONFIG_FILE="/config/config.yml"
|
||||
fi
|
||||
fi
|
||||
|
||||
if [ -f "${LACONIC_HOSTED_CONFIG_FILE}" ]; then
|
||||
/scripts/apply-webapp-config.sh $LACONIC_HOSTED_CONFIG_FILE "`pwd`/dist"
|
||||
fi
|
||||
|
||||
/scripts/apply-runtime-env.sh "`pwd`/dist"
|
||||
|
||||
yarn start
|
||||
@ -6,10 +6,5 @@ WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
# Get the latest Git commit hash and set in package.json
|
||||
RUN COMMIT_HASH=$(git rev-parse HEAD) && \
|
||||
jq --arg commitHash "$COMMIT_HASH" '.commitHash = $commitHash' package.json > tmp.json && \
|
||||
mv tmp.json package.json
|
||||
|
||||
RUN echo "Installing dependencies and building ajna-watcher-ts" && \
|
||||
yarn && yarn build
|
||||
|
||||
@ -1,20 +1,11 @@
|
||||
FROM node:18.16.0-alpine3.16
|
||||
|
||||
RUN apk --update --no-cache add git python3 alpine-sdk jq
|
||||
RUN apk --update --no-cache add git python3 alpine-sdk
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY . .
|
||||
|
||||
# Get the latest Git commit hash and set it in package.json of all watchers
|
||||
RUN COMMIT_HASH=$(git rev-parse HEAD) && \
|
||||
find . -name 'package.json' -exec sh -c ' \
|
||||
for packageFile; do \
|
||||
jq --arg commitHash "$0" ".commitHash = \$commitHash" "$packageFile" > "$packageFile.tmp" && \
|
||||
mv "$packageFile.tmp" "$packageFile"; \
|
||||
done \
|
||||
' "$COMMIT_HASH" {} \;
|
||||
|
||||
RUN echo "Building azimuth-watcher-ts" && \
|
||||
yarn && yarn build
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user