i deploy contract(use console.log) in my Private blockchain(local net). where to find the print message?
i use geth run my Private blockchain. In Terminal , i can not find the print message.
add more image to expression my question
my private blockchain Terminal .
1 Answer
You can directly use the console.log
functionality in remix. Here's a sample contract loaded on remix that uses console.log
to print "Print something out":
After compiling you have to deploy the code:
Below the deploy button you would see the deployed contract:
Expand it and call the test function by clicking test
button and you would see the output in the terminal:
For convenience, I am also sharing the code here:
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;
import "hardhat/console.sol";
contract TestContract {
constructor() {
}
function test() public view {
console.log("Print something out");
}
}
-
thanks bro. i deploy to my Private blockchain. how to find consoleLog in Private blockchain. i know how to use in remix(jsvm environment).– ConwyJul 15, 2022 at 7:23