How to interact between geth and mist?

realDNArealDNA Member Posts: 5
edited December 2016 in Solidity
I know that mist is the gui of geth and geth represent the real node of client.
here i have a question is that:
when i use geth to construct a contract named greeter1,
then i type eth.getCode(greeter1.address) in web3 i can directly get the greeter1's address.
But when i use mist to construct a contract named greeter2,
then i use geth to type eth.getCode(greeter2.address), i can't directly get the greeter2's address in web3.
and i use var "greeter2 = eth.contract(greeter2's abi).at(greeter2's contractaddress)" in web3 then i can get the address.
isn't the mist just a gui of geth?
why i can't directly get the contract's address from geth after using mist contruct the contract?
Isn't the abi just used between node from node, why in the same node i should use abi?
please help to correct me, thank you all!

Answers

  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    @realDNA The abi object is a JS object. What web3.js does is compile the function signatures (function name, parameter types, returns types) into an 8 byte sha3 hash. It's that hash which is the function's actual calling address in the blockchain contract.
  • realDNArealDNA Member Posts: 5
    thanks, why i can't directly get the contract's address by geth without using abi right after the contract is created by mist (as far as i know, mist and geth are the same node, and mist is gui of geth), but i can directly get contract's address if the contract is directly created by geth? what is the difference?
  • o0ragman0oo0ragman0o Member, Moderator Posts: 1,291 mod
    @realDNA What do you get when you 'watch contract' at that address in Mist using the ABI?
Sign In or Register to comment.