Which function we need to use in truffle for the communication of second Dapp to the contract deployed on blockchain by first Dapp, because contract deployed by truffle is not accessible by geth node. I am trying using contractname.at(contractaddress), but it's not working?
When you deploy a contract, it gets assigned an Ethereum Contract Address. If you want to interact with a contract you must load the contract address to your wallet. (Take a look at how it is done with DAO: https://daohub.org/voting.html)
To interact with a Contract you need 2 things:
- The contract's Address
- The contract's JSON interface
By using these two you are able to load and invoke a contract onto web3.js and begin to interact with it.
navigate to 'Contracts'. Select then 'Watch Contract'. In the "Watch Contracts" interface, type 'The DAO' as the Contract name, paste the contract address, and the JSON interface. Click 'OK'.
With the contract interface registered, click "The DAO" in your custom contract section, and wait a few seconds. You are now able to use the interface and interact with the contract.