hardhat-ignition icon indicating copy to clipboard operation
hardhat-ignition copied to clipboard

Expose blocknumber information for successful deployments to support creation of subgraphs

Open kanej opened this issue 1 year ago • 2 comments
trafficstars

Reported on discord: https://discord.com/channels/750408878008827925/1153426756901032037/1212377098526924900

Building a subgraph requires knowing when to start indexing based on block number.

It should be possible to retrieve the block numbers of the successful transactions in the deployment.

The journal contains our on-chain interactions, including the hashes of our successful transactions. We should consider how we can expose that information and any other key transaction level metadata in Hardhat scripts and at the command line.

kanej avatar Mar 04 '24 09:03 kanej

Perhaps an approach here is to enhance the return result from core's status function:

export interface GenericContractInfo extends DeployedContract {
  sourceName: string;
  abi: Abi;
  deployedBlockNumber: number // <-- the block number of the successful deploy transaction
}

Alternatively we could provide a mechanism for getting transaction data from the log related to a future.

kanej avatar Apr 19 '24 10:04 kanej

even I am facing a similar issue, and need to get the blockNumber for startBlock of the subquery

nitishpatel avatar Jul 05 '24 07:07 nitishpatel