diff --git a/.github/workflows/build_testnet_mainnet.yml b/.github/workflows/build_testnet_mainnet.yml index 491143e..e5079ca 100644 --- a/.github/workflows/build_testnet_mainnet.yml +++ b/.github/workflows/build_testnet_mainnet.yml @@ -24,8 +24,8 @@ jobs: uses: PaulHatch/semantic-version@v5.4.0 with: tag_prefix: "v" - major_pattern: "(MAJOR)" - minor_pattern: "(feat|feature)" + major_pattern: "/MAJOR/" + minor_pattern: "/feat:/" version_format: "${major}.${minor}.${patch}" build: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a5376cd..ef603c8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,114 +7,114 @@ on: # - main jobs: - generate-version: - name: Generate Semantic Version - runs-on: ubuntu-latest - outputs: - version: ${{ steps.version.outputs.version }} - version_tag: ${{ steps.version.outputs.version_tag }} - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Generate Semantic Version - id: version - uses: PaulHatch/semantic-version@v5.4.0 - with: - tag_prefix: 'v' - major_pattern: '(MAJOR)' - minor_pattern: '(feat|feature)' - version_format: '${major}.${minor}.${patch}' - - install-dependencies: - name: Install Dependencies - runs-on: ubuntu-latest - needs: generate-version - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Install Node.js - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: 'npm' - - - name: Install dependencies - run: npm install - - - name: Cache node_modules - uses: actions/cache@v4 - with: - path: node_modules - key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - restore-keys: npm-${{ runner.os }}- - - build: - name: Build Next.js App - runs-on: ubuntu-latest - needs: [install-dependencies, generate-version] - strategy: - matrix: - network: [devnet, testnet, mainnet] - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Restore node_modules cache - uses: actions/cache@v4 - with: - path: node_modules - key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }} - restore-keys: npm-${{ runner.os }}- - - - name: Build Next.js App app for ${{ matrix.network }} - run: npm run build:${{ matrix.network }} - env: - NODE_ENV: production - MORALIS_API_KEY: ${{ secrets.MORALIS_API_KEY }} - ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} - NEXT_PUBLIC_APP_VERSION: ${{ needs.generate-version.outputs.version }} - - - name: Copy required assets - run: | - cp -r .next/static .next/standalone/.next/static - cp -r public .next/standalone/public - - - name: Archive standalone build - run: zip -r ratio1-explorer-${{ matrix.network }}.zip .next/standalone - - - name: Upload Build as Artifact - uses: actions/upload-artifact@v4 - with: - name: ratio1-explorer-${{ matrix.network }} - path: ratio1-explorer-${{ matrix.network }}.zip - - release: - name: Create GitHub Release - runs-on: ubuntu-latest - needs: [build, generate-version] - steps: - - name: Checkout repository - uses: actions/checkout@v4 - - - name: Download All Artifacts - uses: actions/download-artifact@v4 - with: - path: builds - - - name: List downloaded files - run: ls -R builds - - - name: Create GitHub Release - uses: softprops/action-gh-release@v2 - with: - tag_name: ${{ needs.generate-version.outputs.version_tag }} - name: v${{ needs.generate-version.outputs.version }} - draft: false - prerelease: false - files: builds/**/* - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + generate-version: + name: Generate Semantic Version + runs-on: ubuntu-latest + outputs: + version: ${{ steps.version.outputs.version }} + version_tag: ${{ steps.version.outputs.version_tag }} + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Generate Semantic Version + id: version + uses: PaulHatch/semantic-version@v5.4.0 + with: + tag_prefix: "v" + major_pattern: "/MAJOR/" + minor_pattern: "/feat:/" + version_format: "${major}.${minor}.${patch}" + + install-dependencies: + name: Install Dependencies + runs-on: ubuntu-latest + needs: generate-version + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 18 + cache: "npm" + + - name: Install dependencies + run: npm install + + - name: Cache node_modules + uses: actions/cache@v4 + with: + path: node_modules + key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: npm-${{ runner.os }}- + + build: + name: Build Next.js App + runs-on: ubuntu-latest + needs: [install-dependencies, generate-version] + strategy: + matrix: + network: [devnet, testnet, mainnet] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Restore node_modules cache + uses: actions/cache@v4 + with: + path: node_modules + key: npm-${{ runner.os }}-${{ hashFiles('package-lock.json') }} + restore-keys: npm-${{ runner.os }}- + + - name: Build Next.js App app for ${{ matrix.network }} + run: npm run build:${{ matrix.network }} + env: + NODE_ENV: production + MORALIS_API_KEY: ${{ secrets.MORALIS_API_KEY }} + ALCHEMY_API_KEY: ${{ secrets.ALCHEMY_API_KEY }} + NEXT_PUBLIC_APP_VERSION: ${{ needs.generate-version.outputs.version }} + + - name: Copy required assets + run: | + cp -r .next/static .next/standalone/.next/static + cp -r public .next/standalone/public + + - name: Archive standalone build + run: zip -r ratio1-explorer-${{ matrix.network }}.zip .next/standalone + + - name: Upload Build as Artifact + uses: actions/upload-artifact@v4 + with: + name: ratio1-explorer-${{ matrix.network }} + path: ratio1-explorer-${{ matrix.network }}.zip + + release: + name: Create GitHub Release + runs-on: ubuntu-latest + needs: [build, generate-version] + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Download All Artifacts + uses: actions/download-artifact@v4 + with: + path: builds + + - name: List downloaded files + run: ls -R builds + + - name: Create GitHub Release + uses: softprops/action-gh-release@v2 + with: + tag_name: ${{ needs.generate-version.outputs.version_tag }} + name: v${{ needs.generate-version.outputs.version }} + draft: false + prerelease: false + files: builds/**/* + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/app/server-components/CPSs/CSPCard.tsx b/app/server-components/CPSs/CSPCard.tsx index 379bed8..6d78fc0 100644 --- a/app/server-components/CPSs/CSPCard.tsx +++ b/app/server-components/CPSs/CSPCard.tsx @@ -50,6 +50,10 @@ export default async function CSPCard({ csp }: { csp: types.CSP }) { } /> +
+ +
+
diff --git a/app/server-components/CPSs/CSPsList.tsx b/app/server-components/CPSs/CSPsList.tsx index c28376e..2430966 100644 --- a/app/server-components/CPSs/CSPsList.tsx +++ b/app/server-components/CPSs/CSPsList.tsx @@ -35,6 +35,7 @@ export default async function CSPsList({ csps, currentPage }: { csps: readonly t
Owner
Escrow Address
+
CSP Level
TVL ($USDC)
Active Jobs
diff --git a/app/server-components/SearchResultsList.tsx b/app/server-components/SearchResultsList.tsx index 2cba734..a5e1aa3 100644 --- a/app/server-components/SearchResultsList.tsx +++ b/app/server-components/SearchResultsList.tsx @@ -17,6 +17,7 @@ export default function SearchResultsList({ results, variant, getSectionTitle, o 'rounded-xl border-2 border-slate-100 hover:border-slate-200 py-3': variant === 'search-page', '-mx-4 py-2.5 hover:bg-slate-50': variant === 'modal', }); + const nodeAddressLabelClassName = 'w-14 text-xs font-semibold uppercase tracking-normal text-slate-400'; return (
@@ -55,7 +56,19 @@ export default function SearchResultsList({ results, variant, getSectionTitle, o
{node.alias}
- +
+
+
ETH
+ +
+ + {!!node.internalAddress && ( +
+
Internal
+ +
+ )} +
diff --git a/lib/actions.ts b/lib/actions.ts index 10f9df2..96c2de1 100644 --- a/lib/actions.ts +++ b/lib/actions.ts @@ -87,6 +87,7 @@ export const search = async ( resultsArray.push({ type: 'node', nodeAddress: nodeResponse.node_eth_address, + internalAddress: nodeResponse.node as types.R1Address, alias: nodeResponse.node_alias, isOnline: nodeResponse.node_is_online, }); @@ -148,10 +149,11 @@ export const search = async ( console.log('[Search] getActiveNodes', response); if (response.result.nodes) { - Object.entries(response.result.nodes).forEach(([_ratio1Addr, node]) => { + Object.entries(response.result.nodes).forEach(([ratio1Addr, node]) => { resultsArray.push({ type: 'node', nodeAddress: node.eth_addr, + internalAddress: ratio1Addr as types.R1Address, alias: node.alias, isOnline: parseInt(node.last_seen_ago.split(':')[2]) < 60, }); diff --git a/lib/utils.tsx b/lib/utils.tsx index 97a9ec3..4321d45 100644 --- a/lib/utils.tsx +++ b/lib/utils.tsx @@ -256,6 +256,7 @@ export const clientSearch = async ( resultsArray.push({ type: 'node', nodeAddress: nodeResponse.node_eth_address, + internalAddress: nodeResponse.node as types.R1Address, alias: nodeResponse.node_alias, isOnline: nodeResponse.node_is_online, }); @@ -317,10 +318,11 @@ export const clientSearch = async ( if (isLoggingEnabled) console.log('[Search] getActiveNodes', response); if (response.result.nodes) { - Object.entries(response.result.nodes).forEach(([_ratio1Addr, node]) => { + Object.entries(response.result.nodes).forEach(([ratio1Addr, node]) => { resultsArray.push({ type: 'node', nodeAddress: node.eth_addr, + internalAddress: ratio1Addr as types.R1Address, alias: node.alias, isOnline: parseInt(node.last_seen_ago.split(':')[2]) < 60, }); diff --git a/typedefs/general.ts b/typedefs/general.ts index bf6970e..0c70cbf 100644 --- a/typedefs/general.ts +++ b/typedefs/general.ts @@ -16,7 +16,13 @@ type LicenseListItem = LicenseItem & { }; type SearchResult = - | { type: 'node'; nodeAddress: types.EthAddress; alias: string; isOnline: boolean } + | { + type: 'node'; + nodeAddress: types.EthAddress; + internalAddress?: types.R1Address; + alias: string; + isOnline: boolean; + } | { type: 'license'; licenseId: number; licenseType: 'ND' | 'MND' | 'GND'; nodeAddress: types.EthAddress } | { type: 'owner'; address: types.EthAddress; ensName?: string }; diff --git a/typedefs/search-result-types.test.ts b/typedefs/search-result-types.test.ts new file mode 100644 index 0000000..bb28416 --- /dev/null +++ b/typedefs/search-result-types.test.ts @@ -0,0 +1,18 @@ +import * as types from './blockchain'; +import { SearchResult } from './general'; + +const ethAddress = '0x1111111111111111111111111111111111111111' as types.EthAddress; +const internalAddress = '0xai_11111111111111111111111111111111111111111111' as types.R1Address; + +const nodeSearchResult: SearchResult = { + type: 'node', + nodeAddress: ethAddress, + internalAddress, + alias: 'smart0', + isOnline: true, +}; + +if (nodeSearchResult.type === 'node') { + const copiedAddress: types.R1Address | undefined = nodeSearchResult.internalAddress; + void copiedAddress; +}