How to refer contract files to javascript

steveeq1steveeq1 Member Posts: 5
Guys,

How does the web page "know" which contract file to refer to? The example on the mix ide tutorial page ( https://github.com/ethereum/wiki/wiki/Mix:-The-DApp-IDE ) shows html that in no way refers to the contract file (the ".col" file or whatever). Shouldn't there be some sort "import" file or something? Mix keeps giving me the "Uncaught TypeError: Cannot read property 'contract' of undefined." error because it can't seem to read the contract file.

Also, how does it access the web3 library thing? The html shows no reference to that either! I'm new to ethereum and a bit confused.

Comments

  • steveeq1steveeq1 Member Posts: 5
    I found out the solution. I'm posting it on here just case someone has the same problem as me. Basically, the javascript code does not refer to the .col files directly. the contract files have to compiled and put into the blockchain in order for the contract to be accessed. web3 is a javascript library that access contracts off the blockchain.
  • bmkrishbmkrish Member Posts: 14
    Hi ,
    I am connecting local ethereum node from HTML file which is running in the nodejs server .So,I need to compile thee contract and push into bloack chain ..Could you please let me know how to compile and move into block chain without MIX IDE.I am able to execute the contract using MIX IDE.
    Thanks,
    bala
Sign In or Register to comment.