最后在新窗口中运行yarn hardhat run .\scripts\deploy.js --network localhost
>yarn hardhat run .\scripts\deploy.js --network localhost
Deploying contract...
Deployed contract address: 0x5FbDB2315678afecb367f032d93F642f64180aa3
Current Value is :0
Updated Value is: 7
Done in1.88s.
切换到运行本地节点的窗口,可以查到具体的日志信息
eth_chainId
eth_accounts
hardhat_metadata (20)
eth_blockNumber
eth_getBlockByNumber
eth_feeHistory
eth_sendTransaction
Contract deployment: SimpleStorage
Contract address: 0x5fbdb2315678afecb367f032d93f642f64180aa3
Transaction: 0x4513914f378ac34a126e911c7bc4812924d4b07cb2471f5b7e2468d5be68019b
From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
Value: 0 ETH
Gas used: 562691 of 30000000
Block #1: 0x3c7602aac34eceaa1578f447426a376745b565565e43560619ad4579d40d687d
eth_getTransactionByHash
eth_getTransactionReceipt
eth_blockNumber
eth_call
Contract call: SimpleStorage#retrieve
From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
To: 0x5fbdb2315678afecb367f032d93f642f64180aa3
eth_blockNumber
eth_feeHistory
eth_sendTransaction
Contract call: SimpleStorage#store
Transaction: 0x260c8c546f56b715788a06ae7c8314829c32143e65df27c10afdc24e14bf1df8
From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
To: 0x5fbdb2315678afecb367f032d93f642f64180aa3
Value: 0 ETH
Gas used: 43724 of 30000000
Block #2: 0x5945408b94f401a74121d91a3717f1f80608885ea7848c566108e1713e58d0b3
eth_getTransactionByHash
eth_getTransactionReceipt
eth_call
Contract call: SimpleStorage#retrieve
From: 0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266
To: 0x5fbdb2315678afecb367f032d93f642f64180aa3
eth_blockNumber