How to connect javascript to solidity/ethereum?

0 votes
i want to link connect javascript to solidity/ethereum to send some data or signals.. How can i do that?
Jul 11, 2018 in Blockchain by slayer
• 29,050 points
147 views

1 answer to this question.

0 votes

You can connect javascript to solidity by using web3.. To know more visit: https://github.com/ethereum/wiki/wiki/JavaScript-API

you should use different syntax depending on whether the contract has already been deployed or not.. you can call the contract methods when you have contract instances:

const example = web3.eth.contract(abiArray);
const contractInstance = example.at(address);
contractInstance.declareWinner(winner, function (err, res) {
  // do something
});

answered Jul 11, 2018 by digger
• 26,550 points

Related Questions In Blockchain

+1 vote
1 answer
0 votes
1 answer

How to use ethereum contract's state changing method in javascript?

You'll find that the message is indeed ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
28 views
–1 vote
1 answer

How to connect two different nodes in private ethereum network?

To connect two nodes, you can use ...READ MORE

answered Jan 9 in Blockchain by Omkar
• 67,520 points
166 views
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
141 views
0 votes
1 answer
0 votes
1 answer
0 votes
1 answer

How to connect to already running go ethereum client using mist Ubuntu

Hey, you can solve the issue by using sudo ...READ MORE

answered Sep 18, 2018 in Blockchain by digger
• 26,550 points
48 views
0 votes
1 answer

How to avoid Ethereum Token Name redundancy?

I dont think you can do anything ...READ MORE

answered Jul 12, 2018 in Blockchain by digger
• 26,550 points
25 views