From 9eb19cac7a382a5bc1c9b88ebd52f1ec90330839 Mon Sep 17 00:00:00 2001 From: Jason Guo <33064781+Xaroz@users.noreply.github.com> Date: Wed, 15 Jan 2025 09:13:26 -0600 Subject: [PATCH] feat: explorer link in cli logs (#5170) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Description Add link to explorer message for hyperlane CLI `warp send` and `send message` commands ### Drive-by changes No ### Related issues ### Backward compatibility Yes ### Testing CLI send message command: ![Screenshot 2025-01-14 at 3 30 51 PM](https://github.com/user-attachments/assets/dac9a9ae-0b19-43a2-8d12-6c15551a1b50) warp send command: ![Screenshot 2025-01-14 at 3 32 32 PM](https://github.com/user-attachments/assets/afb114fd-9397-40bd-a29a-3d6e07f5938d) --- .changeset/three-walls-count.md | 5 +++++ typescript/cli/src/consts.ts | 1 + typescript/cli/src/send/message.ts | 3 ++- typescript/cli/src/send/transfer.ts | 3 ++- 4 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 .changeset/three-walls-count.md diff --git a/.changeset/three-walls-count.md b/.changeset/three-walls-count.md new file mode 100644 index 0000000000..37145b9838 --- /dev/null +++ b/.changeset/three-walls-count.md @@ -0,0 +1,5 @@ +--- +'@hyperlane-xyz/cli': minor +--- + +Add explorer link to warp send and send message commands diff --git a/typescript/cli/src/consts.ts b/typescript/cli/src/consts.ts index 9fb27df9f2..9c931cab26 100644 --- a/typescript/cli/src/consts.ts +++ b/typescript/cli/src/consts.ts @@ -3,3 +3,4 @@ export const MINIMUM_WARP_DEPLOY_GAS = (3e7).toString(); export const MINIMUM_TEST_SEND_GAS = (3e5).toString(); export const MINIMUM_AVS_GAS = (3e6).toString(); export const PROXY_DEPLOYED_URL = 'https://proxy.hyperlane.xyz'; +export const EXPLORER_URL = 'https://explorer.hyperlane.xyz'; diff --git a/typescript/cli/src/send/message.ts b/typescript/cli/src/send/message.ts index e43d08fe2c..b6d75b4e51 100644 --- a/typescript/cli/src/send/message.ts +++ b/typescript/cli/src/send/message.ts @@ -3,7 +3,7 @@ import { stringify as yamlStringify } from 'yaml'; import { ChainName, HyperlaneCore, HyperlaneRelayer } from '@hyperlane-xyz/sdk'; import { addressToBytes32, timeout } from '@hyperlane-xyz/utils'; -import { MINIMUM_TEST_SEND_GAS } from '../consts.js'; +import { EXPLORER_URL, MINIMUM_TEST_SEND_GAS } from '../consts.js'; import { CommandContext, WriteCommandContext } from '../context/types.js'; import { runPreflightChecksForChains } from '../deploy/utils.js'; import { errorRed, log, logBlue, logGreen } from '../logger.js'; @@ -102,6 +102,7 @@ async function executeDelivery({ ); logBlue(`Sent message from ${origin} to ${recipient} on ${destination}.`); logBlue(`Message ID: ${message.id}`); + logBlue(`Explorer Link: ${EXPLORER_URL}/message/${message.id}`); log(`Message:\n${indentYamlOrJson(yamlStringify(message, null, 2), 4)}`); if (selfRelay) { diff --git a/typescript/cli/src/send/transfer.ts b/typescript/cli/src/send/transfer.ts index 8aa4cca59b..1fabc3c853 100644 --- a/typescript/cli/src/send/transfer.ts +++ b/typescript/cli/src/send/transfer.ts @@ -14,7 +14,7 @@ import { } from '@hyperlane-xyz/sdk'; import { parseWarpRouteMessage, timeout } from '@hyperlane-xyz/utils'; -import { MINIMUM_TEST_SEND_GAS } from '../consts.js'; +import { EXPLORER_URL, MINIMUM_TEST_SEND_GAS } from '../consts.js'; import { WriteCommandContext } from '../context/types.js'; import { runPreflightChecksForChains } from '../deploy/utils.js'; import { log, logBlue, logGreen, logRed } from '../logger.js'; @@ -167,6 +167,7 @@ async function executeDelivery({ `Sent transfer from sender (${signerAddress}) on ${origin} to recipient (${recipient}) on ${destination}.`, ); logBlue(`Message ID: ${message.id}`); + logBlue(`Explorer Link: ${EXPLORER_URL}/message/${message.id}`); log(`Message:\n${indentYamlOrJson(yamlStringify(message, null, 2), 4)}`); log(`Body:\n${indentYamlOrJson(yamlStringify(parsed, null, 2), 4)}`);