Skip to main content
edited tags
Link
Nicolas Massart
  • 6.8k
  • 2
  • 29
  • 63
Source Link
TMOTTM
  • 2k
  • 2
  • 14
  • 25

How to readin javascript code into the geth console?

In the contracts tutorial, quite a long piece of code is provided on the geth console to the client:

[...]
function(e, contract){
  if(!e) {

    if(!contract.address) {
      console.log("Contract transaction send: TransactionHash: " + contract.transactionHash + " waiting to be mined...");

    } else {
      console.log("Contract mined! Address: " + contract.address);
      console.log(contract);
    }

  }
}

How could I provide this function definition from an external file to the console?, such that I don't have to write it all on the console which is quite inconveniente i find.