Hi, is there any way to load a text file in the geth console?

...I'm aware of "loadScript()" to load a js file, but what about loading a plain text file into a string? (I want to load a contract file into a javascript string so that I can compile it)

Thanks for any pointers!

Comments

  • SmithgiftSmithgift Member Posts: 64
    edited May 2015
    It's probably easier to manually create a javascript file containing the text as a string. Example from the go-ethereum wiki:
    source = "contract test {\n" +
    "   /// @notice will multiply `a` by 7.\n" +
    "   function multiply(uint a) returns(uint d) {\n" +
    "      return a * 7;\n" +
    "   }\n" +
    "} ";
    Easier than that would be writing some kind of (bash/python/perl/etc) script to generate a file like this automatically.
    Post edited by StephanTual on
  • lisperatilisperati Member Posts: 5
    Hi Smithgift, that's what I ended up doing- Thanks for confirming there isn't any simpler solution!
Sign In or Register to comment.