Skip to content

Commit

Permalink
feat: explorer link in cli logs (#5170)
Browse files Browse the repository at this point in the history
### Description

<!--
What's included in this PR?
-->
Add link to explorer message for hyperlane CLI `warp send` and `send
message` commands

### Drive-by changes

<!--
Are there any minor or drive-by changes also included?
-->
No

### Related issues

<!--
- Fixes #[issue number here]
-->

### Backward compatibility

<!--
Are these changes backward compatible? Are there any infrastructure
implications, e.g. changes that would prohibit deploying older commits
using this infra tooling?

Yes/No
-->
Yes
### Testing

<!--
What kind of testing have these changes undergone?

None/Manual/Unit Tests
-->
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)
  • Loading branch information
Xaroz authored Jan 15, 2025
1 parent c47511b commit 9eb19ca
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/three-walls-count.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@hyperlane-xyz/cli': minor
---

Add explorer link to warp send and send message commands
1 change: 1 addition & 0 deletions typescript/cli/src/consts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
3 changes: 2 additions & 1 deletion typescript/cli/src/send/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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) {
Expand Down
3 changes: 2 additions & 1 deletion typescript/cli/src/send/transfer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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)}`);

Expand Down

0 comments on commit 9eb19ca

Please sign in to comment.