forked from cerc-io/laconicd-deprecated
Compare commits
32
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fdfe6ca285 | ||
|
|
a1ad1e1d35 | ||
|
|
ff74a447fe | ||
|
|
0e13bf7702 | ||
|
|
f8889d0225 | ||
|
|
c80f690c5d | ||
|
|
9719b51a12 | ||
|
|
fa948ec9c2 | ||
|
|
fb29cc26b2 | ||
|
|
07435d0597 | ||
|
|
ec4f8d386d | ||
|
|
87e873dc18 | ||
|
|
4867f2a362 | ||
|
|
2be800f0bb | ||
|
|
6ac975e213 | ||
|
|
8973a0fbf3 | ||
|
|
357f5e8af2 | ||
|
|
25d1577ce4 | ||
|
|
cac9fe327c | ||
|
|
9261699745 | ||
|
|
15db2d3849 | ||
|
|
6c597101ea | ||
|
|
90943bf1e6 | ||
|
|
512136400d | ||
|
|
c0662cb5f1 | ||
|
|
c73dc0d92a | ||
|
|
8f20f25e43 | ||
|
|
08e369aa64 | ||
|
|
40a78c66bf | ||
|
|
6945792aea | ||
|
|
5af22471a8 | ||
|
|
5e7a890adb |
@@ -1,4 +1,4 @@
|
|||||||
name: Publish onn release
|
name: Publish on release
|
||||||
on:
|
on:
|
||||||
release:
|
release:
|
||||||
types: [published]
|
types: [published]
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ jobs:
|
|||||||
- uses: codecov/codecov-action@v3
|
- uses: codecov/codecov-action@v3
|
||||||
with:
|
with:
|
||||||
file: ./coverage.txt
|
file: ./coverage.txt
|
||||||
fail_ci_if_error: true
|
fail_ci_if_error: false
|
||||||
if: env.GIT_DIFF
|
if: env.GIT_DIFF
|
||||||
|
|
||||||
test-importer:
|
test-importer:
|
||||||
@@ -81,6 +81,30 @@ jobs:
|
|||||||
make test-rpc
|
make test-rpc
|
||||||
if: env.GIT_DIFF
|
if: env.GIT_DIFF
|
||||||
|
|
||||||
|
sdk_tests:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v3
|
||||||
|
- name: Checkout laconic-sdk
|
||||||
|
uses: actions/checkout@v3
|
||||||
|
with:
|
||||||
|
path: "./laconic-sdk/"
|
||||||
|
repository: cerc-io/laconic-sdk
|
||||||
|
fetch-depth: 0
|
||||||
|
ref: jest_timeout
|
||||||
|
- name: Environment
|
||||||
|
run: ls -tlh && env
|
||||||
|
- name: build containers scripts
|
||||||
|
working-directory: tests/sdk_tests
|
||||||
|
run: ./build-laconicd-container.sh && ./build-sdk-test-container.sh
|
||||||
|
- name: start containers
|
||||||
|
working-directory: tests/sdk_tests
|
||||||
|
run: docker compose up -d
|
||||||
|
- name: run-tests.sh
|
||||||
|
working-directory: tests/sdk_tests
|
||||||
|
run: ./run-tests.sh
|
||||||
|
|
||||||
|
|
||||||
# integration_tests:
|
# integration_tests:
|
||||||
# runs-on: ubuntu-latest
|
# runs-on: ubuntu-latest
|
||||||
# steps:
|
# steps:
|
||||||
|
|||||||
@@ -50,6 +50,7 @@ coverage.txt
|
|||||||
sim_log_file
|
sim_log_file
|
||||||
tests/**/tmp/*
|
tests/**/tmp/*
|
||||||
yarn.lock
|
yarn.lock
|
||||||
|
x/auction/client/testutil/bidder-bafyre*
|
||||||
|
|
||||||
# Vagrant
|
# Vagrant
|
||||||
.vagrant/
|
.vagrant/
|
||||||
|
|||||||
+1
-1
@@ -20,7 +20,7 @@ RUN make build
|
|||||||
FROM alpine:3.17.0
|
FROM alpine:3.17.0
|
||||||
|
|
||||||
# Install ca-certificates
|
# Install ca-certificates
|
||||||
RUN apk add --update ca-certificates jq
|
RUN apk add --update ca-certificates jq curl
|
||||||
WORKDIR /
|
WORKDIR /
|
||||||
|
|
||||||
# Copy over binaries from the build-env
|
# Copy over binaries from the build-env
|
||||||
|
|||||||
@@ -0,0 +1,178 @@
|
|||||||
|
# Validator Upgrade Guide for laconic_81337-5 Testnet v0.6.0 -> v0.7.0
|
||||||
|
|
||||||
|
This guide assumes you have followed the instructions to crete a systemd service or docker container validator node v0.6.0 and you perform the upgrade on a machine running v0.6.0
|
||||||
|
|
||||||
|
It is highly recommended to make the backup of your datadir after you stop v0.6.0 and before you start v0.7.0. Unless you changed your datadir, it should be located in `~/.laconicd`
|
||||||
|
|
||||||
|
## Systemd service
|
||||||
|
Skip this section if you use docker
|
||||||
|
|
||||||
|
This is very similar to building v0.6.0. We keep v 0.6.0 running until v0.7.0 is built and only after the successful build we should replace 0.6.0 binary with v0.7.0. This is to avoid jailing your validator for long downtime.
|
||||||
|
The general upgrade plan is the following:
|
||||||
|
1. Install Go v1.19.5 (we used 1.18 for v0.6.0)
|
||||||
|
2. Remove old copy of the github repository and build directory
|
||||||
|
3. Download the latest laconicd repository and checkout v0.7.0
|
||||||
|
4. Build laconicd binary (but not install in this moment)
|
||||||
|
5. Stop laconicd systemd service
|
||||||
|
6. Install recently built new version of laconicd
|
||||||
|
7. Start laconicd service
|
||||||
|
|
||||||
|
>***You have ~10 minutes after step 5 to complete steps 6 and 7 before your validator is jailed for downtime. Getting jailed for downtime is not a disaster, however would require manual unjailing.***
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Install Go 1.19
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Update Ubuntu
|
||||||
|
sudo apt update
|
||||||
|
sudo apt upgrade -y
|
||||||
|
|
||||||
|
# Install required software packages
|
||||||
|
sudo apt install git curl build-essential make jq -y
|
||||||
|
|
||||||
|
# Remove any existing installation of `go`
|
||||||
|
sudo rm -rf /usr/local/go
|
||||||
|
|
||||||
|
# Install Go version 1.19.5
|
||||||
|
curl https://dl.google.com/go/go1.19.5.linux-amd64.tar.gz | sudo tar -C/usr/local -zxvf -
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
Check the version of go installed
|
||||||
|
|
||||||
|
```sh
|
||||||
|
go version
|
||||||
|
|
||||||
|
# Should return something like: go version go1.19.5 linux/amd64
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Remove old copy of `laconicd` build
|
||||||
|
|
||||||
|
>Attention should be paid that the directory mentioned below is `~/laconicd` and NOT `~/.laconicd`. The latter is the data directory containing all your node data and configuration and it must be kept during the upgrade.
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Remove the previous build directory
|
||||||
|
cd ~
|
||||||
|
rm -rf laconicd
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Download `laconicd` repository
|
||||||
|
```sh
|
||||||
|
git clone https://github.com/cerc-io/laconicd.git
|
||||||
|
cd laconicd
|
||||||
|
|
||||||
|
# Checkout 0.7.0 branch
|
||||||
|
git fetch --all
|
||||||
|
git checkout v0.7.0
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Build the new version of `laconicd`
|
||||||
|
|
||||||
|
```sh
|
||||||
|
# Build laconic (but not install at this moment)
|
||||||
|
make VERSION=v0.7.0 build
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Stop `laconicd` systemd service
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo systemctl stop laconicd
|
||||||
|
```
|
||||||
|
|
||||||
|
>***Make sure the service is stopped***
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo systemctl status laconicd
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Install new `laconicd` version
|
||||||
|
|
||||||
|
```sh
|
||||||
|
make VERSION=v0.7.0 install
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify your installation
|
||||||
|
|
||||||
|
```sh
|
||||||
|
laconicd version
|
||||||
|
```
|
||||||
|
This should return `0.7.0`
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Start `laconicd` systemd service
|
||||||
|
|
||||||
|
```sh
|
||||||
|
sudo systemctl start laconicd
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify that the node joined the network and produces new blocks
|
||||||
|
|
||||||
|
```sh
|
||||||
|
journalctl -f -u laconicd
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Docker container
|
||||||
|
|
||||||
|
Upgrade plan:
|
||||||
|
1. Stop running v0.6.0 container
|
||||||
|
2. Delete v0.6.0 container
|
||||||
|
3. Create v0.7.0 container
|
||||||
|
4. Start v0.7.0 container
|
||||||
|
|
||||||
|
>***You have ~10 minutes to complete the upgrade procedure before your validator is jailed for downtime. Getting jailed for downtime is not a disaster, however would require manual unjailing.***
|
||||||
|
|
||||||
|
### Stop running v0.6.0 container
|
||||||
|
```sh
|
||||||
|
docker stop laconic-testnet-5
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Delete v0.6.0 container
|
||||||
|
```sh
|
||||||
|
docker rm laconic-testnet-5
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Create v0.7.0 container
|
||||||
|
```sh
|
||||||
|
docker create --name laconic-testnet-5 \
|
||||||
|
--restart always \
|
||||||
|
-v ~/.laconicd:/root/.laconicd \
|
||||||
|
-p 26656:26656 \
|
||||||
|
-p 127.0.0.1:26657:26657 \
|
||||||
|
-p 127.0.0.1:26660:26660 \
|
||||||
|
git.vdb.to/cerc-io/laconicd/laconicd:v0.7.0 \
|
||||||
|
laconicd start --gql-playground --gql-server --log_level=warn
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Start v0.7.0 container
|
||||||
|
```sh
|
||||||
|
docker start laconic-testnet-5
|
||||||
|
```
|
||||||
|
|
||||||
|
Verify that the node joined the network and produces new blocks
|
||||||
|
|
||||||
|
```sh
|
||||||
|
docker logs -f laconic-testnet-5
|
||||||
|
```
|
||||||
|
|
||||||
|
---
|
||||||
@@ -47,6 +47,7 @@ WORKDIR /app
|
|||||||
RUN \
|
RUN \
|
||||||
git clone https://github.com/cerc-io/laconic-sdk.git \
|
git clone https://github.com/cerc-io/laconic-sdk.git \
|
||||||
&& cd laconic-sdk \
|
&& cd laconic-sdk \
|
||||||
|
&& git checkout jest_timeout \
|
||||||
&& yarn install
|
&& yarn install
|
||||||
|
|
||||||
WORKDIR /app/laconic-sdk
|
WORKDIR /app/laconic-sdk
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ services:
|
|||||||
volumes:
|
volumes:
|
||||||
- ../../init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
- ../../init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "wget", "-nv", "-t1", "--spider", "http://localhost:6060"]
|
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
||||||
interval: 1s
|
interval: 1s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 30
|
retries: 30
|
||||||
|
|||||||
@@ -9,4 +9,10 @@ cosmos_chain_id=laconic_9000-1
|
|||||||
laconicd_rest_endpoint=http://laconicd:1317
|
laconicd_rest_endpoint=http://laconicd:1317
|
||||||
laconicd_gql_endpoint=http://laconicd:9473/api
|
laconicd_gql_endpoint=http://laconicd:9473/api
|
||||||
# Run tests
|
# Run tests
|
||||||
|
docker network inspect sdk_tests_default
|
||||||
|
sleep 30s
|
||||||
|
docker logs laconicd
|
||||||
|
docker compose exec laconicd sh -c "curl http://127.0.0.1:9473/api"
|
||||||
|
docker compose exec laconicd sh -c "curl http://localhost:9473/api"
|
||||||
|
|
||||||
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test"
|
docker compose exec sdk-test-runner sh -c "COSMOS_CHAIN_ID=${cosmos_chain_id} LACONICD_REST_ENDPOINT=${laconicd_rest_endpoint} LACONICD_GQL_ENDPOINT=${laconicd_gql_endpoint} PRIVATE_KEY=${laconicd_key} yarn test"
|
||||||
|
|||||||
+15
-10
@@ -7,24 +7,29 @@ import (
|
|||||||
|
|
||||||
func TestAndValidateCIDGeneration(t *testing.T) {
|
func TestAndValidateCIDGeneration(t *testing.T) {
|
||||||
testCases := []struct {
|
testCases := []struct {
|
||||||
name string
|
name string
|
||||||
content string
|
content string
|
||||||
|
expected string
|
||||||
}{
|
}{
|
||||||
{
|
// empty string and empty json blows up
|
||||||
"empty string", "",
|
// {
|
||||||
},
|
// "empty string", "", "bafyreiengp2sbi6ez34a2jctv34bwyjl7yoliteleaswgcwtqzrhmpyt2m",
|
||||||
{
|
// },
|
||||||
"empty json", "{}",
|
// {
|
||||||
},
|
// "empty json", "{}", "bafyreihpfkdvib5muloxlj5b3tgdwibjdcu3zdsuhyft33z7gtgnlzlkpm",
|
||||||
|
// },
|
||||||
|
|
||||||
{
|
{
|
||||||
"test record", "\\xa6curlohttps://cerc.iodtypex\\x19WebsiteRegistrationRecordgversione0.0.1ltls_cert_cidx.QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnRrbuild_artifact_cidx.QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9x\\x1crepo_registration_record_cidx.QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D",
|
"test record", "{\"build_artifact_cid\":\"QmP8jTG1m9GSDJLCbeWhVSVgEzCPPwXRdCRuJtQ5Tz9Kc9\",\"repo_registration_record_cid\":\"QmSnuWmxptJZdLJpKRarxBMS2Ju2oANVrgbr2xWbie9b2D\",\"tls_cert_cid\":\"QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR\",\"type\":\"WebsiteRegistrationRecord\",\"url\":\"https://cerc.io\",\"version\":\"0.0.1\"}",
|
||||||
|
"bafyreiek4hnoqmits66bjyxswapplweuoqe4en2ux6u772o4y3askpd3ny",
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
for _, tc := range testCases {
|
for _, tc := range testCases {
|
||||||
deprecatedAndCorrect, _ := CIDFromJSONBytes([]byte(tc.content))
|
deprecatedAndCorrect, _ := CIDFromJSONBytes([]byte(tc.content))
|
||||||
newImpl, _ := CIDFromJSONBytesUsingIpldPrime([]byte(tc.content))
|
newImpl, err := CIDFromJSONBytesUsingIpldPrime([]byte(tc.content))
|
||||||
|
require.NoError(t, err)
|
||||||
require.Equal(t, deprecatedAndCorrect, newImpl, tc.name)
|
require.Equal(t, deprecatedAndCorrect, newImpl, tc.name)
|
||||||
|
require.Equal(t, tc.expected, newImpl)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user