0

This question already has an answer here:

Is it possible to interact with a deployed contract in a private blockchain with Web3 API ?

i have alreaded deployed a contract and i saved the contract adreess, but i don't find how i cant interect with this contract ?

marked as duplicate by Richard Horrocks, atomh33ls, Achala Dissanayake, Ismael, ivicaa Mar 12 '18 at 21:39

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1

Under geth you could create a contract instance by using

   contractinstance = eth.contract(abi).at(addr)

The abi is found using -

solc --abi smartcontractname.sol

Copy the abi (no quotes into a variable in geth), the address is your 20 byte address given during the deployment.

Then the functions are executable using -

contractinstance.functionname(..)
0

You can interact with remix. Just change your environment to 'web3 provider' and load contract from address. Now, you'll see the methods which you can access.

Also, you can build your own html application with which you can access. While doing so, I got an error. Note that my contract is deployed in ropsten network. If you want to access your contract, use the html code and instead of

web3 = new Web3(new Web3.providers.HttpProvider("https://ropsten.infura.io/"));

give (as long as you're connecting via 8545 port)

web3 = new Web3(new Web3.providers.HttpProvider("http://localhost:8545 "));

Ropsten network - 405 Method Not Allowed on eth_sendTransaction

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