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

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
73 changes: 44 additions & 29 deletions .github/workflows/health-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ on:
datil_branch:
description: 'Branch for Datil tests'
required: true
default: 'datil'
naga_branch:
description: 'Branch for Naga tests'
required: true
default: 'naga'
default: 'master'
# naga_branch:
# description: 'Branch for Naga tests'
# required: true
# default: 'naga'

env:
LIT_STATUS_WRITE_KEY: ${{ secrets.LIT_STATUS_WRITE_KEY }}
Expand All @@ -35,42 +35,57 @@ jobs:
with:
node-version: '18'

- name: Install rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
components: rust-std

- name: Install wasm-pack
uses: jetli/[email protected]
with:
version: 'latest'

- name: Install Yarn dependencies
run: yarn install --frozen-lockfile

- name: Build project
run: yarn build

- name: Run health check for datil-dev
run: NETWORK=datil-dev yarn test:health

- name: Run health check for datil-test
run: NETWORK=datil-test yarn test:health
run: NETWORK=datil-test yarn ci:health

- name: Run health check for datil
run: NETWORK=datil yarn test:health
run: NETWORK=datil yarn ci:health

naga-health-check:
runs-on: ubuntu-latest
needs: datil-health-check
env:
LIVE_MASTER_ACCOUNT: ${{ secrets.LIVE_MASTER_ACCOUNT }}
LIT_YELLOWSTONE_PRIVATE_RPC_URL: ${{ vars.LIT_YELLOWSTONE_PRIVATE_RPC_URL }}
steps:
- name: Checkout naga branch
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.naga_branch || 'master' }}
fetch-depth: 1
# naga-health-check:
# runs-on: ubuntu-latest
# needs: datil-health-check
# env:
# LIVE_MASTER_ACCOUNT: ${{ secrets.LIVE_MASTER_ACCOUNT }}
# LIT_YELLOWSTONE_PRIVATE_RPC_URL: ${{ vars.LIT_YELLOWSTONE_PRIVATE_RPC_URL }}
# steps:
# - name: Checkout naga branch
# uses: actions/checkout@v4
# with:
# ref: ${{ github.event.inputs.naga_branch || 'master' }}
# fetch-depth: 1

- name: Setup Bun
uses: oven-sh/setup-bun@v1
# - name: Setup Bun
# uses: oven-sh/setup-bun@v1

- name: Install Bun dependencies
run: bun install --frozen-lockfile
# - name: Install Bun dependencies
# run: bun install --frozen-lockfile

- name: Run health check for naga-dev
run: NETWORK=naga-dev bun run test:health
# - name: Run health check for naga-dev
# run: NETWORK=naga-dev bun run test:health

- name: Run health check for naga-staging
run: NETWORK=naga-staging bun run test:health
# - name: Run health check for naga-staging
# run: NETWORK=naga-staging bun run test:health

- name: Run health check for naga-test
run: NETWORK=naga-test bun run test:health
# - name: Run health check for naga-test
# run: NETWORK=naga-test bun run test:health
20 changes: 17 additions & 3 deletions local-tests/health/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,22 @@ const NETWORK = process.env.NETWORK!;
const PRODUCT = 'js-sdk/datil';

async function runHealthCheck() {
console.log('🔍 Environment Variables:');
console.log(' NETWORK:', process.env.NETWORK);
console.log(' LIT_STATUS_BACKEND_URL:', process.env.LIT_STATUS_BACKEND_URL);
console.log(' LIT_STATUS_WRITE_KEY:', process.env.LIT_STATUS_WRITE_KEY ? '[SET]' : '[NOT SET]');

if (!NETWORK) {
throw new Error('❌ NETWORK is not set');
}

if (!process.env.LIT_STATUS_BACKEND_URL) {
throw new Error('❌ LIT_STATUS_BACKEND_URL is not set');
}

if (!process.env.LIT_STATUS_WRITE_KEY) {
throw new Error('❌ LIT_STATUS_WRITE_KEY is not set');
}

const statusClient = createLitStatusClient({
url: process.env.LIT_STATUS_BACKEND_URL,
Expand Down Expand Up @@ -66,9 +79,10 @@ async function runHealthCheck() {
(async () => {
try {
await runHealthCheck();
console.log('✅ Health check completed successfully');
process.exit(0);
} catch (error) {
console.error(error);
} finally {
process.exit();
console.error('❌ Health check failed:', error);
process.exit(1);
}
})();
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
"test:unit:watch": "nx run-many --target=test --watch",
"test:unit:bun": "bun ./tools/scripts/unit-test-with-bun.mjs",
"test:health": "DEBUG=false node ./local-tests/build.mjs && dotenvx run --env-file=.env -- node ./local-tests/build/health/index.mjs",
"ci:health": "DEBUG=false node ./local-tests/build.mjs && node ./local-tests/build/health/index.mjs",
"publish:packages": "yarn node ./tools/scripts/pub.mjs --prod",
"publish:beta": "yarn node ./tools/scripts/pub.mjs --tag beta",
"publish:staging": "yarn node ./tools/scripts/pub.mjs --tag staging",
Expand Down
112 changes: 12 additions & 100 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2829,17 +2829,18 @@
resolved "https://registry.yarnpkg.com/@lit-protocol/contracts/-/contracts-0.0.74.tgz#e726a9190c86b10cc6df3a392cd04d19057be27d"
integrity sha512-8uV038gzBp7ew7a4884SVt9Zhu8CtiTb+A8dKNnByxVoT1kFt4O4DmsaniV8p9AGjNR13IWfpU1NFChmPHVIpQ==

"@lit-protocol/lit-status-sdk@^0.1.4":
version "0.1.4"
resolved "https://registry.yarnpkg.com/@lit-protocol/lit-status-sdk/-/lit-status-sdk-0.1.4.tgz#28753dd4103a4fd2ec649824a1c4b05aa583fd93"
integrity sha512-EJG3OJ4/C3y2Gh/oRP0Pn3bGBKVMZp8FvsEUuKlBhFW6V+CblUa0UH8bnpY+sYMu5u2i84Qc7uhQrYaKGu58Aw==
"@lit-protocol/lit-status-sdk@^0.1.8":
version "0.1.8"
resolved "https://registry.yarnpkg.com/@lit-protocol/lit-status-sdk/-/lit-status-sdk-0.1.8.tgz#fe68cbe826114e125f58006783b59f968c172c1b"
integrity sha512-Rq/1dvF1R3CExxHIbZNjZehidmam5hxGCbsXWiWQqHSJXnZNuhVdFMLfGUIWS+NVRRnmhg1jF8PJD768iP0MUg==
dependencies:
"@google-cloud/monitoring" "^5.3.0"
"@prisma/client" "^6.13.0"
"@prisma/instrumentation" "^6.13.0"
cors "^2.8.5"
express "^5.1.0"
prom-client "^15.1.3"
optionalDependencies:
"@opentelemetry/api" "^1.9.0"
"@opentelemetry/api-logs" "^0.203.0"

"@metamask/[email protected]":
version "5.0.2"
Expand Down Expand Up @@ -3646,30 +3647,18 @@
inherits "^2.0.4"
sprintf-js "^1.1.2"

"@opentelemetry/api-logs@0.57.2":
version "0.57.2"
resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.57.2.tgz#d4001b9aa3580367b40fe889f3540014f766cc87"
integrity sha512-uIX52NnTM0iBh84MShlpouI7UKqkZ7MrUszTmaypHBu4r7NofznSnQRfJ+uUeDtQDj6w8eFGg5KBLDAwAPz1+A==
"@opentelemetry/api-logs@^0.203.0":
version "0.203.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/api-logs/-/api-logs-0.203.0.tgz#3309a76c51a848ea820cd7f00ee62daf36b06380"
integrity sha512-9B9RU0H7Ya1Dx/Rkyc4stuBZSGVQF27WigitInx2QQoj6KUpEFYPKoWjdFTunJYxmXmh17HeBvbMa1EhGyPmqQ==
dependencies:
"@opentelemetry/api" "^1.3.0"

"@opentelemetry/api@^1.3.0", "@opentelemetry/api@^1.4.0":
"@opentelemetry/api@^1.3.0", "@opentelemetry/api@^1.4.0", "@opentelemetry/api@^1.9.0":
version "1.9.0"
resolved "https://registry.yarnpkg.com/@opentelemetry/api/-/api-1.9.0.tgz#d03eba68273dc0f7509e2a3d5cba21eae10379fe"
integrity sha512-3giAOQvZiH5F9bMlMiv8+GSPMeqg0dbaeo58/0SlA9sxSqZhnUtxzX9/2FzyhS9sWQf5S0GJE0AKBrFqjpeYcg==

"@opentelemetry/instrumentation@^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0":
version "0.57.2"
resolved "https://registry.yarnpkg.com/@opentelemetry/instrumentation/-/instrumentation-0.57.2.tgz#8924549d7941ba1b5c6f04d5529cf48330456d1d"
integrity sha512-BdBGhQBh8IjZ2oIIX6F2/Q3LKm/FDDKi6ccYKcBTeilh6SNdNKveDOLk73BkSJjQLJk6qe4Yh+hHw1UPhCDdrg==
dependencies:
"@opentelemetry/api-logs" "0.57.2"
"@types/shimmer" "^1.2.0"
import-in-the-middle "^1.8.1"
require-in-the-middle "^7.1.1"
semver "^7.5.2"
shimmer "^1.2.1"

"@parcel/[email protected]":
version "2.5.0"
resolved "https://registry.yarnpkg.com/@parcel/watcher-android-arm64/-/watcher-android-arm64-2.5.0.tgz#e32d3dda6647791ee930556aee206fcd5ea0fb7a"
Expand Down Expand Up @@ -3783,18 +3772,6 @@
dependencies:
esquery "^1.4.0"

"@prisma/client@^6.13.0":
version "6.13.0"
resolved "https://registry.yarnpkg.com/@prisma/client/-/client-6.13.0.tgz#7073ab6ccf10c0c99ab7582e39aa7a1422c6a7db"
integrity sha512-8m2+I3dQovkV8CkDMluiwEV1TxV9EXdT6xaCz39O6jYw7mkf5gwfmi+cL4LJsEPwz5tG7sreBwkRpEMJedGYUQ==

"@prisma/instrumentation@^6.13.0":
version "6.13.0"
resolved "https://registry.yarnpkg.com/@prisma/instrumentation/-/instrumentation-6.13.0.tgz#f2f774162b9247c870f306828da580c5102ff679"
integrity sha512-b97b0sBycGh89RQcqobSgjGl3jwPaC5cQIOFod6EX1v0zIxlXPmL3ckSXxoHpy+Js0QV/tgCzFvqicMJCtezBA==
dependencies:
"@opentelemetry/instrumentation" "^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"

"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
version "1.1.2"
resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
Expand Down Expand Up @@ -4512,11 +4489,6 @@
resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.8.tgz#8268a8c57a3e4abd25c165ecd36237db7948a55e"
integrity sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==

"@types/shimmer@^1.2.0":
version "1.2.0"
resolved "https://registry.yarnpkg.com/@types/shimmer/-/shimmer-1.2.0.tgz#9b706af96fa06416828842397a70dfbbf1c14ded"
integrity sha512-UE7oxhQLLd9gub6JKIAhDq06T0F6FnztwMNRvYgjeQSBeMc1ZG/tA47EwfduvkuQS8apbkM/lpLpWsaCeYsXVg==

"@types/stack-utils@^2.0.0":
version "2.0.3"
resolved "https://registry.yarnpkg.com/@types/stack-utils/-/stack-utils-2.0.3.tgz#6209321eb2c1712a7e7466422b8cb1fc0d9dd5d8"
Expand Down Expand Up @@ -5147,11 +5119,6 @@ acorn-globals@^6.0.0:
acorn "^7.1.1"
acorn-walk "^7.1.1"

acorn-import-attributes@^1.9.5:
version "1.9.5"
resolved "https://registry.yarnpkg.com/acorn-import-attributes/-/acorn-import-attributes-1.9.5.tgz#7eb1557b1ba05ef18b5ed0ec67591bfab04688ef"
integrity sha512-n02Vykv5uA3eHGM/Z2dQrcD56kL8TyDb2p1+0P83PClMnC/nc+anbQRhIOWnSq4Ke/KvDPrY3C9hDtC/A3eHnQ==

acorn-jsx@^5.3.2:
version "5.3.2"
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
Expand Down Expand Up @@ -6387,11 +6354,6 @@ cjs-module-lexer@^1.0.0:
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.1.tgz#707413784dbb3a72aa11c2f2b042a0bef4004170"
integrity sha512-cuSVIHi9/9E/+821Qjdvngor+xpnlwnuwIyZOaLmHBVdXL+gP+I6QQB9VkO7RI77YIcTV+S1W9AreJ5eN63JBA==

cjs-module-lexer@^1.2.2:
version "1.4.3"
resolved "https://registry.yarnpkg.com/cjs-module-lexer/-/cjs-module-lexer-1.4.3.tgz#0f79731eb8cfe1ec72acd4066efac9d61991b00d"
integrity sha512-9z8TZaGM1pfswYeXrUpzPrkx8UnWYdhJclsiYMm6x/w5+nN+8Tf/LnAgfLGQCm59qAOxU8WwHEq2vNwF6i4j+Q==

class-utils@^0.3.5:
version "0.3.6"
resolved "https://registry.yarnpkg.com/class-utils/-/class-utils-0.3.6.tgz#f93369ae8b9a7ce02fd41faad0ca83033190c463"
Expand Down Expand Up @@ -9571,16 +9533,6 @@ import-fresh@^3.1.0, import-fresh@^3.2.1, import-fresh@^3.3.0:
parent-module "^1.0.0"
resolve-from "^4.0.0"

import-in-the-middle@^1.8.1:
version "1.14.2"
resolved "https://registry.yarnpkg.com/import-in-the-middle/-/import-in-the-middle-1.14.2.tgz#283661625a88ff7c0462bd2984f77715c3bc967c"
integrity sha512-5tCuY9BV8ujfOpwtAGgsTx9CGUapcFMEEyByLv1B+v2+6DhAcw+Zr0nhQT7uwaZ7DiourxFEscghOR8e1aPLQw==
dependencies:
acorn "^8.14.0"
acorn-import-attributes "^1.9.5"
cjs-module-lexer "^1.2.2"
module-details-from-path "^1.0.3"

import-local@^3.0.2:
version "3.2.0"
resolved "https://registry.yarnpkg.com/import-local/-/import-local-3.2.0.tgz#c3d5c745798c02a6f8b897726aba5100186ee260"
Expand Down Expand Up @@ -9901,13 +9853,6 @@ is-core-module@^2.13.0, is-core-module@^2.15.1, is-core-module@^2.5.0, is-core-m
dependencies:
hasown "^2.0.2"

is-core-module@^2.16.0:
version "2.16.1"
resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.16.1.tgz#2a98801a849f43e2add644fbb6bc6229b19a4ef4"
integrity sha512-UfoeMA6fIJ8wTYFEUjelnaGI67v6+N7qXJEvQuIGa99l4xsCruSYOVSQ0uPANn4dAzm8lkYPaKLrrijLq7x23w==
dependencies:
hasown "^2.0.2"

is-data-descriptor@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/is-data-descriptor/-/is-data-descriptor-1.0.1.tgz#2109164426166d32ea38c405c1e0945d9e6a4eeb"
Expand Down Expand Up @@ -12175,11 +12120,6 @@ modify-values@^1.0.0:
resolved "https://registry.yarnpkg.com/modify-values/-/modify-values-1.0.1.tgz#b3939fa605546474e3e3e3c63d64bd43b4ee6022"
integrity sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==

module-details-from-path@^1.0.3:
version "1.0.4"
resolved "https://registry.yarnpkg.com/module-details-from-path/-/module-details-from-path-1.0.4.tgz#b662fdcd93f6c83d3f25289da0ce81c8d9685b94"
integrity sha512-EGWKgxALGMgzvxYF1UyGTy0HXX/2vHLkw6+NvDKW2jypWbHpjQuj4UMcqQWXHERJhVGKikolT06G3bcKe4fi7w==

morgan@^1.9.1:
version "1.10.0"
resolved "https://registry.yarnpkg.com/morgan/-/morgan-1.10.0.tgz#091778abc1fc47cd3509824653dae1faab6b17d7"
Expand Down Expand Up @@ -13961,15 +13901,6 @@ require-from-string@^2.0.2:
resolved "https://registry.yarnpkg.com/require-from-string/-/require-from-string-2.0.2.tgz#89a7fdd938261267318eafe14f9c32e598c36909"
integrity sha512-Xf0nWe6RseziFMu+Ap9biiUbmplq6S9/p+7w7YXP/JBHhrUDDUhwa+vANyubuqfZWTveU//DYVGsDG7RKL/vEw==

require-in-the-middle@^7.1.1:
version "7.5.2"
resolved "https://registry.yarnpkg.com/require-in-the-middle/-/require-in-the-middle-7.5.2.tgz#dc25b148affad42e570cf0e41ba30dc00f1703ec"
integrity sha512-gAZ+kLqBdHarXB64XpAe2VCjB7rIRv+mU8tfRWziHRJ5umKsIHN2tLLv6EtMw7WCdP19S0ERVMldNvxYCHnhSQ==
dependencies:
debug "^4.3.5"
module-details-from-path "^1.0.3"
resolve "^1.22.8"

requires-port@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff"
Expand Down Expand Up @@ -14026,15 +13957,6 @@ resolve@^1.10.0, resolve@^1.12.0, resolve@^1.14.2, resolve@^1.20.0, resolve@^1.2
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"

resolve@^1.22.8:
version "1.22.10"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.10.tgz#b663e83ffb09bbf2386944736baae803029b8b39"
integrity sha512-NPRy+/ncIMeDlTAsuqwKIiferiawhefFJtkNSW0qZJEqMEb+qBt/77B/jGeeek+F0uOeN05CDa6HXbbIgtVX4w==
dependencies:
is-core-module "^2.16.0"
path-parse "^1.0.7"
supports-preserve-symlinks-flag "^1.0.0"

resolve@^2.0.0-next.5:
version "2.0.0-next.5"
resolved "https://registry.yarnpkg.com/resolve/-/resolve-2.0.0-next.5.tgz#6b0ec3107e671e52b68cd068ef327173b90dc03c"
Expand Down Expand Up @@ -14253,11 +14175,6 @@ semver@^7.0.0, semver@^7.1.1, semver@^7.3.2, semver@^7.3.4, semver@^7.3.5, semve
resolved "https://registry.yarnpkg.com/semver/-/semver-7.6.3.tgz#980f7b5550bc175fb4dc09403085627f9eb33143"
integrity sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==

semver@^7.5.2:
version "7.7.2"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.7.2.tgz#67d99fdcd35cec21e6f8b87a7fd515a33f982b58"
integrity sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==

send@^1.1.0, send@^1.2.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/send/-/send-1.2.0.tgz#32a7554fb777b831dfa828370f773a3808d37212"
Expand Down Expand Up @@ -14414,11 +14331,6 @@ shiki@^1.16.2:
"@shikijs/vscode-textmate" "^9.3.0"
"@types/hast" "^3.0.4"

shimmer@^1.2.1:
version "1.2.1"
resolved "https://registry.yarnpkg.com/shimmer/-/shimmer-1.2.1.tgz#610859f7de327b587efebf501fb43117f9aff337"
integrity sha512-sQTKC1Re/rM6XyFM6fIAGHRPVGvyXfgzIDvzoq608vM+jeyVD0Tu1E6Np0Kc2zAIFWIj963V2800iF/9LPieQw==

side-channel-list@^1.0.0:
version "1.0.0"
resolved "https://registry.yarnpkg.com/side-channel-list/-/side-channel-list-1.0.0.tgz#10cb5984263115d3b7a0e336591e290a830af8ad"
Expand Down
Loading