When you deploy smart contract and then alter it's state in Ethereum networks (at least master and Rinkeby) you need to spend some gas = ether.
Can there be networks that don't need gas to run?
Ethereum Stack Exchange is a question and answer site for users of Ethereum, the decentralized application platform and smart contract enabled blockchain. It only takes a minute to sign up.Sign up to join this community
Sort of. In Ethereum networks there is always gas involved. And as this is Ethereum StackExchange, I assume you are referring only to Ethereum networks.
The trick is how the gas price is specified. You have at least two ways how to get free transactions:
1) Send a transaction with zero gas price to whichever network (even the mainnet). No matter how much gas the transaction uses, the price is zero so you don't have to pay anything. The problem is that the transaction will probably never be mined because miners are not incentivized to include the transaction in blocks - the transaction will probably never go through. Even if someone wants to mine a zero price transaction, it may never get propageted to his node (https://ethereum.stackexchange.com/a/2221/31933).
2) Create (or use some existing one) a private network where the miners are sure to include whatever transaction they see inside the blocks. Either the miners are controlled by you or they have some other incentive to mine zero-price transactions.
The EVM has the notion of gas because computations need to be ending. Each block has a gas limit and different operations cost a certain amount of gas, thus we can only have a limited amount of computations in a block. Otherwise the blockchain wouldn't progress, all validators would be stuck trying to validate the computation. This would be the case if infinite loops were allowed to happen.
That being said, you can set the gasprice on your validators on a PoA network to 0 , that way no ether has to be spent. Also don't forget to set that price as default on your RPC transaction calls.
The only downside is that spamming transactions becomes possible, but a PoA network with limited nodes can handle plenty of throughput.
Start your geth nodes with