onflow / flow-cli

The Flow CLI is a command-line interface that provides useful utilities for building Flow applications
https://onflow.org
Apache License 2.0
206 stars 66 forks source link

Link transactions to Flowscan in CLI outputs #1791

Open sisyphusSmiling opened 1 month ago

sisyphusSmiling commented 1 month ago

Issue To Be Solved

Currently, CLI outputs a transaction hash when sending a transaction and adding/updating a contract. Navigating to a block explorer then requires copying that transaction hash and inputting that hash into Flow's blockexplorer (flowscan.io) which is a highly manual process.

(Optional): Suggest A Solution

Other CLI tools such as Foundry link directly to the transaction or account page on the chosen block explorer. This would be a convenient add-on that improves developer quality of life - simply click on the link in the terminal output to inspect the transaction.

For flowscan (currently the only block explorer for Cadence transactions), URL generation would follow the pattern

https://<network == testnet ? "testnet." : nil>flowscan.io/tx/<TX_ID>