Is it possible to link/connect/ send a signal from JavaScript code into Solidity/Ethereum?
Link Javascript to Solidity?
655 views Asked by AudioBubble At
3
There are 3 answers
0
On
You could install the official Go implementation of the Ethereum protocol, geth.
Geth is a tool for running a local node/miner and also allows you to connect to a running blockchain via the console (which then becomes a Javascript console) and input RPC calls natively via the provided web3 package.
Geth also supports connecting to test nets (such as Ropsten or Rinkeby) or even a private blockchain on localhost.
Additionally to a user interacting directly with the console via the command line, geth can be configured from a shell script/batch file to both run or preload javascript files containing scripted commands for testing!
You can use web3.
There is a different syntax for interfacing with contracts. Depending on if the contract is already deployed or you need to do that yourself.
When you have the contract instance you can then call contract methods.
I personally think web3 is a little cumbersome. I recommend checking out Truffle and following some of their tutorials to get up to speed.