I have deployed a contract in rinkeby network. Now I have the address of the contract and ABI of the contract.
var contract = new web3.eth.Contract(ContractABI, 'ContractAddress')
But now how to call the functions and how to pass the arguments and console.log the return values.
Best Answer
First, you need a provider which connects you to the Rinkeby network. It can be MetaMask or infura I have a separate file called 'web3.js' which has this code:
Now comes the trick: Create another file such as contractName.js
Now in normal files just call web3 from the file web3.js and you'll be able to call functions from your contract. For example, if your contract has a 'helloWorld()' you will have to use something like
Check web3 documentation for more information