0

I want to call Smart Contract function from server side. How can I call? I want to use nodejs.

4 Answers 4

2

Yes you can call. Use web3js or ethjs. I hope your smart contract is deployed in some eth network. If not then read below links for how to create smart contract and integrate with web3js.

2
0

For your code, you'll want to look at web3.js or ethjs. To actually access the network you'll need an Ethereum client node like geth or parity, or if you want to keep things simpler/web-servicey you can use a provider like Infura.

0

Any interaction with ethereum smart contracts happens through an ethereum transaction. contract creation is a transaction, contract invocation is a transaction. Transaction are signed with a private key, the signing process happens with the help of a software called "wallet". After the transaction is signed it must be broadcasted to the network. You broadcast a transaction by connecting to any ethereum node json-rpc interface and using the appropriate RPC call.

read more about this here; https://github.com/web3j/web3j & https://github.com/ethereum/wiki/wiki/JSON-RPC

0

There is a comprehensive answer about interaction between smart contract and Node-js at here . I suggest read the question in first, after that, see the marked answer there.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.