5

Is there a way to run Geth connected to public Blockchain without syncing and still expect my smart contract function transaction to be mined ?? as following answer Can I run Geth without syncing? here uses "--maxpeers 0" so its not connected to any peers,so no way to mine the transaction.

Can i send smart contract function transaction( execute smart contract function) without syncing the node ?? and after sending can i expect it to be mined??

  • You mentioned in my now deleted answer that you want a public network, yet you do not what to sync to the public blockchain. What is your reason? – Bokky WeAreAllAssange PooBah Jun 6 '16 at 11:37
  • sorry ,i meant for public blockchain only. Can i stop syncing the node in any way, other than --maxpeers 0( removing all connected peers) – siddesh sangodkar Jun 6 '16 at 11:40
  • --maxpeers would work, as would shutting off your network connection to the Internet. If you want to mine, you will have to run a miner, either in geth or a GPU miner like ethminer. But note that the difficulty set in the public network blockchain is very high for your single miner to solve, so it will take quite a (very long) while for each block on your cut-off blockchain to be mined. – Bokky WeAreAllAssange PooBah Jun 6 '16 at 11:43
  • the reason is that i wanted to know,is there a way to do any type of transaction to blockchain without keeping the blockchain data in my node( consider the node is a small IOT device not capable of storing the full blockchain which is constantly growing). – siddesh sangodkar Jun 6 '16 at 11:45
5

Public Network

--maxpeers would work, as would shutting off your network connection to the Internet. If you want to mine, you will have to run a miner, either in geth or a GPU miner like ethminer. But note that the difficulty set in the public network blockchain is very high as this difficulty is adjusted to cater for the many thousands of computers mining the public blockchain.

Once you shut off your connection from the public network and switch on your mining, it will take a very very long time for your single miner to solve a block. But if you leave your private mining operation on for another very very long time, the difficulty will adjust downward back so your single miner mining blocks every 15 seconds.

Private Network

If you are want to try creating smart contracts, your easiest path is to spin up a Dev blockchain. This will just run on your local computer and you can set it to mine to receive some ethers in your account so you can use it to send the contract creation transactions.

See Deploying the Greeter contract via the geth CLI is not registering in my private blockchain for an example of deploying contracts to a Dev blockchain.

The --dev parameter will tell geth that you want to only run a Dev blockchain. The --mine and --minerthreads 1 parameters will tell your geth instance to mine the blockchain.

The difficulty is set low so you will mine blocks quite frequently.

  • i wanted for public network.not test network – siddesh sangodkar Jun 6 '16 at 11:33

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.