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,370 points
1,366 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,740 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
1,074 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 10, 2019 in Blockchain by Omkar
• 69,220 points
2,903 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
1,942 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,468 views
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,740 points
719 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,740 points
720 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP