0

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 . enter image description here

i deploy in my private blockchain enter image description here

1 Answer 1

1

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":

enter image description here

After compiling you have to deploy the code:

enter image description here

Below the deploy button you would see the deployed contract:

enter image description here

Expand it and call the test function by clicking test button and you would see the output in the terminal:

enter image description here

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");
    }

}
1
  • thanks bro. i deploy to my Private blockchain. how to find consoleLog in Private blockchain. i know how to use in remix(jsvm environment).
    – Conwy
    Commented Jul 15, 2022 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.