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,040 points
98 views

1 answer to this question.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
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
• 27,620 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
16 views
0 votes
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
• 65,850 points
59 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
65 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
• 27,620 points
37 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
• 27,620 points
17 views

© 2018 Brain4ce Education Solutions Pvt. Ltd. All rights Reserved.
"PMP®","PMI®", "PMI-ACP®" and "PMBOK®" are registered marks of the Project Management Institute, Inc. MongoDB®, Mongo and the leaf logo are the registered trademarks of MongoDB, Inc.