[Ethereum] How to retrieve the stored data from blockchain

go-ethereum

I have inserted details in blockchain. When I type web3.eth.getBlock("latest"),

difficulty: 2,
extraData:     "0xd783010802846765746887676f312e372e31856c696e757800000000000000008f438649b8b4382ffd5630c744ccd6db346c8aabce2676a1fdbf752a2ce966b420bc17d8d0f5e31a1212ffad0ac36653e2df29cc14d6bb358b11512762676b0601",
gasLimit: 6382057,
gasUsed: 2653689,
hash:   "0xa3dca95fb581a30c1102732b685905ef10a454ec93e8d26171874360821c9055",
logsBloom:     "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
 miner: "0x0000000000000000000000000000000000000000",
mixHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
nonce: "0x0000000000000000",
**number: 16,**
parentHash: "0xb9ea05ffc9908313d34a7db976e1b3017a7c9a200ace60445dc7f02d8a610795",
receiptsRoot: "0xfd5081c18fec1c7f65a80877425ac186d24713009a519e1659d2a4b2a8166c30",
sha3Uncles: "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
size: 10494,
stateRoot: "0xe62d1d87c706b650f7e984c9688dc20d1b0a5dd4a7bf05e38e56ca2e63fbfc38",
 timestamp: 1520398284,
 totalDifficulty: 33,
 transactions: ["0x93f9be64f6f5d633298957374748677498dcb57f24ecd9a1c7cf02391e786338"],
  transactionsRoot: "0xc6c6abb3365c3413fcec7ab62a73ea84d76e17b8d8d2d7c83057d477d08ffaff",
uncles: []
}

Its showing increase in number as and when i submit the data.

Is there any way to retrieve all the information stored in block chain. I do not want the hash and transaction details. I need the values i entered in the user interface page.

Best Answer

Maybe use something more high-level? Like remix, coupled with a local testrpc you can access data and call functions from your contract. (You can also access your contract if it's deployed in any blockchain, it doesn't need testrpc specifically)

If your contract is deployed, paste the source code in remix, compile it (compile tab, the start to compile) then access it by going in the run tab, paste the address of your contract in the At Address field, and the data and function should appear in the bottom.

Then you might need MetaMask paired with your account, once you have that choose Injected Web3 in the environment field.

Related Topic