Compare commits

...

2 Commits

Author SHA1 Message Date
zramsay
33bf35a761 laconic.json
Some checks failed
Publish ApplicationRecord to Registry / cns_publish (push) Failing after 1m2s
2024-08-21 15:55:00 -04:00
zramsay
3136964430 testnet deploy 2024-08-21 15:51:14 -04:00
15 changed files with 199 additions and 333 deletions

View File

@ -1,21 +0,0 @@
name: Config Checker
on:
# push:
# branches: [ master ]
pull_request:
# branches: [ master ]
paths:
- 'chains/mainnet/**'
- 'chains/testnet/**'
jobs:
deploy:
name: Check Blockchain Config
runs-on: ubuntu-latest
steps:
- name: Git Checkout Latest
uses: actions/checkout@v3
- name: Check Chain Configs
uses: ping-pub/ping-dashboard-config-checker@v1.0

View File

@ -1,51 +0,0 @@
name: docker
on:
push:
branches:
- 'master-backup'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
# -
# name: Set up QEMU
# uses: docker/setup-qemu-action@v1
# -
# name: Set up Docker Buildx
# uses: docker/setup-buildx-action@v1
- name: Install
run: yarn install
- name: Build
run: yarn run vue-cli-service build
- name: Login to DockerHub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Docker meta
id: meta
uses: docker/metadata-action@v3
with:
# list of Docker images to use as base name for tags
images: |
yaoling/wallet
# generate Docker tags based on the following events/attributes
tags: |
type=sha
type=schedule
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

View File

@ -1,28 +0,0 @@
name: Deploy to ping.pub
on:
push:
branches: [ master2 ]
# pull_request:
# branches: [ master ]
jobs:
deploy:
name: Ping deploy
runs-on: mainnet
steps:
- name: Environment
run: export NODE_OPTIONS="--max_old_space_size=4096"
- name: Git Checkout Latest
uses: actions/checkout@v3
- name: Install
run: yarn install --ignore-engines
- name: Build
run: yarn build
- name: Deploy
run: cp -rf ./dist/* /var/www/html/

39
.github/workflows/publish.yaml vendored Normal file
View File

@ -0,0 +1,39 @@
name: Publish ApplicationRecord to Registry
on:
release:
types: [published]
push:
branches:
- main
- '*'
env:
CERC_REGISTRY_USER_KEY: ${{ secrets.CICD_VAASL_LACONIC_USER_KEY }}
CERC_REGISTRY_BOND_ID: ${{ secrets.CICD_VAASL_LACONIC_BOND_ID }}
CERC_REGISTRY_DEPLOYMENT_HOSTNAME: ${{ vars.CERC_REGISTRY_DEPLOYMENT_HOSTNAME }}
CERC_REGISTRY_DEPLOYMENT_REQUEST_USER_KEY: ${{ secrets.CICD_VAASL_DEPLOYMENT_REQUEST_USER_KEY }}
CERC_REGISTRY_DEPLOYMENT_REQUEST_BOND_ID: ${{ secrets.CICD_VAASL_DEPLOYMENT_REQUEST_BOND_ID }}
CERC_REGISTRY_DEPLOYMENT_REQUEST_PAYMENT_TO: ${{ secrets.CICD_VAASL_DEPLOYMENT_REQUEST_PAYMENT_TO }}
jobs:
cns_publish:
runs-on: ubuntu-latest
steps:
- name: "Clone project repository"
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18
- name: "Enable Yarn"
run: corepack enable
- name: "Install registry CLI"
run: |
npm config set @cerc-io:registry https://git.vdb.to/api/packages/cerc-io/npm/
npm install -g @cerc-io/laconic-registry-cli
- name: "Install jq"
run: apt -y update && apt -y install jq
- name: "Publish Application Record"
run: scripts/publish-app-record.sh
- name: "Request Deployment"
run: scripts/request-app-deployment.sh

View File

@ -1,27 +0,0 @@
name: Testnet Deploy
on:
push:
branches: [ testnet ]
pull_request:
branches: [ testnet ]
jobs:
deploy:
name: Ping deploy
runs-on: testnet
steps:
- name: print
run: echo ${GITHUB_REF#refs/heads/}
- name: Git Checkout Latest
uses: actions/checkout@v2
- name: Install
run: yarn install
- name: Build
run: yarn run vue-cli-service build
- name: Deploy
run: cp -rf ./dist/* /var/www/html/

View File

@ -1,74 +0,0 @@
{
"chain_name": "axelar",
"api": [
"https://rest.axelar.lava.build/lava-referer-97409c72-1a82-4861-8651-119c15151cbe"
],
"rpc": [
"https://tm.axelar.lava.build/lava-referer-97409c72-1a82-4861-8651-119c15151cbe"
],
"snapshot_provider": "",
"sdk_version": "0.45.6",
"coin_type": "118",
"min_tx_fee": "800",
"addr_prefix": "axelar",
"logo": "/logos/axelar.svg",
"theme_color": "#161723",
"assets": [
{
"base": "uaxl",
"symbol": "AXL",
"exponent": "6",
"coingecko_id": "axelar",
"logo": "/logos/axelar.svg"
},
{
"base": "uusdc",
"symbol": "axlUSDC",
"exponent": "6",
"coingecko_id": "usd-coin",
"logo": "/logos/usdc.svg"
},
{
"base": "uusdt",
"symbol": "axlUSDT",
"exponent": "6",
"coingecko_id": "tether",
"logo": "/logos/usdt.svg"
},
{
"base": "dai-wei",
"symbol": "axlDAI",
"exponent": "18",
"coingecko_id": "dai",
"logo": "/logos/dai.svg"
},
{
"base": "weth-wei",
"symbol": "axlWETH",
"exponent": "18",
"coingecko_id": "ethereum",
"logo": "/logos/weth.svg"
},
{
"base": "wmatic-wei",
"symbol": "axlWMATIC",
"exponent": "18",
"coingecko_id": "matic-network",
"logo": "/logos/wmatic.svg"
},
{
"base": "wavax-wei",
"symbol": "axlWAVAX",
"exponent": "18",
"coingecko_id": "avalanche-2",
"logo": "/logos/wavax.svg"
},
{
"base": "dot-planck",
"symbol": "axlDOT",
"exponent": "10",
"coingecko_id": "polkadot",
"logo": "/logos/dot.svg"
}
]
}

View File

@ -1,31 +0,0 @@
{
"chain_name": "cosmos",
"registry_name": "cosmoshub",
"api": [
{"provider": "notional", "address": "https://api-cosmoshub-ia.cosmosia.notional.ventures"},
{"provider": "blockapsis", "address": "https://lcd-cosmoshub.blockapsis.com:443"},
{"provider": "WhisperNode🤐", "address": "https://lcd-cosmoshub.whispernode.com:443"},
{"provider": "pupmos", "address": "https://api-cosmoshub.pupmos.network"},
{"provider": "publicnode", "address": "https://cosmos-rest.publicnode.com"},
{"provider": "staketab", "address": "https://cosmos-rest.staketab.org"},
{"provider": "nodestake", "address": "https://api.cosmos.nodestake.top"},
{"provider": "Golden Ratio Staking", "address": "https://rest-cosmoshub.goldenratiostaking.net"}
],
"rpc": [
{"provider": "icycro", "address": "https://cosmos-rpc.icycro.org"},
{"provider": "dragonstake", "address": "https://rpc.cosmos.dragonstake.io"},
{"provider": "Golden Ratio Staking", "address": "https://rpc-cosmoshub.goldenratiostaking.net"}
],
"sdk_version": "0.45.1",
"coin_type": "118",
"min_tx_fee": "800",
"addr_prefix": "cosmos",
"logo": "/logos/cosmos.svg",
"assets": [{
"base": "uatom",
"symbol": "ATOM",
"exponent": "6",
"coingecko_id": "cosmos",
"logo": "/logos/cosmos.svg"
}]
}

View File

@ -0,0 +1,22 @@
{
"chain_name": "laconic_9000-1",
"registry_name": "laconic_9000-1",
"api": [
{"provider": "test-api-prov", "address": "https://laconicd.laconic.com/api"}
],
"rpc": [
{"provider": "test-rpc-prov", "address": "https://laconicd.laconic.com"}
],
"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"
}]
}

View File

@ -1,30 +0,0 @@
{
"chain_name": "neutron",
"api": [
{"provider": "Polkachu", "address": "https://neutron-api.polkachu.com"},
{"provider": "NodeStake", "address": "https://api.neutron.nodestake.top"},
{"provider": "Allnodes", "address": "https://neutron-rest.publicnode.com"}
],
"rpc": [
{"provider": "Polkachu", "address": "https://neutron-rpc.polkachu.com"},
{"provider": "NodeStake", "address": "https://rpc.neutron.nodestake.top"},
{"provider": "Allnodes", "address": "https://neutron-rpc.publicnode.com:443"}
],
"provider_chain": {
"api": ["https://api-cosmoshub-ia.cosmosia.notional.ventures"]
},
"features": ["dashboard", "blocks", "ibc", "cosmwasm", "uptime", "parameters", "state-sync", "consensus", "supply", "widget"],
"sdk_version": "0.45.1",
"coin_type": "118",
"min_tx_fee": "8000",
"assets": [{
"base": "untrn",
"symbol": "NTRN",
"exponent": "6",
"coingecko_id": "neutron",
"logo": "/logos/neutron.svg"
}],
"addr_prefix": "neutron",
"theme_color": "#161723",
"logo": "/logos/neutron.svg"
}

View File

@ -1,27 +0,0 @@
{
"chain_name": "nolus",
"coingecko": "nolus",
"api": [
{"provider": "Nolus", "address": "https://pirin-cl.nolus.network:1317"},
{"provider": "LavenderFive", "address": "https://nolus-api.lavenderfive.com:443"},
{"provider": "Allnodes", "address": "https://nolus-rest.publicnode.com"}
],
"rpc": [
{"provider": "Nolus", "address": "https://pirin-cl.nolus.network:26657"},
{"provider": "LavenderFive", "address": "https://nolus-rpc.lavenderfive.com:443"},
{"provider": "Allnodes", "address": "https://nolus-rpc.publicnode.com:443"}
],
"snapshot_provider": "",
"sdk_version": "v0.47.6",
"coin_type": "118",
"min_tx_fee": "0",
"addr_prefix": "nolus",
"logo": "/logos/nolus.svg",
"assets": [{
"base": "unls",
"symbol": "NLS",
"exponent": "6",
"coingecko_id": "nolus",
"logo": "/logos/nolus.svg"
}]
}

View File

@ -1,32 +0,0 @@
{
"chain_name": "osmosis",
"coingecko": "osmosis",
"api": ["https://lcd.osmosis.zone","https://api-osmosis-ia.cosmosia.notional.ventures", "https://osmosis-api.polkachu.com", "https://lcd-osmosis.blockapsis.com"],
"rpc": ["https://rpc.osmosis.zone", "https://rpc-osmosis-ia.cosmosia.notional.ventures:443", "https://osmosis-rpc.polkachu.com:443", "https://osmosis.validator.network:443", "https://rpc-osmosis.blockapsis.com:443"],
"snapshot_provider": "",
"sdk_version": "0.46.1",
"coin_type": "118",
"min_tx_fee": "800",
"addr_prefix": "osmo",
"logo": "/logos/osmosis.jpg",
"theme_color": "#812cd6",
"assets": [{
"base": "uosmo",
"symbol": "OSMO",
"exponent": "6",
"coingecko_id": "osmosis",
"logo": "/logos/osmosis.jpg"
},{
"base": "uion",
"symbol": "ION",
"exponent": "6",
"coingecko_id": "ion",
"logo": "/logos/osmosis.jpg"
},{
"base": "usomm",
"symbol": "SOMM",
"exponent": "6",
"coingecko_id": "somm",
"logo": ""
}]
}

View File

@ -1,11 +0,0 @@
{
"chain_name": "crossfi-testnet-1",
"api": ["https://crossfi-testnet-api.forpeaky.xyz"],
"rpc": ["https://crossfi-testnet-rpc.forpeaky.xyz"],
"coingecko": "",
"snapshot_provider": "",
"sdk_version": "0.47.1",
"coin_type": "118",
"min_tx_fee": "500",
"addr_prefix": "crossfi"
}

View File

@ -1,6 +1,7 @@
{ {
"name": "ping.pub", "name": "@lcn-demo/ping.pub",
"version": "3.0.0", "version": "3.0.0",
"repository": "https://git.vdb.to/zramsay/cosmos-explorer",
"private": true, "private": true,
"target": "", "target": "",
"scripts": { "scripts": {

69
scripts/publish-app-record.sh Executable file
View File

@ -0,0 +1,69 @@
#!/bin/bash
set -e
RECORD_FILE=tmp.rf.$$
CONFIG_FILE=`mktemp`
CERC_APP_TYPE=${CERC_APP_TYPE:-"webapp/next"}
CERC_REPO_REF=${CERC_REPO_REF:-${GITHUB_SHA:-`git log -1 --format="%H"`}}
CERC_IS_LATEST_RELEASE=${CERC_IS_LATEST_RELEASE:-"true"}
rcd_name=$(jq -r '.name' package.json | sed 's/null//')
rcd_desc=$(jq -r '.description' package.json | sed 's/null//')
rcd_repository=$(jq -r '.repository' package.json | sed 's/null//')
rcd_homepage=$(jq -r '.homepage' package.json | sed 's/null//')
rcd_license=$(jq -r '.license' package.json | sed 's/null//')
rcd_author=$(jq -r '.author' package.json | sed 's/null//')
rcd_app_version=$(jq -r '.version' package.json | sed 's/null//')
cat <<EOF > "$CONFIG_FILE"
services:
registry:
rpcEndpoint: '${CERC_REGISTRY_RPC_ENDPOINT:-https://laconicd.laconic.com}'
gqlEndpoint: '${CERC_REGISTRY_GQL_ENDPOINT:-https://laconicd.laconic.com/api}'
chainId: ${CERC_REGISTRY_CHAIN_ID:-laconic_9000-1}
gas: 900000
fees: 1900000alnt
EOF
next_ver=$(laconic -c $CONFIG_FILE registry record list --type ApplicationRecord --all --name "$rcd_name" 2>/dev/null | jq -r -s ".[] | sort_by(.createTime) | reverse | [ .[] | select(.bondId == \"$CERC_REGISTRY_BOND_ID\") ] | .[0].attributes.version" | awk -F. -v OFS=. '{$NF += 1 ; print}')
if [ -z "$next_ver" ] || [ "1" == "$next_ver" ]; then
next_ver=0.0.1
fi
cat <<EOF | sed '/.*: ""$/d' > "$RECORD_FILE"
record:
type: ApplicationRecord
version: ${next_ver}
name: "$rcd_name"
description: "$rcd_desc"
homepage: "$rcd_homepage"
license: "$rcd_license"
author: "$rcd_author"
repository:
- "$rcd_repository"
repository_ref: "$CERC_REPO_REF"
app_version: "$rcd_app_version"
app_type: "$CERC_APP_TYPE"
EOF
cat $RECORD_FILE
RECORD_ID=$(laconic -c $CONFIG_FILE registry record publish --filename $RECORD_FILE --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} | jq -r '.id')
echo $RECORD_ID
if [ -z "$CERC_REGISTRY_APP_LRN" ]; then
authority=$(echo "$rcd_name" | cut -d'/' -f1 | sed 's/@//')
app=$(echo "$rcd_name" | cut -d'/' -f2-)
CERC_REGISTRY_APP_LRN="lrn://$authority/applications/$app"
fi
laconic -c $CONFIG_FILE registry name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_LRN@${rcd_app_version}" "$RECORD_ID"
laconic -c $CONFIG_FILE registry name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_LRN@${CERC_REPO_REF}" "$RECORD_ID"
if [ "true" == "$CERC_IS_LATEST_RELEASE" ]; then
laconic -c $CONFIG_FILE registry name set --user-key "${CERC_REGISTRY_USER_KEY}" --bond-id ${CERC_REGISTRY_BOND_ID} "$CERC_REGISTRY_APP_LRN" "$RECORD_ID"
fi
rm -f $RECORD_FILE $CONFIG_FILE

View File

@ -0,0 +1,67 @@
#!/bin/bash
set -e
RECORD_FILE=tmp.rf.$$
CONFIG_FILE=`mktemp`
rcd_name=$(jq -r '.name' package.json | sed 's/null//' | sed 's/^@//')
rcd_app_version=$(jq -r '.version' package.json | sed 's/null//')
cat <<EOF > "$CONFIG_FILE"
services:
registry:
rpcEndpoint: '${CERC_REGISTRY_RPC_ENDPOINT:-https://laconicd.laconic.com}'
gqlEndpoint: '${CERC_REGISTRY_GQL_ENDPOINT:-https://laconicd.laconic.com/api}'
chainId: ${CERC_REGISTRY_CHAIN_ID:-laconic_9000-1}
gas: 900000
fees: 900000alnt
EOF
if [ -z "$CERC_REGISTRY_APP_LRN" ]; then
authority=$(echo "$rcd_name" | cut -d'/' -f1 | sed 's/@//')
app=$(echo "$rcd_name" | cut -d'/' -f2-)
CERC_REGISTRY_APP_LRN="lrn://$authority/applications/$app"
fi
PAYMENT_TX=$(laconic -c $CONFIG_FILE registry tokens send \
--address laconic13eq42rat3aurnfj6pu32yl00zyhl8sent97efe \
--user-key "${CERC_REGISTRY_DEPLOYMENT_REQUEST_USER_KEY}" \
--bond-id "${CERC_REGISTRY_DEPLOYMENT_REQUEST_BOND_ID}" \
--type alnt \
--quantity ${CERC_REGISTRY_DEPLOYMENT_REQUEST_PAYMENT_AMOUNT:-10000} | jq '.tx.hash')
APP_RECORD=$(laconic -c $CONFIG_FILE registry name resolve "$CERC_REGISTRY_APP_LRN" | jq '.[0]')
if [ -z "$APP_RECORD" ] || [ "null" == "$APP_RECORD" ]; then
echo "No record found for $CERC_REGISTRY_APP_LRN."
exit 1
fi
cat <<EOF | sed '/.*: ""$/d' > "$RECORD_FILE"
record:
type: ApplicationDeploymentRequest
version: 1.0.0
name: "$rcd_name@$rcd_app_version"
application: "$CERC_REGISTRY_APP_LRN@$rcd_app_version"
dns: "$CERC_REGISTRY_DEPLOYMENT_HOSTNAME"
deployment: "$CERC_REGISTRY_DEPLOYMENT_LRN"
to: laconic13eq42rat3aurnfj6pu32yl00zyhl8sent97efe
payment: $PAYMENT_TX
config:
env:
CERC_WEBAPP_DEBUG: "$rcd_app_version"
meta:
note: "Added by CI @ `date`"
repository: "`git remote get-url origin`"
repository_ref: "${GITHUB_SHA:-`git log -1 --format="%H"`}"
EOF
cat $RECORD_FILE
RECORD_ID=$(laconic -c $CONFIG_FILE registry record publish \
--filename $RECORD_FILE \
--user-key "${CERC_REGISTRY_DEPLOYMENT_REQUEST_USER_KEY}" \
--bond-id ${CERC_REGISTRY_DEPLOYMENT_REQUEST_BOND_ID} | jq -r '.id')
echo $RECORD_ID
rm -f $RECORD_FILE $CONFIG_FILE