I'm a newbie to the blockchain technology and working on the smart contracts using Ethereum. Help me understand the concept of miner in this technology.

I have followed the steps given on https://souptacular.gitbooks.io/ethereum-tutorials-and-tips-by-hudson/content/private-chain.html and done the setup of private network. I have created some basic smart contracts and deployed them in the network. Now I'm not able to relate the concept of miners used in bitcoin network and in my private network.

I have one more confusion regarding the creation of transaction in the network. It says that whatever we do on the contract it is treated as transaction but in case of the SimpleStorage given on this url http://solidity.readthedocs.io/en/develop/introduction-to-smart-contracts.html the get() call is not treated as transaction. Please help me to understand when the transaction is created and when not.

  • Welcome. We encourage separate questions over multiple questions to help keep our resource useful and organized. – Rob Hitchens Mar 5 '17 at 15:57

Q1: Miners are vital to transaction verification. In the context of a private chain, you need at least one miner or transactions will never be verified by the "network". This may be helpful, or possibly someone else will chime in with a good introduction to the protocol. Deploying the Greeter contract via the geth CLI is not registering in my private blockchain

Q2 Contract logic can be processed two ways.

1) by submitting a transaction to the network, in which case all nodes will verify the transaction after a miner includes it in a block. In this case, the initial return value will be a transaction hash and it's necessary to wait for the transaction to be mined before evaluating the result

2) running locally on the user's own resources, in which case it is faster and cheaper, but can't change the chain state. The returned result is the response from the contract function. Suitable for read-only operations and "dry run" tests. The second method can be hard-coded into the contract with the keyword "constant", or requested by web3 with the suffix .call()

Hope it helps.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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