Skip to content

Commit

Permalink
display name according to checkpointed parentnet
Browse files Browse the repository at this point in the history
  • Loading branch information
wanwiset25 committed May 13, 2024
1 parent 42d4f30 commit a5cb288
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion backend/src/controllers/blocks.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,16 @@ export class BlocksController {
public getBlockChainStats = async (req: Request, res: Response, next: NextFunction): Promise<void> => {
try {
const [blockStatus, chainStatus] = await Promise.all([this.blockService.getBlockStats(), this.blockService.getBlockChainStatus()]);
let display_name: string
if (PARENTNET_URL == 'https://devnetstats.apothem.network/devnet') {
display_name = 'Devnet'
} else if (PARENTNET_URL == 'https://devnetstats.apothem.network/testnet') {
display_name = 'Testnet'
} else if (PARENTNET_URL == 'https://devnetstats.apothem.network/mainnet') {
display_name = 'Mainnet'
} else {
display_name = PARENTNET_URL
}
const resp = {
subnet: {
block: {
Expand All @@ -71,7 +81,7 @@ export class BlocksController {
},
parentChain: {
url: PARENTNET_URL,
name: 'Devnet', // TODO: get from web3 api
name: display_name
},
health: {
status: chainStatus ? 'UP' : 'DOWN',
Expand Down

0 comments on commit a5cb288

Please sign in to comment.