Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge from main #72

Merged
merged 25 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c212db9
Merge pull request #52 from ATOR-Development/leggo/phase-1/dev
SuchJitter Jul 17, 2024
1da8fe3
Merge pull request #53 from ATOR-Development/leggo/phase-1/dev
SuchJitter Jul 17, 2024
9e955b8
Merge pull request #54 from ATOR-Development/leggo/phase-1/dev
SuchJitter Jul 17, 2024
93c981b
Merge pull request #55 from ATOR-Development/leggo/phase-1/dev
MarcoMandar Jul 18, 2024
9b77364
Merge pull request #56 from ATOR-Development/leggo/phase-1/dev
SuchJitter Jul 23, 2024
0dafc39
Merge pull request #57 from ATOR-Development/leggo/phase-1/dev
SuchJitter Jul 31, 2024
c08be3a
Merge pull request #58 from ATOR-Development/leggo/phase-1/dev
MarcoMandar Aug 5, 2024
414ac89
Merge pull request #59 from ATOR-Development/leggo/phase-1/dev
MarcoMandar Aug 7, 2024
d70664b
Merge pull request #60 from ATOR-Development/leggo/phase-1/dev
SuchJitter Aug 17, 2024
3490431
Merge pull request #61 from ATOR-Development/leggo/phase-1/dev
SuchJitter Aug 18, 2024
4348463
Merge pull request #62 from ATOR-Development/leggo/phase-1/dev
SuchJitter Aug 19, 2024
a28bcbc
Merge pull request #63 from ATOR-Development/leggo/phase-1/dev
MarcoMandar Aug 21, 2024
692036b
Merge pull request #64 from ATOR-Development/leggo/phase-1/dev
MarcoMandar Aug 21, 2024
ddb9384
Merge pull request #65 from ATOR-Development/leggo/phase-1/dev
SuchJitter Aug 24, 2024
092e211
Merge pull request #66 from ATOR-Development/leggo/phase-1/dev
MarcoMandar Aug 26, 2024
6575e3f
Merge pull request #67 from ATOR-Development/leggo/phase-1/dev
MarcoMandar Aug 27, 2024
b5ae6d1
Merge pull request #68 from ATOR-Development/leggo/phase-1/dev
MarcoMandar Aug 27, 2024
b31f0fa
Copy index.html to a file named '*' to act as wildcard route
jim-toth Aug 28, 2024
43888b4
Renamed dns of the dre node
kanshi Aug 29, 2024
fe1596d
Merge pull request #70 from ATOR-Development/leggo/phase-1/dev
SuchJitter Sep 1, 2024
db677f1
Use 'anyone' arns ant process id
jim-toth Sep 3, 2024
6bfffb2
GM org renames
kanshi Sep 4, 2024
1ffc2c1
Fail deploy job if any errors are thrown
jim-toth Sep 5, 2024
6ba319b
Fix wildcard in deploy script
jim-toth Sep 5, 2024
e87484b
Updates arweave metrics queries (relay/metrics & validation/stats) to…
jim-toth Sep 5, 2024
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
2 changes: 1 addition & 1 deletion components/DashboardFooter.vue
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ const getLink = (address: string, type: string) => {
};

const openCommitUrl = () => {
const url = `https://github.com/ATOR-Development/ator-relay-dashboard/commit/${commitHash}`;
const url = `https://github.com/anyone-protocol/ator-relay-dashboard/commit/${commitHash}`;
window.open(url, '_blank');
};

Expand Down
5 changes: 3 additions & 2 deletions composables/ardb.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ export async function getLatestBlockHeight(): Promise<number> {
return height;
}

export async function calculateBlockHeightOneMonthAgo(
export async function calculateMinimumQueryBlockHeight(
latestHeight: number
): Promise<number> {
const blocksPerMonth = 60 * 24 * 30;
return latestHeight - blocksPerMonth;
const twoWeeksAgo = Math.floor(blocksPerMonth / 2);
return latestHeight - twoWeeksAgo;
}
14 changes: 12 additions & 2 deletions deploy.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
import Irys from '@irys/sdk'
import { ANT, ArweaveSigner } from '@ar.io/sdk'
import { copyFileSync } from 'fs'

// ator-dashboard process id
// const processId = '9UpvN6H7sMo0vkuQeou3Ra0pZguWavtpt_8lfqPQlI8'

// anyone process id
const processId = 'lZKDfIa5JiWQ8ojjXiRSey_81Bftbib4tLpIJh4UO0g'

const processId = '9UpvN6H7sMo0vkuQeou3Ra0pZguWavtpt_8lfqPQlI8'
const DEPLOY_FOLDER = './.output/public'
const IRYS_NODE = 'https://node2.irys.xyz/'
const jwk = JSON.parse(
Expand All @@ -21,6 +27,10 @@ if (process.env.PHASE === 'stage') {
}

async function deploy() {
// Hack: copy index.html to a file named "*" so it gets added to manifest as
// a wildcard route
copyFileSync(DEPLOY_FOLDER + '/index.html', DEPLOY_FOLDER + '/*')

const buildArtifact = await irys.uploadFolder(DEPLOY_FOLDER, {
indexFile: 'index.html'
})
Expand All @@ -46,4 +56,4 @@ async function deploy() {
)
}

deploy().then().catch(err => console.error(err))
deploy().then().catch(err => { console.error(err); process.exit(1); })
2 changes: 1 addition & 1 deletion nuxt.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default defineNuxtConfig({
distributionDeployer: 'G5tXjZS4SaMJNwOENZYgymvc6Zxp2Wws4Qf8wB0b',
warpGateway: 'https://gw.warp.cc/gateway/v2',
githubNewIssueUrl:
'https://github.com/ATOR-Development/ator-dashboard/issues/new',
'https://github.com/anyone-protocol/ator-dashboard/issues/new',
phase: 'dev',
supportWalletPublicKeyBase64:
'K3jnSGVyHj4kSzgce3+k8gJsfHvUoQeJMNPO8CcsO2s=',
Expand Down
4 changes: 2 additions & 2 deletions operations/deploy-dashboard-dev.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ job "deploy-relay-dashboard-dev" {
driver = "docker"

config {
image = "ghcr.io/ator-development/ator-relay-dashboard:[[.deploy]]"
image = "ghcr.io/anyone-protocol/ator-relay-dashboard:[[.deploy]]"
force_pull = true
entrypoint = ["pnpm"]
command = "run"
Expand All @@ -29,7 +29,7 @@ job "deploy-relay-dashboard-dev" {
NUXT_PUBLIC_DISTRIBUTION_CONTRACT="[[ consulKey "smart-contracts/dev/distribution-address" ]]"
NUXT_PUBLIC_FACILITATOR_CONTRACT="[[ consulKey "facilitator/sepolia/dev/address" ]]"
NUXT_PUBLIC_SEPOLIA_ATOR_TOKEN_CONTRACT="[[ consulKey "ator-token/sepolia/dev/address" ]]"
NUXT_PUBLIC_WARP_GATEWAY = "https://warp-dre-node-dev.dmz.ator.dev"
NUXT_PUBLIC_WARP_GATEWAY = "https://dre-dev.ec.anyone.tech"
NUXT_PUBLIC_SUPPORT_WALLET_PUBLIC_KEY_BASE64 = "{{.Data.data.SUPPORT_ADDRESS_BASE64}}"
NUXT_PUBLIC_REGISTRATOR_CONTRACT="[[ consulKey "registrator/sepolia/dev/address" ]]"
{{with secret "kv/dashboard/dev"}}
Expand Down
4 changes: 2 additions & 2 deletions operations/deploy-dashboard-live.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ job "deploy-relay-dashboard-live" {
driver = "docker"

config {
image = "ghcr.io/ator-development/ator-relay-dashboard:[[.deploy]]"
image = "ghcr.io/anyone-protocol/ator-relay-dashboard:[[.deploy]]"
entrypoint = ["pnpm"]
command = "run"
args = ["deploy"]
Expand All @@ -28,7 +28,7 @@ job "deploy-relay-dashboard-live" {
NUXT_PUBLIC_DISTRIBUTION_CONTRACT="[[ consulKey "smart-contracts/live/distribution-address" ]]"
NUXT_PUBLIC_FACILITATOR_CONTRACT="[[ consulKey "facilitator/sepolia/live/address" ]]"
NUXT_PUBLIC_SEPOLIA_ATOR_TOKEN_CONTRACT="[[ consulKey "ator-token/sepolia/live/address" ]]"
NUXT_PUBLIC_WARP_GATEWAY = "https://warp-dre-node-live.dmz.ator.dev"
NUXT_PUBLIC_WARP_GATEWAY = "https://dre.ec.anyone.tech"
NUXT_PUBLIC_REGISTRATOR_CONTRACT="[[ consulKey "registrator/sepolia/live/address" ]]"
{{with secret "kv/dashboard/live"}}
PERMAWEB_KEY="{{.Data.data.DASHBOARD_OWNER_KEY}}"
Expand Down
4 changes: 2 additions & 2 deletions operations/deploy-dashboard-stage.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ job "deploy-relay-dashboard-stage" {
driver = "docker"

config {
image = "ghcr.io/ator-development/ator-relay-dashboard:[[.deploy]]"
image = "ghcr.io/anyone-protocol/ator-relay-dashboard:[[.deploy]]"
force_pull = true
entrypoint = ["pnpm"]
command = "run"
Expand All @@ -29,7 +29,7 @@ job "deploy-relay-dashboard-stage" {
NUXT_PUBLIC_DISTRIBUTION_CONTRACT="[[ consulKey "smart-contracts/stage/distribution-address" ]]"
NUXT_PUBLIC_FACILITATOR_CONTRACT="[[ consulKey "facilitator/sepolia/stage/address" ]]"
NUXT_PUBLIC_SEPOLIA_ATOR_TOKEN_CONTRACT="[[ consulKey "ator-token/sepolia/stage/address" ]]"
NUXT_PUBLIC_WARP_GATEWAY = "https://warp-dre-node-stage.dmz.ator.dev"
NUXT_PUBLIC_WARP_GATEWAY = "https://dre-stage.ec.anyone.tech"
NUXT_PUBLIC_REGISTRATOR_CONTRACT="[[ consulKey "registrator/sepolia/stage/address" ]]"
{{with secret "kv/dashboard/stage"}}
PERMAWEB_KEY="{{.Data.data.DASHBOARD_OWNER_KEY}}"
Expand Down
16 changes: 16 additions & 0 deletions operations/scripts/fund.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import Irys from '@irys/sdk'

const IRYS_NODE = 'https://node2.irys.xyz/'
const jwk = JSON.parse(
Buffer.from(process.env.PERMAWEB_KEY || 'NO_KEY', 'base64').toString('utf-8')
)
const irys = new Irys({ url: IRYS_NODE, token: 'arweave', key: jwk })

async function fund() {
const fundResponse = await irys.fund(irys.utils.toAtomic('0.1'))

console.log('Fund response')
console.dir(fundResponse)
}

fund().then().catch(err => { console.error(err); process.exit(1); })
14 changes: 14 additions & 0 deletions operations/scripts/get-balance.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import Irys from '@irys/sdk'

const IRYS_NODE = 'https://node2.irys.xyz/'
const jwk = JSON.parse(
Buffer.from(process.env.PERMAWEB_KEY || 'NO_KEY', 'base64').toString('utf-8')
)
const irys = new Irys({ url: IRYS_NODE, token: 'arweave', key: jwk })

async function getBalance() {
const balance = await irys.getLoadedBalance()
console.log('Irys AR balance', irys.utils.fromAtomic(balance))
}

getBalance().then().catch(err => { console.error(err); process.exit(1); })
28 changes: 14 additions & 14 deletions stores/useMetricsStore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { parseTimestampTag } from '@/utils/transactions';
import {
useArdb,
getLatestBlockHeight,
calculateBlockHeightOneMonthAgo,
calculateMinimumQueryBlockHeight,
} from '@/composables/ardb';
import { useTxCache } from '@/composables/txCache';

Expand Down Expand Up @@ -71,7 +71,7 @@ export interface MetricsStoreState {
};
relayMetricsPending: boolean;
latestHeight: number | null;
oneMonthAgoHeight: number | null;
minimumHeight: number | null;
}

const logger = new Logger('MetricsStore');
Expand All @@ -92,7 +92,7 @@ export const useMetricsStore = defineStore('metrics', {
},
relayMetricsPending: true,
latestHeight: null,
oneMonthAgoHeight: null,
minimumHeight: null,
};
},
getters: {},
Expand Down Expand Up @@ -125,13 +125,13 @@ export const useMetricsStore = defineStore('metrics', {
if (!this.latestHeight) {
this.latestHeight = await getLatestBlockHeight();
}
if (!this.oneMonthAgoHeight) {
this.oneMonthAgoHeight = await calculateBlockHeightOneMonthAgo(
if (!this.minimumHeight) {
this.minimumHeight = await calculateMinimumQueryBlockHeight(
this.latestHeight
);
}
console.log('this.latestHeight', this.latestHeight);
console.log('this.oneMonthAgoHeight', this.oneMonthAgoHeight);
console.log('this.minimumHeight', this.minimumHeight);

const txCache = useTxCache();

Expand All @@ -140,12 +140,12 @@ export const useMetricsStore = defineStore('metrics', {
.search('transactions')
.from(runtimeConfig.public.metricsDeployer as string)
.tags([
{ name: 'Protocol', values: 'ator' },
// { name: 'Protocol', values: 'ator' },
{ name: 'Entity-Type', values: 'relay/metrics' },
])
.limit(limit)
.min(this.oneMonthAgoHeight)
.max(this.latestHeight)
.min(this.minimumHeight)
// .max(this.latestHeight)
.sort('HEIGHT_DESC')
.find()) as ArdbTransaction[];

Expand Down Expand Up @@ -202,8 +202,8 @@ export const useMetricsStore = defineStore('metrics', {
if (!this.latestHeight) {
this.latestHeight = await getLatestBlockHeight();
}
if (!this.oneMonthAgoHeight) {
this.oneMonthAgoHeight = await calculateBlockHeightOneMonthAgo(
if (!this.minimumHeight) {
this.minimumHeight = await calculateMinimumQueryBlockHeight(
this.latestHeight
);
}
Expand All @@ -212,12 +212,12 @@ export const useMetricsStore = defineStore('metrics', {
.search('transactions')
.from(runtimeConfig.public.metricsDeployer as string)
.tags([
{ name: 'Protocol', values: 'ator' },
// { name: 'Protocol', values: 'ator' },
{ name: 'Entity-Type', values: 'validation/stats' },
])
.limit(limit)
.min(this.oneMonthAgoHeight)
.max(this.latestHeight)
.min(this.minimumHeight)
// .max(this.latestHeight)
.sort('HEIGHT_DESC')
.find()) as ArdbTransaction[];

Expand Down
Loading