I have an experiment as follows:
1. i use a solidity code as:
pragma solidity ^0.4.6;
contract SimpleStorage{
uint storageData;
function set(uint x){
storageData =x;
}
function get() constant returns(uint retVal){
return storageData;
}
}
and paste it on solidity real-time compiler:
https://ethereum.github.io/browser-solidity/#version=soljson-v0.4.6+commit.2dabbdf0.jsthen i create a contract as the picture:
2. i open geth and use web3.js to access this contract as picture show
3. i set the value 20 and get the value 20 on solidity-browser as picture shown
4. i want to get the value from geth but i got 0 as picture shown
So the question is why i can't get the same value 20 as it shown on solidity-browser? is the contract create by the solidity browser really but on block chain? Or any step wrong or missing?
Please help to correct me, i really want to know why, thank you all.
Answers
if it means access the contract only in the memory block chain by web3 as the solidity-browser do, why i can't get the value in memory block chain? isn't they work in the same enviroment(memory block chain)?