0

I installed ethereumjs library using following command:

npm i ethereumjs-testrpc

And here is the output:

enter image description here

And then I tried to run an html example which uses ethereumjs-vm. The example is here : https://github.com/ethereumjs/browser-builds/blob/master/examples/vm.html

However, when I open this html file, there is an error message :

ethereumjs is not defined.

Here is screen shot:

enter image description here

Does it mean that I need to modigy following directory in the html file ?

<script src="../dist/ethereumjs-vm/ethereumjs-vm-2.3.1.js"></script>

Note: My main purpose is to run successfully JavaScript code presented HERE . When I run it using node I receive some errors. What is the best way of running this JavaScript code? Do I need to create an html file and run it with browser? or it's better to create a JavaScript file and run it using node filename.js ? The problem with running this code that is for signature verification is explained in details HERE . Eventually, I had to change some part of JavaScript code (I precised which parts have been changed in my question HERE ). However, eventually, when I call the function of Solidity contract (i.e. function close) to verify signature, the transaction is reverted as I mentioned the details of error HERE.

  • 1
    You can install it globally, via npm install ethereumjs-testrpc -g. However, this is generally not recommended. The correct way is to ensure that you execute your client code from the same path in which you have installed the npm package locally. – goodvibration Jul 19 '18 at 18:44
  • @goodvibration Thank you, I installed it globally, however i receive the same error. Btw, when i sreach ethereumjs-vm in my computer, no result. My main purpose is to run successfully JavaScript code presented here: programtheblockchain.com/posts/2018/02/23/… when i run it using node i receive some errors. Do you know what is the best way of running this JS code ? Do i need to create an html file and run it with browser? or it's better to create a JS file and run it using node filename.js ? Thanks – Questioner Jul 22 '18 at 12:31
  • 1
    There's tons of stuff in this link. If you want me (or anyone else for that matter) to refer to your question, then synthesize the relevant part and post it here. – goodvibration Jul 22 '18 at 12:37
  • @goodvibration Thank you, I modified my question. If there is something still unclear please let me know. Thanks – Questioner Jul 22 '18 at 12:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.