forked from cerc-io/stack-orchestrator
Compare commits
30
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a77f120d0d | ||
|
|
108a5a3440 | ||
|
|
4b04a39faf | ||
|
|
40f362511b | ||
|
|
9cd34ffebb | ||
|
|
515f6d16f5 | ||
|
|
105805cb9b | ||
|
|
62f1962546 | ||
|
|
2a24e71c92 | ||
|
|
c789b82782 | ||
|
|
d2442bcc9b | ||
|
|
b3bc5a19ae | ||
|
|
44faf36837 | ||
|
|
18b006468d | ||
|
|
7f9e1da8ba | ||
|
|
0149346927 | ||
|
|
06de4fe485 | ||
|
|
821d401575 | ||
|
|
5123111db0 | ||
|
|
02c33cb229 | ||
|
|
b4eda902ea | ||
|
|
b4df8104c8 | ||
|
|
07282cdd6e | ||
|
|
e7c935fb78 | ||
|
|
1a636799a6 | ||
|
|
0aa4b350bd | ||
|
|
2252252072 | ||
|
|
c92f15f47c | ||
|
|
fee32ec703 | ||
|
|
fb55c1425e |
@@ -43,3 +43,19 @@ jobs:
|
|||||||
run: ./scripts/build_shiv_package.sh
|
run: ./scripts/build_shiv_package.sh
|
||||||
- name: "Run fixturenet-eth tests"
|
- name: "Run fixturenet-eth tests"
|
||||||
run: ./tests/fixturenet-eth-plugeth/run-test.sh
|
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
|
||||||
|
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 }}
|
||||||
|
|||||||
@@ -47,3 +47,19 @@ jobs:
|
|||||||
sleep 5
|
sleep 5
|
||||||
- name: "Run fixturenet-eth tests"
|
- name: "Run fixturenet-eth tests"
|
||||||
run: ./tests/fixturenet-eth-plugeth/run-test.sh
|
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
|
||||||
|
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 }}
|
||||||
|
|||||||
@@ -45,4 +45,19 @@ jobs:
|
|||||||
sleep 5
|
sleep 5
|
||||||
- name: "Run fixturenet-eth tests"
|
- name: "Run fixturenet-eth tests"
|
||||||
run: ./tests/fixturenet-eth/run-test.sh
|
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 }}
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ on:
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
test:
|
||||||
name: "Run an Laconicd fixturenet test"
|
name: "Run Laconicd fixturenet and Laconic CLI tests"
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 'Update'
|
- name: 'Update'
|
||||||
@@ -46,3 +46,21 @@ jobs:
|
|||||||
run: ./scripts/build_shiv_package.sh
|
run: ./scripts/build_shiv_package.sh
|
||||||
- name: "Run fixturenet-laconicd tests"
|
- name: "Run fixturenet-laconicd tests"
|
||||||
run: ./tests/fixturenet-laconicd/run-test.sh
|
run: ./tests/fixturenet-laconicd/run-test.sh
|
||||||
|
- name: "Run laconic CLI tests"
|
||||||
|
run: ./tests/fixturenet-laconicd/run-cli-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 }}
|
||||||
|
|||||||
@@ -19,3 +19,19 @@ jobs:
|
|||||||
python-version: '3.8'
|
python-version: '3.8'
|
||||||
- name : "Run flake8"
|
- name : "Run flake8"
|
||||||
uses: py-actions/flake8@v2
|
uses: py-actions/flake8@v2
|
||||||
|
- 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 }}
|
||||||
|
|||||||
@@ -54,3 +54,19 @@ jobs:
|
|||||||
# Hack using endsWith to workaround Gitea sometimes sending "publish-test" vs "refs/heads/publish-test"
|
# Hack using endsWith to workaround Gitea sometimes sending "publish-test" vs "refs/heads/publish-test"
|
||||||
draft: ${{ endsWith('publish-test', github.ref ) }}
|
draft: ${{ endsWith('publish-test', github.ref ) }}
|
||||||
files: ./laconic-so
|
files: ./laconic-so
|
||||||
|
- 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 }}
|
||||||
|
|||||||
@@ -51,4 +51,19 @@ jobs:
|
|||||||
source /opt/bash-utils/cgroup-helper.sh
|
source /opt/bash-utils/cgroup-helper.sh
|
||||||
join_cgroup
|
join_cgroup
|
||||||
./tests/container-registry/run-test.sh
|
./tests/container-registry/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 }}
|
||||||
|
|||||||
@@ -49,4 +49,19 @@ jobs:
|
|||||||
source /opt/bash-utils/cgroup-helper.sh
|
source /opt/bash-utils/cgroup-helper.sh
|
||||||
join_cgroup
|
join_cgroup
|
||||||
./tests/database/run-test.sh
|
./tests/database/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 }}
|
||||||
|
|||||||
@@ -47,3 +47,19 @@ jobs:
|
|||||||
sleep 5
|
sleep 5
|
||||||
- name: "Run deploy tests"
|
- name: "Run deploy tests"
|
||||||
run: ./tests/deploy/run-deploy-test.sh
|
run: ./tests/deploy/run-deploy-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 }}
|
||||||
|
|||||||
@@ -51,4 +51,19 @@ jobs:
|
|||||||
source /opt/bash-utils/cgroup-helper.sh
|
source /opt/bash-utils/cgroup-helper.sh
|
||||||
join_cgroup
|
join_cgroup
|
||||||
./tests/k8s-deploy/run-deploy-test.sh
|
./tests/k8s-deploy/run-deploy-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 }}
|
||||||
|
|||||||
@@ -49,3 +49,19 @@ jobs:
|
|||||||
sleep 5
|
sleep 5
|
||||||
- name: "Run webapp tests"
|
- name: "Run webapp tests"
|
||||||
run: ./tests/webapp-test/run-webapp-test.sh
|
run: ./tests/webapp-test/run-webapp-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 }}
|
||||||
|
|||||||
@@ -47,5 +47,19 @@ jobs:
|
|||||||
sleep 5
|
sleep 5
|
||||||
- name: "Run smoke tests"
|
- name: "Run smoke tests"
|
||||||
run: ./tests/smoke-test/run-smoke-test.sh
|
run: ./tests/smoke-test/run-smoke-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 }}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
Change this file to trigger running the fixturenet-laconicd-test CI job
|
Change this file to trigger running the fixturenet-laconicd-test CI job
|
||||||
Trigger
|
Trigger
|
||||||
Trigger
|
Trigger
|
||||||
|
Trigger
|
||||||
|
Trigger
|
||||||
|
Trigger
|
||||||
|
|||||||
@@ -1,271 +0,0 @@
|
|||||||
# Deploying WebApps from the Laconic Registry to Kubernetes
|
|
||||||
|
|
||||||
First, ensure you have `laconicd` and the console running via [this tutorial](./laconicd-with-console.md).
|
|
||||||
|
|
||||||
## Setup Kubernetes
|
|
||||||
|
|
||||||
If merely requesting deployment, access to the Laconic registry is sufficient, but to *process* deployment requests, Kubernetes configuration is also necessary. The configuration format is the same as used by `kubectl`, and should be places in `/etc/config/kube.yml`
|
|
||||||
|
|
||||||
## Setup the Deployer
|
|
||||||
|
|
||||||
### Set envs
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
$DEPLOYMENT_DNS_SUFFIX
|
|
||||||
$DEPLOYMENT_RECORD_NAMESPACE
|
|
||||||
$IMAGE_REGISTRY
|
|
||||||
$IMAGE_REGISTRY_CREDS
|
|
||||||
$IMAGE_REGISTRY_USER
|
|
||||||
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
```
|
|
||||||
laconic-so --stack webapp-deployer-backend setup-repositories
|
|
||||||
laconic-so --stack webapp-deployer-backend build-containers
|
|
||||||
laconic-so --stack webapp-deployer-backend deploy up
|
|
||||||
```
|
|
||||||
|
|
||||||
## Setup Your Account
|
|
||||||
|
|
||||||
Writing to the Laconic Registry, in order to create records for applications and deployment requests, requires a user key, and a bond with adequate funds available.
|
|
||||||
|
|
||||||
### Install the registry CLI
|
|
||||||
|
|
||||||
```
|
|
||||||
npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/
|
|
||||||
npm install -g @cerc-io/laconic-registry-cli
|
|
||||||
```
|
|
||||||
|
|
||||||
Alternatively, use the pre-configured container that was setup alongside `laconicd`
|
|
||||||
|
|
||||||
### Get your private key
|
|
||||||
|
|
||||||
```
|
|
||||||
exec into laconicd
|
|
||||||
```
|
|
||||||
|
|
||||||
### config.yml
|
|
||||||
|
|
||||||
```
|
|
||||||
services:
|
|
||||||
cns:
|
|
||||||
restEndpoint: http://console.laconic.com:1317
|
|
||||||
gqlEndpoint: http://console.laconic.com:9473/api
|
|
||||||
userKey: 3d4789e88508c6230d973ccea283032d3e3948775dbe02f4f0a80dc6c1f7c8d5
|
|
||||||
# bondId: 3c61577f3c6197ced599e2fc21ccf76f43373004fd29c29f2e560c77f7c4bb6d
|
|
||||||
chainId: laconic_9000-1
|
|
||||||
gas: 550000
|
|
||||||
fees: 200000aphoton
|
|
||||||
```
|
|
||||||
|
|
||||||
### Create a bond
|
|
||||||
|
|
||||||
```
|
|
||||||
laconic cns -c config.yml bond create --type aphoton --quantity 1000000000 --gas 200000 --fees 200000aphoton
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Creating Deployments
|
|
||||||
|
|
||||||
Deploying an application from the registry requires (and generates)
|
|
||||||
several records:
|
|
||||||
|
|
||||||
1. An `ApplicationRecord` which describes the application itself, including its name, version, and repository.
|
|
||||||
2. An `ApplicationDeploymentRequest` which references an`ApplicationRecord`, and provides additional information such as the DNS name and configuration.
|
|
||||||
3. A `DnsRecord`, which contains the FQDN of the deployment. The ownership of this record will be checked against any future deployment or removal requests.
|
|
||||||
4. An `ApplicationDeploymentRecord` which records the successful processing of the deployment request.
|
|
||||||
|
|
||||||
Additionally, since names need to be registered, namespace authorities need to be reserved, for example:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns authority reserve my-org-name
|
|
||||||
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns authority bond set my-org-name 0e9176d854bc3c20528b6361aab632f0b252a0f69717bf035fa68d1ef7647ba7
|
|
||||||
```
|
|
||||||
|
|
||||||
## Application Records
|
|
||||||
|
|
||||||
The `ApplicationRecord` should, at a minimum, specify the name of the application (`name`), its version (`app_version`), type (`app_type`), one or more repository URLs (`repository`), and the repository reference (eg, branch, tag, hash, etc.) to use (`repository_ref`).
|
|
||||||
|
|
||||||
```
|
|
||||||
$ cat app.yml
|
|
||||||
record:
|
|
||||||
type: ApplicationRecord
|
|
||||||
version: 0.0.4
|
|
||||||
name: "@my-org-name/my-test-webapp"
|
|
||||||
repository:
|
|
||||||
- "https://github.com/my-org-name/my-test-webapp"
|
|
||||||
repository_ref: "v0.1.5"
|
|
||||||
app_version: "0.1.5"
|
|
||||||
app_type: "webapp"
|
|
||||||
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns record publish -f app.yml
|
|
||||||
bafyreihwvu6ynmk4nfrxg2vdcx2ep3tqry775ksqyehjitj2i4kphhyuky
|
|
||||||
```
|
|
||||||
|
|
||||||
One or more names should be registered for the application, which deployment requests can reference.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns name set "crn://my-org-name/applications/my-test-webapp" bafyreihwvu6ynmk4nfrxg2vdcx2ep3tqry775ksqyehjitj2i4kphhyuky
|
|
||||||
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns name set "crn://my-org-name/applications/my-test-webapp@0.1.5" bafyreihwvu6ynmk4nfrxg2vdcx2ep3tqry775ksqyehjitj2i4kphhyuky
|
|
||||||
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns record get --id bafyreihwvu6ynmk4nfrxg2vdcx2ep3tqry775ksqyehjitj2i4kphhyuky
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": "bafyreihwvu6ynmk4nfrxg2vdcx2ep3tqry775ksqyehjitj2i4kphhyuky",
|
|
||||||
"names": [
|
|
||||||
"crn://my-org-name/applications/my-test-webapp",
|
|
||||||
"crn://my-org-name/applications/my-test-webapp@0.1.5",
|
|
||||||
],
|
|
||||||
"owners": [
|
|
||||||
"2671D38525BDC91A5DF4794EF2059D5771133702"
|
|
||||||
],
|
|
||||||
"bondId": "0e9176d854bc3c20528b6361aab632f0b252a0f69717bf035fa68d1ef7647ba7",
|
|
||||||
"createTime": "2024-01-12T20:30:33Z",
|
|
||||||
"expiryTime": "2025-01-11T20:30:33Z",
|
|
||||||
"attributes": {
|
|
||||||
"app_type": "webapp",
|
|
||||||
"app_version": "0.1.5",
|
|
||||||
"name": "@my-org-name/my-test-webapp",
|
|
||||||
"repository": [
|
|
||||||
"https://github.com/my-org-name/my-test-webapp"
|
|
||||||
],
|
|
||||||
"repository_ref": "v0.1.5",
|
|
||||||
"type": "ApplicationRecord",
|
|
||||||
"version": "0.0.4"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
## Application Deployment Requests
|
|
||||||
|
|
||||||
To create the deployment of specific application, and `ApplicationDeploymentRequest` must be published. This request must reference the application to be deployed (`application`) and may optionally provide configuration (`config`) and a DNS name (`dns`). If no DNS name is supplied, one will be generated. A supplied DNS is usually just the short hostname, not the FQDN, since the suffix is supplied by the deployer.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ cat req.yml
|
|
||||||
record:
|
|
||||||
type: ApplicationDeploymentRequest
|
|
||||||
version: 1.0.0
|
|
||||||
name: "my-org-name/my-test-webapp@0.1.5"
|
|
||||||
application: "crn://my-org-name/applications/my-test-webapp@0.1.5"
|
|
||||||
dns: "my-test-app"
|
|
||||||
config:
|
|
||||||
env:
|
|
||||||
CERC_WEBAPP_DEBUG: my_debug_value_here
|
|
||||||
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns record publish -f req.yml
|
|
||||||
bafyreihtpvwjka5ecjmca46y4dip5gb2h25vvmc7t27d7g4zecngjssvky
|
|
||||||
```
|
|
||||||
|
|
||||||
It is not necessary to assign a name to the request.
|
|
||||||
|
|
||||||
## Building and Deploying
|
|
||||||
|
|
||||||
Building and deploying will happen automatically for records published the production registry, but in other environments it can be triggered manually.
|
|
||||||
|
|
||||||
Laconic `stack-orchestrator` is used build and launch the application. It will clone the repository, build the application, upload the container to a registry, and launch the instance in Kubernetes, with
|
|
||||||
automatic DNS and TLS provisioning.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic-so deploy-webapp-from-registry \
|
|
||||||
--kube-config $KUBE_CONFIG \
|
|
||||||
--image-registry registry.mydeployer.org/app-registry \
|
|
||||||
--deployment-parent-dir /opt/deployments \
|
|
||||||
--laconic-config $LACONIC_CONFIG \
|
|
||||||
--dns-suffix mydeployer.servesthe.world \
|
|
||||||
--record-namespace-dns crn://my-deployer-org/dns \
|
|
||||||
--record-namespace-deployments crn://my-deployer-org/deployments \
|
|
||||||
--request-id bafyreihtpvwjka5ecjmca46y4dip5gb2h25vvmc7t27d7g4zecngjssvky
|
|
||||||
```
|
|
||||||
|
|
||||||
When deployment is complete, an `ApplicationDeploymentRecord` will be created:
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns name resolve crn://my-deployer-org/deployments/my-test-app.mydeployer.servesthe.world
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": "bafyreiemfmxsue4svzys6tcwsqmhfjeyoo3gp63n7kydi2izbrwuzd4rga",
|
|
||||||
"names": [
|
|
||||||
"crn://my-deployer-org/deployments/my-test-app.laconic.servesthe.world"
|
|
||||||
],
|
|
||||||
"owners": [
|
|
||||||
"2671D38525BDC91A5DF4794EF2059D5771133702"
|
|
||||||
],
|
|
||||||
"bondId": "0e9176d854bc3c20528b6361aab632f0b252a0f69717bf035fa68d1ef7647ba7",
|
|
||||||
"createTime": "2024-01-11T20:45:29Z",
|
|
||||||
"expiryTime": "2025-01-10T20:45:29Z",
|
|
||||||
"attributes": {
|
|
||||||
"application": "bafyreibs6y7jhgjlsoxyqlugvkweanp3bi7ippfmhehk2rslcpoaqic2xi",
|
|
||||||
"dns": "bafyreicpac7tar5ua5e42zo7d5zwyp5yv7iord23p3gdox7zdfslrarjle",
|
|
||||||
"meta": {
|
|
||||||
"config": "da39a3ee5e6b4b0d3255bfef95601890afd80709",
|
|
||||||
"so": "82a5f9a3e4924cbb92e28be68759a487"
|
|
||||||
},
|
|
||||||
"name": "@cerc-io/my-test-webapp",
|
|
||||||
"request": "bafyreiex7vmtruiiasra4wvqe7wirl6iuwiso6p3cvb3sjhq55e74zh4ke",
|
|
||||||
"type": "ApplicationDeploymentRecord",
|
|
||||||
"url": "https://my-test-app.mydeployer.servesthe.world",
|
|
||||||
"version": "0.0.1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
## Checking Status
|
|
||||||
|
|
||||||
The status of the deployment may be checked with `stack-orchestrator`.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic-so deployment --dir /opt/deployments/my-test-app.snowball.servesthe.world status
|
|
||||||
Ingress:
|
|
||||||
Hostname: my-test-app.mydeployer.servesthe.world
|
|
||||||
IP: 204.130.133.199
|
|
||||||
TLS: notBefore: 2024-01-12T23:11:09Z, notAfter: 2024-04-11T23:11:08Z
|
|
||||||
|
|
||||||
Pods:
|
|
||||||
default/laconic-9560ffc64512e453-deployment-fb58d756f-l77pm: Running (2024-01-13 00:10:42+00:00)
|
|
||||||
```
|
|
||||||
|
|
||||||
# Removing Deployments
|
|
||||||
|
|
||||||
As with deployment, removal involves publishing a request, which is then fulfilled by deployment processor.
|
|
||||||
|
|
||||||
## Application Deployment Removal Requests
|
|
||||||
|
|
||||||
```
|
|
||||||
$ cat apprm.yml
|
|
||||||
record:
|
|
||||||
type: ApplicationDeploymentRemovalRequest
|
|
||||||
version: 1.0.0
|
|
||||||
deployment: bafyreiemfmxsue4svzys6tcwsqmhfjeyoo3gp63n7kydi2izbrwuzd4rga
|
|
||||||
|
|
||||||
$ laconic -c $LACONIC_CONFIG cns record publish -f apprm.yml
|
|
||||||
bafyreiejnqhsn5ibc3c6pzlsc26co3mt63djdeuntt3gmfuckcntdmisge
|
|
||||||
```
|
|
||||||
|
|
||||||
## Removal
|
|
||||||
|
|
||||||
As with deployment, for records publish to the production service removal should be processed automatically. In other environments, removal can be processed with `stack-orchestrator`.
|
|
||||||
|
|
||||||
```
|
|
||||||
$ laconic-so undeploy-webapp-from-registry \
|
|
||||||
--deployment-parent-dir /opt/deployments \
|
|
||||||
--laconic-config ~/.laconic/local.yml \
|
|
||||||
--request-id bafyreiejnqhsn5ibc3c6pzlsc26co3mt63djdeuntt3gmfuckcntdmisge
|
|
||||||
|
|
||||||
Request bafyreiejnqhsn5ibc3c6pzlsc26co3mt63djdeuntt3gmfuckcntdmisge needs to processed.
|
|
||||||
Found 1 unsatisfied request(s) to process.
|
|
||||||
Matched deployment ownership: 2671D38525BDC91A5DF4794EF2059D5771133702
|
|
||||||
record:
|
|
||||||
type: ApplicationDeploymentRemovalRecord
|
|
||||||
deployment: bafyreiemfmxsue4svzys6tcwsqmhfjeyoo3gp63n7kydi2izbrwuzd4rga
|
|
||||||
request: bafyreiejnqhsn5ibc3c6pzlsc26co3mt63djdeuntt3gmfuckcntdmisge
|
|
||||||
version: 1.0.0
|
|
||||||
```
|
|
||||||
@@ -0,0 +1,80 @@
|
|||||||
|
|
||||||
|
# From: https://raw.githubusercontent.com/blast-io/deployment/master/docker-compose.yml
|
||||||
|
services:
|
||||||
|
# generate jwt.txt if it's absent
|
||||||
|
generate-jwt:
|
||||||
|
image: blastio/openssl
|
||||||
|
volumes:
|
||||||
|
- blast-data:/blast:rw
|
||||||
|
command: >
|
||||||
|
sh -c "[ ! -f /blast/jwt.txt ] && openssl rand -hex 32 | tr -d '\n' > /blast/jwt.txt || exit 0"
|
||||||
|
# initialise geth db
|
||||||
|
geth-init:
|
||||||
|
image: blastio/blast-geth:${NETWORK:-testnet-sepolia}
|
||||||
|
volumes:
|
||||||
|
- blast-data:/blast:rw
|
||||||
|
- ../config/fixturenet-blast/genesis.json:/blast/genesis.json
|
||||||
|
entrypoint: /bin/sh
|
||||||
|
command: >
|
||||||
|
-c "[ ! -d /blast/${GETH_DATA_DIR:-blast-geth-data}/geth ] && /usr/local/bin/geth init --datadir=/blast/${GETH_DATA_DIR:-blast-geth-data} /blast/genesis.json || exit 0"
|
||||||
|
depends_on:
|
||||||
|
generate-jwt:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
env_file:
|
||||||
|
- ../config/fixturenet-blast/${NETWORK:-fixturenet}.config
|
||||||
|
blast-geth:
|
||||||
|
image: blastio/blast-geth:${NETWORK:-testnet-sepolia}
|
||||||
|
volumes:
|
||||||
|
- blast-data:/blast
|
||||||
|
ports:
|
||||||
|
- "9545"
|
||||||
|
- "9546"
|
||||||
|
command: >
|
||||||
|
--datadir=/blast/${GETH_DATA_DIR:-blast-geth-data}
|
||||||
|
--http
|
||||||
|
--http.corsdomain="*"
|
||||||
|
--http.vhosts="*"
|
||||||
|
--http.addr=0.0.0.0
|
||||||
|
--http.port=9545
|
||||||
|
--http.api=web3,debug,eth,txpool,net,engine
|
||||||
|
--ws
|
||||||
|
--ws.addr=0.0.0.0
|
||||||
|
--ws.port=9546
|
||||||
|
--ws.origins="*"
|
||||||
|
--ws.api=debug,eth,txpool,net,engine
|
||||||
|
--authrpc.addr="0.0.0.0"
|
||||||
|
--authrpc.port="8551"
|
||||||
|
--authrpc.vhosts="*"
|
||||||
|
--authrpc.jwtsecret=/blast/jwt.txt
|
||||||
|
--syncmode=full
|
||||||
|
--gcmode=archive
|
||||||
|
--nodiscover
|
||||||
|
--maxpeers=0
|
||||||
|
--rollup.disabletxpoolgossip=true
|
||||||
|
env_file:
|
||||||
|
- ../config/fixturenet-blast/${NETWORK:-fixturenet}.config
|
||||||
|
depends_on:
|
||||||
|
geth-init:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
op-node:
|
||||||
|
image: blastio/blast-optimism:${NETWORK:-testnet-sepolia}
|
||||||
|
volumes:
|
||||||
|
- blast-data:/blast
|
||||||
|
- ../config/fixturenet-blast/rollup.json:/blast/rollup.json
|
||||||
|
ports:
|
||||||
|
- "9003"
|
||||||
|
command: >
|
||||||
|
op-node
|
||||||
|
--l1="${CERC_L1_RPC}"
|
||||||
|
--l1.rpckind="any"
|
||||||
|
--l1.trustrpc=true
|
||||||
|
--l2="http://blast-geth:8551"
|
||||||
|
--l2.jwt-secret=/blast/jwt.txt
|
||||||
|
--rollup.config="/blast/rollup.json"
|
||||||
|
depends_on:
|
||||||
|
- blast-geth
|
||||||
|
env_file:
|
||||||
|
- ../config/fixturenet-blast/${NETWORK:-fixturenet}.config
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
blast-data:
|
||||||
@@ -3,6 +3,9 @@ services:
|
|||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: cerc/laconicd:local
|
image: cerc/laconicd:local
|
||||||
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||||
|
environment:
|
||||||
|
TEST_AUCTION_ENABLED: ${TEST_AUCTION_ENABLED}
|
||||||
|
TEST_REGISTRY_EXPIRY: ${TEST_REGISTRY_EXPIRY}
|
||||||
volumes:
|
volumes:
|
||||||
# The cosmos-sdk node's database directory:
|
# The cosmos-sdk node's database directory:
|
||||||
- laconicd-data:/root/.laconicd
|
- laconicd-data:/root/.laconicd
|
||||||
@@ -25,6 +28,7 @@ services:
|
|||||||
image: cerc/laconic-registry-cli:local
|
image: cerc/laconic-registry-cli:local
|
||||||
volumes:
|
volumes:
|
||||||
- ../config/fixturenet-laconicd/registry-cli-config-template.yml:/registry-cli-config-template.yml
|
- ../config/fixturenet-laconicd/registry-cli-config-template.yml:/registry-cli-config-template.yml
|
||||||
|
- ${BASE_DIR:-~/cerc}/laconic-registry-cli:/laconic-registry-cli
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
laconicd-data:
|
laconicd-data:
|
||||||
|
|||||||
@@ -0,0 +1,86 @@
|
|||||||
|
|
||||||
|
# From: https://raw.githubusercontent.com/blast-io/deployment/master/docker-compose.yml
|
||||||
|
services:
|
||||||
|
# generate jwt.txt if it's absent
|
||||||
|
generate-jwt:
|
||||||
|
image: blastio/openssl
|
||||||
|
volumes:
|
||||||
|
- blast-data:/blast:rw
|
||||||
|
command: >
|
||||||
|
sh -c "[ ! -f /blast/jwt.txt ] && openssl rand -hex 32 | tr -d '\n' > /blast/jwt.txt || exit 0"
|
||||||
|
# initialise geth db
|
||||||
|
geth-init:
|
||||||
|
image: blastio/blast-geth:${NETWORK:-mainnet}
|
||||||
|
volumes:
|
||||||
|
- blast-data:/blast:rw
|
||||||
|
entrypoint: /bin/sh
|
||||||
|
command: >
|
||||||
|
-c "[ ! -d /blast/${GETH_DATA_DIR:-blast-geth-data}/geth ] && /usr/local/bin/geth init --datadir=/blast/${GETH_DATA_DIR:-blast-geth-data} /blast/genesis.json || exit 0"
|
||||||
|
depends_on:
|
||||||
|
generate-jwt:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
env_file:
|
||||||
|
- ../config/mainnet-blast/${NETWORK:-mainnet}.config
|
||||||
|
blast-geth:
|
||||||
|
image: blastio/blast-geth:${NETWORK:-mainnet}
|
||||||
|
volumes:
|
||||||
|
- blast-data:/blast
|
||||||
|
ports:
|
||||||
|
- "9545"
|
||||||
|
- "9546"
|
||||||
|
- "6060"
|
||||||
|
command: >
|
||||||
|
--datadir=/blast/${GETH_DATA_DIR:-blast-geth-data}
|
||||||
|
--http
|
||||||
|
--http.corsdomain="*"
|
||||||
|
--http.vhosts="*"
|
||||||
|
--http.addr=0.0.0.0
|
||||||
|
--http.port=9545
|
||||||
|
--http.api=web3,debug,eth,txpool,net,engine
|
||||||
|
--ws
|
||||||
|
--ws.addr=0.0.0.0
|
||||||
|
--ws.port=9546
|
||||||
|
--ws.origins="*"
|
||||||
|
--ws.api=debug,eth,txpool,net,engine
|
||||||
|
--authrpc.addr="0.0.0.0"
|
||||||
|
--authrpc.port="8551"
|
||||||
|
--authrpc.vhosts="*"
|
||||||
|
--authrpc.jwtsecret=/blast/jwt.txt
|
||||||
|
--syncmode=full
|
||||||
|
--metrics
|
||||||
|
--metrics.addr=0.0.0.0
|
||||||
|
--gcmode=archive
|
||||||
|
--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:
|
||||||
|
geth-init:
|
||||||
|
condition: service_completed_successfully
|
||||||
|
op-node:
|
||||||
|
image: blastio/blast-optimism:${NETWORK:-mainnet}
|
||||||
|
volumes:
|
||||||
|
- blast-data:/blast
|
||||||
|
ports:
|
||||||
|
- "9003"
|
||||||
|
- "7300"
|
||||||
|
command: >
|
||||||
|
op-node
|
||||||
|
--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="${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:
|
||||||
|
- ../config/mainnet-blast/${NETWORK:-mainnet}.config
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
blast-data:
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
GETH_ROLLUP_SEQUENCERHTTP=https://sequencer.s2.testblast.io
|
||||||
|
OP_NODE_P2P_BOOTNODES=enr:-J-4QM3GLUFfKMSJQuP1UvuKQe8DyovE7Eaiit0l6By4zjTodkR4V8NWXJxNmlg8t8rP-Q-wp3jVmeAOml8cjMj__ROGAYznzb_HgmlkgnY0gmlwhA-cZ_eHb3BzdGFja4X947FQAIlzZWNwMjU2azGhAiuDqvB-AsVSRmnnWr6OHfjgY8YfNclFy9p02flKzXnOg3RjcIJ2YYN1ZHCCdmE,enr:-J-4QDCVpByqQ8nFqCS9aHicqwUfXgzFDslvpEyYz19lvkHLIdtcIGp2d4q5dxHdjRNTO6HXCsnIKxUeuZSPcEbyVQCGAYznzz0RgmlkgnY0gmlwhANiQfuHb3BzdGFja4X947FQAIlzZWNwMjU2azGhAy3AtF2Jh_aPdOohg506Hjmtx-fQ1AKmu71C7PfkWAw9g3RjcIJ2YYN1ZHCCdmE
|
||||||
@@ -0,0 +1,57 @@
|
|||||||
|
{
|
||||||
|
"config": {
|
||||||
|
"chainId": 608943043,
|
||||||
|
"homesteadBlock": 0,
|
||||||
|
"eip150Block": 0,
|
||||||
|
"eip155Block": 0,
|
||||||
|
"eip158Block": 0,
|
||||||
|
"byzantiumBlock": 0,
|
||||||
|
"constantinopleBlock": 0,
|
||||||
|
"petersburgBlock": 0,
|
||||||
|
"istanbulBlock": 0,
|
||||||
|
"muirGlacierBlock": 0,
|
||||||
|
"berlinBlock": 0,
|
||||||
|
"londonBlock": 0,
|
||||||
|
"arrowGlacierBlock": 0,
|
||||||
|
"grayGlacierBlock": 0,
|
||||||
|
"mergeNetsplitBlock": 0,
|
||||||
|
"shanghaiTime": 0,
|
||||||
|
"bedrockBlock": 0,
|
||||||
|
"regolithTime": 0,
|
||||||
|
"canyonTime": 0,
|
||||||
|
"terminalTotalDifficulty": 0,
|
||||||
|
"terminalTotalDifficultyPassed": true,
|
||||||
|
"optimism": {
|
||||||
|
"eip1559Elasticity": 6,
|
||||||
|
"eip1559Denominator": 50,
|
||||||
|
"eip1559DenominatorCanyon": 250
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"alloc": {
|
||||||
|
"0000000000000000000000000000000000000000": {
|
||||||
|
"balance": "0x1"
|
||||||
|
},
|
||||||
|
"4200000000000000000000000000000000000000": {
|
||||||
|
"code": "0x60806040526004361061004e5760003560e01c80633659cfe6146100655780634f1ef286146100855780635c60da1b146100ae5780638f283970146100db578063f851a440146100fb5761005d565b3661005d5761005b610110565b005b61005b610110565b34801561007157600080fd5b5061005b610080366004610521565b6101c8565b61009861009336600461053c565b61020e565b6040516100a591906105bf565b60405180910390f35b3480156100ba57600080fd5b506100c361033e565b6040516001600160a01b0390911681526020016100a5565b3480156100e757600080fd5b5061005b6100f6366004610521565b6103a9565b34801561010757600080fd5b506100c36103e4565b600061013a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b90506001600160a01b0381166101a55760405162461bcd60e51b815260206004820152602560248201527f50726f78793a20696d706c656d656e746174696f6e206e6f7420696e697469616044820152641b1a5e995960da1b60648201526084015b60405180910390fd5b3660008037600080366000845af43d6000803e806101c2573d6000fd5b503d6000f35b600080516020610625833981519152546001600160a01b0316336001600160a01b031614806101f5575033155b156102065761020381610432565b50565b610203610110565b60606102266000805160206106258339815191525490565b6001600160a01b0316336001600160a01b03161480610243575033155b1561032f5761025184610432565b600080856001600160a01b0316858560405161026e929190610614565b600060405180830381855af49150503d80600081146102a9576040519150601f19603f3d011682016040523d82523d6000602084013e6102ae565b606091505b5091509150816103265760405162461bcd60e51b815260206004820152603960248201527f50726f78793a2064656c656761746563616c6c20746f206e657720696d706c6560448201527f6d656e746174696f6e20636f6e7472616374206661696c656400000000000000606482015260840161019c565b91506103379050565b610337610110565b9392505050565b60006103566000805160206106258339815191525490565b6001600160a01b0316336001600160a01b03161480610373575033155b1561039e57507f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc5490565b6103a6610110565b90565b600080516020610625833981519152546001600160a01b0316336001600160a01b031614806103d6575033155b15610206576102038161048e565b60006103fc6000805160206106258339815191525490565b6001600160a01b0316336001600160a01b03161480610419575033155b1561039e57506000805160206106258339815191525490565b7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc8181556040516001600160a01b038316907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a25050565b60006104a66000805160206106258339815191525490565b600080516020610625833981519152838155604080516001600160a01b0380851682528616602082015292935090917f7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f910160405180910390a1505050565b80356001600160a01b038116811461051c57600080fd5b919050565b60006020828403121561053357600080fd5b61033782610505565b60008060006040848603121561055157600080fd5b61055a84610505565b9250602084013567ffffffffffffffff8082111561057757600080fd5b818601915086601f83011261058b57600080fd5b81358181111561059a57600080fd5b8760208285010111156105ac57600080fd5b6020830194508093505050509250925092565b600060208083528351808285015260005b818110156105ec578581018301518582016040015282016105d0565b818111156105fe576000604083870101525b50601f01601f1916929092016040019392505050565b818382376000910190815291905056feb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103a164736f6c634300080f000a",
|
||||||
|
"storage": {
|
||||||
|
"0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc": "0x000000000000000000000000c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d3c0d30000",
|
||||||
|
"0xb53127684a568b3173ae13b9f8a6016e243e63b6e8ee1178d6a717850b5d6103": "0x0000000000000000000000004200000000000000000000000000000000000018"
|
||||||
|
},
|
||||||
|
"balance": "0x0",
|
||||||
|
"flags": 1
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"nonce": "0x0",
|
||||||
|
"timestamp": "0x659b7460",
|
||||||
|
"extraData": "0x424544524f434b",
|
||||||
|
"gasLimit": "0x1c9c380",
|
||||||
|
"difficulty": "0x0",
|
||||||
|
"mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"coinbase": "0x4200000000000000000000000000000000000011",
|
||||||
|
"number": "0x0",
|
||||||
|
"gasUsed": "0x0",
|
||||||
|
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
|
||||||
|
"baseFeePerGas": "0x3b9aca00",
|
||||||
|
"excessBlobGas": null,
|
||||||
|
"blobGasUsed": null
|
||||||
|
}
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
{
|
||||||
|
"genesis": {
|
||||||
|
"l1": {
|
||||||
|
"hash": "0x17728cf4d8e0b4f292d2390a869fd7c632d39e72efb00ca3462b4387c6aa2437",
|
||||||
|
"number": 5044255
|
||||||
|
},
|
||||||
|
"l2": {
|
||||||
|
"hash": "0x26a1c0faad7b041f34569a1bb383f00ab74b335883a44bed53e9f41ced5fd906",
|
||||||
|
"number": 0
|
||||||
|
},
|
||||||
|
"l2_time": 1704686688,
|
||||||
|
"system_config": {
|
||||||
|
"batcherAddr": "0xba26fee2fa917443e05e65de8d4350bcd2f59222",
|
||||||
|
"overhead": "0x00000000000000000000000000000000000000000000000000000000000000bc",
|
||||||
|
"scalar": "0x00000000000000000000000000000000000000000000000000000000000a6fe0",
|
||||||
|
"gasLimit": 30000000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"block_time": 2,
|
||||||
|
"max_sequencer_drift": 600,
|
||||||
|
"seq_window_size": 3600,
|
||||||
|
"channel_timeout": 300,
|
||||||
|
"l1_chain_id": 11155111,
|
||||||
|
"l2_chain_id": 608943043,
|
||||||
|
"regolith_time": 0,
|
||||||
|
"canyon_time": 0,
|
||||||
|
"batch_inbox_address": "0x1c3b85a2108784eab6a4bf56cdd6f722e415b331",
|
||||||
|
"deposit_contract_address": "0x2757e4430e694f27b73ec9c02257cab3a498c8c5",
|
||||||
|
"l1_system_config_address": "0x329faf078c364a316e08bf6a17b7eee6ae75a613",
|
||||||
|
"protocol_versions_address": "0x0000000000000000000000000000000000000000"
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,32 @@
|
|||||||
|
POSTGRES_DB=keycloak
|
||||||
|
POSTGRES_USER=keycloak
|
||||||
|
POSTGRES_PASSWORD=keycloak
|
||||||
|
# Don't change this unless you also change the healthcheck in docker-compose-mainnet-eth-keycloak.yml
|
||||||
|
PGPORT=35432
|
||||||
|
KC_DB=postgres
|
||||||
|
KC_DB_URL_HOST=keycloak-db
|
||||||
|
KC_DB_URL_PORT=${PGPORT}
|
||||||
|
KC_DB_URL_DATABASE=${POSTGRES_DB}
|
||||||
|
KC_DB_USERNAME=${POSTGRES_USER}
|
||||||
|
KC_DB_PASSWORD=${POSTGRES_PASSWORD}
|
||||||
|
KC_DB_SCHEMA=public
|
||||||
|
KC_HOSTNAME=localhost
|
||||||
|
KC_HTTP_ENABLED="true"
|
||||||
|
KC_HTTP_RELATIVE_PATH="/auth"
|
||||||
|
KC_HOSTNAME_STRICT_HTTPS="false"
|
||||||
|
KEYCLOAK_ADMIN=admin
|
||||||
|
KEYCLOAK_ADMIN_PASSWORD=admin
|
||||||
|
X_API_CHECK_REALM=cerc
|
||||||
|
X_API_CHECK_CLIENT_ID="%user_id%"
|
||||||
|
|
||||||
|
|
||||||
|
# keycloak-reg-api
|
||||||
|
CERC_KCUSERREG_LISTEN_PORT=9292
|
||||||
|
CERC_KCUSERREG_LISTEN_ADDR='0.0.0.0'
|
||||||
|
CERC_KCUSERREG_API_URL='http://keycloak:8080/auth'
|
||||||
|
CERC_KCUSERREG_REG_USER="${KEYCLOAK_ADMIN}"
|
||||||
|
CERC_KCUSERREG_REG_PW="${KEYCLOAK_ADMIN_PASSWORD}"
|
||||||
|
CERC_KCUSERREG_REG_CLIENT_ID='admin-cli'
|
||||||
|
CERC_KCUSERREG_TARGET_REALM=cerc
|
||||||
|
CERC_KCUSERREG_TARGET_GROUPS=eth
|
||||||
|
CERC_KCUSERREG_CREATE_ENABLED=true
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
# Enable startup script debug output.
|
||||||
|
CERC_SCRIPT_DEBUG=false
|
||||||
|
|
||||||
|
# Specify any other lighthouse CLI options.
|
||||||
|
LIGHTHOUSE_OPTS=""
|
||||||
|
|
||||||
|
# Override the advertised public IP (optional)
|
||||||
|
# --enr-address
|
||||||
|
#LIGHTHOUSE_ENR_ADDRESS=""
|
||||||
|
|
||||||
|
# --checkpoint-sync-url
|
||||||
|
LIGHTHOUSE_CHECKPOINT_SYNC_URL="https://beaconstate.ethstaker.cc"
|
||||||
|
|
||||||
|
# --checkpoint-sync-url-timeout
|
||||||
|
LIGHTHOUSE_CHECKPOINT_SYNC_URL_TIMEOUT=300
|
||||||
|
|
||||||
|
# --datadir
|
||||||
|
LIGHTHOUSE_DATADIR=/data
|
||||||
|
|
||||||
|
# --debug-level
|
||||||
|
LIGHTHOUSE_DEBUG_LEVEL=info
|
||||||
|
|
||||||
|
# --http-port
|
||||||
|
LIGHTHOUSE_HTTP_PORT=5052
|
||||||
|
|
||||||
|
# --execution-jwt
|
||||||
|
LIGHTHOUSE_JWTSECRET=/etc/mainnet-eth/jwtsecret
|
||||||
|
|
||||||
|
# --metrics-port
|
||||||
|
LIGHTHOUSE_METRICS_PORT=5054
|
||||||
|
|
||||||
|
# --port --enr-udp-port --enr-tcp-port
|
||||||
|
LIGHTHOUSE_NETWORK_PORT=9000
|
||||||
@@ -0,0 +1,2 @@
|
|||||||
|
GETH_ROLLUP_SEQUENCERHTTP=https://sequencer.blast.io
|
||||||
|
OP_NODE_P2P_BOOTNODES=enr:-J64QGwHl9uYLfC_cnmxSA6wQH811nkOWJDWjzxqkEUlJoZHWvI66u-BXgVcPCeMUmg0dBpFQAPotFchG67FHJMZ9OSGAY3d6wevgmlkgnY0gmlwhANizeSHb3BzdGFja4Sx_AQAiXNlY3AyNTZrMaECg4pk0cskPAyJ7pOmo9E6RqGBwV-Lex4VS9a3MQvu7PWDdGNwgnZhg3VkcIJ2YQ,enr:-J64QDge2jYBQtcNEpRqmKfci5E5BHAhNBjgv4WSdwH1_wPqbueq2bDj38-TSW8asjy5lJj1Xftui6Or8lnaYFCqCI-GAY3d6wf3gmlkgnY0gmlwhCO2D9yHb3BzdGFja4Sx_AQAiXNlY3AyNTZrMaEDo4aCTq7pCEN8om9U5n_VyWdambGnQhwHNwKc8o-OicaDdGNwgnZhg3VkcIJ2YQ
|
||||||
@@ -0,0 +1,32 @@
|
|||||||
|
{
|
||||||
|
"genesis": {
|
||||||
|
"l1": {
|
||||||
|
"hash": "0xfcfb8d586bdae763f1189988789211c69eb893a895e7ba48be3ca6289f0941b7",
|
||||||
|
"number": 19300102
|
||||||
|
},
|
||||||
|
"l2": {
|
||||||
|
"hash": "0xb689b35ef29d0bec5816938e0e52683c7257d2e325420ea69b739a2be4754b89",
|
||||||
|
"number": 0
|
||||||
|
},
|
||||||
|
"l2_time": 1708809815,
|
||||||
|
"system_config": {
|
||||||
|
"batcherAddr": "0x415c8893d514f9bc5211d36eeda4183226b84aa7",
|
||||||
|
"overhead": "0x00000000000000000000000000000000000000000000000000000000000000bc",
|
||||||
|
"scalar": "0x00000000000000000000000000000000000000000000000000000000000a6fe0",
|
||||||
|
"gasLimit": 30000000
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"block_time": 2,
|
||||||
|
"max_sequencer_drift": 600,
|
||||||
|
"seq_window_size": 3600,
|
||||||
|
"channel_timeout": 300,
|
||||||
|
"l1_chain_id": 1,
|
||||||
|
"l2_chain_id": 81457,
|
||||||
|
"regolith_time": 0,
|
||||||
|
"canyon_time": 0,
|
||||||
|
"batch_inbox_address": "0xff00000000000000000000000000000000081457",
|
||||||
|
"deposit_contract_address": "0x0ec68c5b10f21effb74f2a5c61dfe6b08c0db6cb",
|
||||||
|
"l1_system_config_address": "0x5531dcff39ec1ec727c4c5d2fc49835368f805a9",
|
||||||
|
"protocol_versions_address": "0x0000000000000000000000000000000000000000"
|
||||||
|
}
|
||||||
|
|
||||||
@@ -0,0 +1,30 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
if [[ "true" == "$CERC_SCRIPT_DEBUG" ]]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
ENR_OPTS=""
|
||||||
|
if [[ -n "$LIGHTHOUSE_ENR_ADDRESS" ]]; then
|
||||||
|
ENR_OPTS="--enr-address $LIGHTHOUSE_ENR_ADDRESS"
|
||||||
|
fi
|
||||||
|
|
||||||
|
exec lighthouse bn \
|
||||||
|
--checkpoint-sync-url "$LIGHTHOUSE_CHECKPOINT_SYNC_URL" \
|
||||||
|
--checkpoint-sync-url-timeout ${LIGHTHOUSE_CHECKPOINT_SYNC_URL_TIMEOUT} \
|
||||||
|
--datadir "$LIGHTHOUSE_DATADIR" \
|
||||||
|
--debug-level $LIGHTHOUSE_DEBUG_LEVEL \
|
||||||
|
--disable-deposit-contract-sync \
|
||||||
|
--disable-upnp \
|
||||||
|
--enr-tcp-port $LIGHTHOUSE_NETWORK_PORT \
|
||||||
|
--enr-udp-port $LIGHTHOUSE_NETWORK_PORT \
|
||||||
|
--execution-endpoint "$LIGHTHOUSE_EXECUTION_ENDPOINT" \
|
||||||
|
--execution-jwt /etc/mainnet-eth/jwtsecret \
|
||||||
|
--http \
|
||||||
|
--http-address 0.0.0.0 \
|
||||||
|
--http-port $LIGHTHOUSE_HTTP_PORT \
|
||||||
|
--metrics \
|
||||||
|
--metrics-address=0.0.0.0 \
|
||||||
|
--metrics-port $LIGHTHOUSE_METRICS_PORT \
|
||||||
|
--network mainnet \
|
||||||
|
--port $LIGHTHOUSE_NETWORK_PORT \
|
||||||
|
$ENR_OPTS $LIGHTHOUSE_OPTS
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
host = "0.0.0.0"
|
host = "0.0.0.0"
|
||||||
port = 3008
|
port = 3008
|
||||||
kind = "active"
|
kind = "active"
|
||||||
gqlPath = "/graphql"
|
gqlPath = "/"
|
||||||
|
|
||||||
# Checkpointing state.
|
# Checkpointing state.
|
||||||
checkpointing = true
|
checkpointing = true
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
|||||||
set -x
|
set -x
|
||||||
fi
|
fi
|
||||||
|
|
||||||
registry_command="laconic registry"
|
registry_command="laconic cns"
|
||||||
demo_records_dir="scripts/demo-records"
|
demo_records_dir="scripts/demo-records"
|
||||||
|
|
||||||
# Check we have funds
|
# Check we have funds
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ version: "1.0"
|
|||||||
name: ajna
|
name: ajna
|
||||||
description: "Ajna watcher stack"
|
description: "Ajna watcher stack"
|
||||||
repos:
|
repos:
|
||||||
- git.vdb.to/cerc-io/ajna-watcher-ts
|
- git.vdb.to/cerc-io/ajna-watcher-ts@v0.1.1
|
||||||
containers:
|
containers:
|
||||||
- cerc/watcher-ajna
|
- cerc/watcher-ajna
|
||||||
pods:
|
pods:
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Blast stack
|
||||||
|
|
||||||
|
## Clone required repositories
|
||||||
|
```
|
||||||
|
$ laconic-so --stack fixturenet-blast setup-repositories
|
||||||
|
```
|
||||||
|
## Build the stack's containers
|
||||||
|
```
|
||||||
|
$ laconic-so --stack fixturenet-blast build-containers
|
||||||
|
```
|
||||||
|
## Create a deployment of the stack
|
||||||
|
```
|
||||||
|
$ laconic-so --stack fixturenet-blast deploy init --map-ports-to-host any-same --output blast-spec.yml
|
||||||
|
```
|
||||||
|
[Insert details on how to configure the stack]
|
||||||
|
```
|
||||||
|
$ laconic-so --stack fixturenet-blast deploy create --deployment-dir blast-deployment --spec-file blast-spec.yml
|
||||||
|
```
|
||||||
|
## Start the stack
|
||||||
|
```
|
||||||
|
$ laconic-so deployment --dir blast-deployment start
|
||||||
|
```
|
||||||
|
Check logs:
|
||||||
|
```
|
||||||
|
$ laconic-so deployment --dir blast-deployment logs
|
||||||
|
```
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
version: "1.0"
|
||||||
|
name: fixturenet-blast
|
||||||
|
description: "A blast devnet stack"
|
||||||
|
repos:
|
||||||
|
- github.com/blast-io/blast
|
||||||
|
- git.vdb.to/cerc-io/lighthouse
|
||||||
|
containers:
|
||||||
|
- cerc/webapp-base
|
||||||
|
- cerc/lighthouse
|
||||||
|
- cerc/lighthouse-cli
|
||||||
|
- cerc/foundry
|
||||||
|
- cerc/fixturenet-eth-lighthouse
|
||||||
|
|
||||||
|
pods:
|
||||||
|
- fixturenet-blast
|
||||||
|
- foundry
|
||||||
|
|
||||||
@@ -49,7 +49,7 @@ $ laconic-so --stack fixturenet-laconic-loaded deploy logs
|
|||||||
```
|
```
|
||||||
## 6. Test with the Registry CLI
|
## 6. Test with the Registry CLI
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-laconic-loaded deploy exec cli "laconic registry status"
|
$ laconic-so --stack fixturenet-laconic-loaded deploy exec cli "laconic cns status"
|
||||||
```
|
```
|
||||||
## 7. View the laconic console
|
## 7. View the laconic console
|
||||||
Get the URL for the console web app with this command (the port number will be different for each deployment):
|
Get the URL for the console web app with this command (the port number will be different for each deployment):
|
||||||
|
|||||||
@@ -44,5 +44,5 @@ $ laconic-so --stack fixturenet-laconicd deploy logs
|
|||||||
```
|
```
|
||||||
## 6. Test with the Registry CLI
|
## 6. Test with the Registry CLI
|
||||||
```
|
```
|
||||||
$ laconic-so --stack fixturenet-laconicd deploy exec cli "laconic registry status"
|
$ laconic-so --stack fixturenet-laconicd deploy exec cli "laconic cns status"
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
# Blast stack
|
||||||
|
|
||||||
|
## Clone required repositories
|
||||||
|
```
|
||||||
|
$ laconic-so --stack mainnet-blast setup-repositories
|
||||||
|
```
|
||||||
|
## Build the stack's containers
|
||||||
|
```
|
||||||
|
$ laconic-so --stack mainnet-blast build-containers
|
||||||
|
```
|
||||||
|
## Create a deployment of the stack
|
||||||
|
```
|
||||||
|
$ laconic-so --stack mainnet-blast deploy init --map-ports-to-host any-same --output blast-spec.yml
|
||||||
|
```
|
||||||
|
[Insert details on how to configure the stack]
|
||||||
|
```
|
||||||
|
$ laconic-so --stack mainnet-blast deploy create --deployment-dir blast-deployment --spec-file blast-spec.yml
|
||||||
|
```
|
||||||
|
## Start the stack
|
||||||
|
```
|
||||||
|
$ laconic-so deployment --dir blast-deployment start
|
||||||
|
```
|
||||||
|
Check logs:
|
||||||
|
```
|
||||||
|
$ laconic-so deployment --dir blast-deployment logs
|
||||||
|
```
|
||||||
@@ -0,0 +1,39 @@
|
|||||||
|
# Copyright © 2023 Vulcanize
|
||||||
|
|
||||||
|
# This program is free software: you can redistribute it and/or modify
|
||||||
|
# it under the terms of the GNU Affero General Public License as published by
|
||||||
|
# the Free Software Foundation, either version 3 of the License, or
|
||||||
|
# (at your option) any later version.
|
||||||
|
|
||||||
|
# This program is distributed in the hope that it will be useful,
|
||||||
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
# GNU Affero General Public License for more details.
|
||||||
|
|
||||||
|
# You should have received a copy of the GNU Affero General Public License
|
||||||
|
# along with this program. If not, see <http:#www.gnu.org/licenses/>.
|
||||||
|
|
||||||
|
|
||||||
|
from pathlib import Path
|
||||||
|
from shutil import copy
|
||||||
|
import yaml
|
||||||
|
|
||||||
|
|
||||||
|
def create(context, extra_args):
|
||||||
|
# Our goal here is just to copy the json files for blast
|
||||||
|
yml_path = context.deployment_dir.joinpath("spec.yml")
|
||||||
|
with open(yml_path, 'r') as file:
|
||||||
|
data = yaml.safe_load(file)
|
||||||
|
|
||||||
|
mount_point = data['volumes']['blast-data']
|
||||||
|
if mount_point[0] == "/":
|
||||||
|
deploy_dir = Path(mount_point)
|
||||||
|
else:
|
||||||
|
deploy_dir = context.deployment_dir.joinpath(mount_point)
|
||||||
|
|
||||||
|
command_context = extra_args[2]
|
||||||
|
compose_file = [f for f in command_context.cluster_context.compose_files if "mainnet-blast" in f][0]
|
||||||
|
source_config_file = Path(compose_file).parent.parent.joinpath("config", "mainnet-blast", "genesis.json")
|
||||||
|
copy(source_config_file, deploy_dir)
|
||||||
|
source_config_file = Path(compose_file).parent.parent.joinpath("config", "mainnet-blast", "rollup.json")
|
||||||
|
copy(source_config_file, deploy_dir)
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
version: "1.0"
|
||||||
|
name: mainnet-blast
|
||||||
|
description: "A blast stack"
|
||||||
|
repos:
|
||||||
|
- github.com/blast-io/blast
|
||||||
|
- git.vdb.to/cerc-io/lighthouse
|
||||||
|
containers:
|
||||||
|
- cerc/webapp-base
|
||||||
|
- cerc/lighthouse
|
||||||
|
- cerc/lighthouse-cli
|
||||||
|
pods:
|
||||||
|
- mainnet-blast
|
||||||
@@ -94,7 +94,7 @@ class LaconicRegistryClient:
|
|||||||
)
|
)
|
||||||
|
|
||||||
def list_records(self, criteria={}, all=False):
|
def list_records(self, criteria={}, all=False):
|
||||||
args = ["laconic", "-c", self.config_file, "registry", "record", "list"]
|
args = ["laconic", "-c", self.config_file, "cns", "record", "list"]
|
||||||
|
|
||||||
if all:
|
if all:
|
||||||
args.append("--all")
|
args.append("--all")
|
||||||
@@ -140,7 +140,7 @@ class LaconicRegistryClient:
|
|||||||
if name in self.cache.name_or_id:
|
if name in self.cache.name_or_id:
|
||||||
return self.cache.name_or_id[name]
|
return self.cache.name_or_id[name]
|
||||||
|
|
||||||
args = ["laconic", "-c", self.config_file, "registry", "name", "resolve", name]
|
args = ["laconic", "-c", self.config_file, "cns", "name", "resolve", name]
|
||||||
|
|
||||||
parsed = [AttrDict(r) for r in json.loads(logged_cmd(self.log_file, *args))]
|
parsed = [AttrDict(r) for r in json.loads(logged_cmd(self.log_file, *args))]
|
||||||
if parsed:
|
if parsed:
|
||||||
@@ -165,7 +165,7 @@ class LaconicRegistryClient:
|
|||||||
"laconic",
|
"laconic",
|
||||||
"-c",
|
"-c",
|
||||||
self.config_file,
|
self.config_file,
|
||||||
"registry",
|
"cns",
|
||||||
"record",
|
"record",
|
||||||
"get",
|
"get",
|
||||||
"--id",
|
"--id",
|
||||||
@@ -203,8 +203,7 @@ class LaconicRegistryClient:
|
|||||||
print(open(record_fname, 'r').read(), file=self.log_file)
|
print(open(record_fname, 'r').read(), file=self.log_file)
|
||||||
|
|
||||||
new_record_id = json.loads(
|
new_record_id = json.loads(
|
||||||
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "registry",
|
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "cns", "record", "publish", "--filename", record_fname)
|
||||||
"record", "publish", "--filename", record_fname)
|
|
||||||
)["id"]
|
)["id"]
|
||||||
for name in names:
|
for name in names:
|
||||||
self.set_name(name, new_record_id)
|
self.set_name(name, new_record_id)
|
||||||
@@ -213,10 +212,10 @@ class LaconicRegistryClient:
|
|||||||
logged_cmd(self.log_file, "rm", "-rf", tmpdir)
|
logged_cmd(self.log_file, "rm", "-rf", tmpdir)
|
||||||
|
|
||||||
def set_name(self, name, record_id):
|
def set_name(self, name, record_id):
|
||||||
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "registry", "name", "set", name, record_id)
|
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "cns", "name", "set", name, record_id)
|
||||||
|
|
||||||
def delete_name(self, name):
|
def delete_name(self, name):
|
||||||
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "registry", "name", "delete", name)
|
logged_cmd(self.log_file, "laconic", "-c", self.config_file, "cns", "name", "delete", name)
|
||||||
|
|
||||||
|
|
||||||
def file_hash(filename):
|
def file_hash(filename):
|
||||||
|
|||||||
Executable
+43
@@ -0,0 +1,43 @@
|
|||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
set -e
|
||||||
|
if [ -n "$CERC_SCRIPT_DEBUG" ]; then
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$(date +"%Y-%m-%d %T"): Running stack-orchestrator Laconic registry CLI tests"
|
||||||
|
env
|
||||||
|
cat /etc/hosts
|
||||||
|
# Bit of a hack, test the most recent package
|
||||||
|
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
|
||||||
|
|
||||||
|
export CERC_REPO_BASE_DIR=$(mktemp -d $(pwd)/stack-orchestrator-fixturenet-laconicd-test.XXXXXXXXXX)
|
||||||
|
echo "$(date +"%Y-%m-%d %T"): Cloning laconic-registry-cli repository into: $CERC_REPO_BASE_DIR"
|
||||||
|
$TEST_TARGET_SO --stack fixturenet-laconicd setup-repositories --include git.vdb.to/cerc-io/laconic-registry-cli
|
||||||
|
|
||||||
|
echo "$(date +"%Y-%m-%d %T"): Starting stack"
|
||||||
|
TEST_AUCTION_ENABLED=true BASE_DIR=${CERC_REPO_BASE_DIR} $TEST_TARGET_SO --stack fixturenet-laconicd deploy --cluster laconicd up
|
||||||
|
echo "$(date +"%Y-%m-%d %T"): Stack started"
|
||||||
|
|
||||||
|
# Verify that the fixturenet is up and running
|
||||||
|
$TEST_TARGET_SO --stack fixturenet-laconicd deploy --cluster laconicd ps
|
||||||
|
|
||||||
|
# Get the fixturenet account address
|
||||||
|
laconicd_account_address=$(docker exec laconicd-laconicd-1 laconicd keys list | awk '/- address:/ {print $3}')
|
||||||
|
|
||||||
|
# Copy over config
|
||||||
|
docker exec laconicd-cli-1 cp config.yml laconic-registry-cli/
|
||||||
|
|
||||||
|
# Wait for the laconid endpoint to come up
|
||||||
|
echo "Waiting for the RPC endpoint to come up"
|
||||||
|
docker exec laconicd-laconicd-1 sh -c "curl --retry 20 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
||||||
|
|
||||||
|
# Run the tests
|
||||||
|
echo "Running the tests"
|
||||||
|
docker exec -e TEST_ACCOUNT=$laconicd_account_address laconicd-cli-1 sh -c 'cd laconic-registry-cli && yarn && yarn test'
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
$TEST_TARGET_SO --stack fixturenet-laconicd deploy --cluster laconicd down --delete-volumes
|
||||||
|
echo "$(date +"%Y-%m-%d %T"): Removing cloned repositories"
|
||||||
|
rm -rf $CERC_REPO_BASE_DIR
|
||||||
|
echo "$(date +"%Y-%m-%d %T"): Test finished"
|
||||||
@@ -12,6 +12,7 @@ cat /etc/hosts
|
|||||||
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
|
TEST_TARGET_SO=$( ls -t1 ./package/laconic-so* | head -1 )
|
||||||
# Set a new unique repo dir
|
# Set a new unique repo dir
|
||||||
export CERC_REPO_BASE_DIR=$(mktemp -d $(pwd)/stack-orchestrator-fixturenet-laconicd-test.XXXXXXXXXX)
|
export CERC_REPO_BASE_DIR=$(mktemp -d $(pwd)/stack-orchestrator-fixturenet-laconicd-test.XXXXXXXXXX)
|
||||||
|
|
||||||
echo "$(date +"%Y-%m-%d %T"): Testing this package: $TEST_TARGET_SO"
|
echo "$(date +"%Y-%m-%d %T"): Testing this package: $TEST_TARGET_SO"
|
||||||
echo "$(date +"%Y-%m-%d %T"): Test version command"
|
echo "$(date +"%Y-%m-%d %T"): Test version command"
|
||||||
reported_version_string=$( $TEST_TARGET_SO version )
|
reported_version_string=$( $TEST_TARGET_SO version )
|
||||||
|
|||||||
@@ -32,14 +32,14 @@ set +e
|
|||||||
|
|
||||||
CONTAINER_ID=$(docker run -p 3000:80 -d -e CERC_SCRIPT_DEBUG=$CERC_SCRIPT_DEBUG cerc/test-progressive-web-app:local)
|
CONTAINER_ID=$(docker run -p 3000:80 -d -e CERC_SCRIPT_DEBUG=$CERC_SCRIPT_DEBUG cerc/test-progressive-web-app:local)
|
||||||
sleep 3
|
sleep 3
|
||||||
wget -t 7 -O test.before -m http://localhost:3000
|
wget --tries 20 --retry-connrefused --waitretry=3 -O test.before -m http://localhost:3000
|
||||||
|
|
||||||
docker logs $CONTAINER_ID
|
docker logs $CONTAINER_ID
|
||||||
docker remove -f $CONTAINER_ID
|
docker remove -f $CONTAINER_ID
|
||||||
|
|
||||||
CONTAINER_ID=$(docker run -p 3000:80 -e CERC_WEBAPP_DEBUG=$CHECK -e CERC_SCRIPT_DEBUG=$CERC_SCRIPT_DEBUG -d cerc/test-progressive-web-app:local)
|
CONTAINER_ID=$(docker run -p 3000:80 -e CERC_WEBAPP_DEBUG=$CHECK -e CERC_SCRIPT_DEBUG=$CERC_SCRIPT_DEBUG -d cerc/test-progressive-web-app:local)
|
||||||
sleep 3
|
sleep 3
|
||||||
wget -t 7 -O test.after -m http://localhost:3000
|
wget --tries 20 --retry-connrefused --waitretry=3 -O test.after -m http://localhost:3000
|
||||||
|
|
||||||
docker logs $CONTAINER_ID
|
docker logs $CONTAINER_ID
|
||||||
docker remove -f $CONTAINER_ID
|
docker remove -f $CONTAINER_ID
|
||||||
|
|||||||
Reference in New Issue
Block a user