baldash
baldash

Reputation: 317

How to test smart contracts and transactions geth

New to solidity and blockchain in general, I tried to make transactions and deploy smart contracts but it seems that we need ethereum to "pay" these actions. Is there any way to get free or "fake" ethereum to easily test transactions and smart contracts ?

Upvotes: 1

Views: 2200

Answers (2)

q9f
q9f

Reputation: 11824

In addition to the free testnet Ether method in my other answer, you could also look into development tools and integrated environments for developing smart contracts. Most of them either do not require a real blockchain backend with Ether fees or simulate an Ethereum virtual machine (EVM) and simulate the deployment of smart contracts and decentralized applications.

Among others there are:

  • Mix (Desktop) and Remix (Web) IDEs for smart contract debugging and development
  • Solidity Browser (Web) IDE for smart contract debugging
  • Truffle a development framework for Ethereum
  • Embark a framework for decentralized apps
  • Dapple and Dappsys toolchains for fast smart contract development

See also questions tagges with IDE on Ethereum Stack Exchange.

Upvotes: 0

q9f
q9f

Reputation: 11824

Sure, you have basicly two options if you go for the testnet. Don't test stuff on the public main network.

Mine in developer mode

Run geth with the developer flag.

geth --dev --mine --minerthreads 1

From help:

--dev                   Developer mode: pre-configured private network with several debugging flags
--mine                  Enable mining
--minerthreads value    Number of CPU threads to use for mining (default: 12)

This runs a private testnetwork with your own chain. The miner runs low on one thread to generate new blocks and this way you get testnet Ether in your private network which can be used to pay the fees.

Drain the morden faucet

Join the morden public testnet.

geth --testnet

From help:

--testnet               Morden network: pre-configured test network with modified starting nonces (replay protection)

This is the public testnet called morden. It might be too hard to mine but you can just request free testnet ether from the public wei faucet.

Upvotes: 3

Related Questions