I've used both truffle and geth, for testing my contracts.

To me, truffle seems to be more abstract (therefore less flexible) and easier to use, for testing.

However, when we move to geth, we are using web3, to communicate with a deployed contract.

Question 1: Which one is a better environment when we're developing Dapp in the real world?

In general, what are their pros and cons?

  • 2
    Hi there. I'm going to suggest this be closed as it's opinion-based. Questions that lead to different, subjective answers aren't a good fit for this site. A pro for one person might be a con for another, and so on. Reddit might be a better place to ask: reddit.com/r/ethdev – Richard Horrocks Dec 7 '17 at 22:23
  • 4
    You are mixing things: geth is an ethereum client (it talks to the ethereum network), web3.js is a library to interact with an ethereum client from javascript (it can interface with geth or parity), truffle is a framework for developing contracts (underneath it uses web3.js and ganache), ganache (previously testrpc) is a ethereum client used for debugging. – Ismael Dec 8 '17 at 3:49

TestRPC - Ethereum Simulator

Geth - Ethereum client

  • recieve block from other client/node and validate its.
  • send block to other nodes.
  • Take Dapp transaction via Ws-rpc, json-rpc, ipc-rpc.
  • Deploy and execute transaction.
  • mining enable

Truffle - Dapp frameworks

  • provide cli for developer task
  • test driven development with mocha and chai
  • local execution of contracts with truffle environment.
  • javascript object as contracts abstraction.

You write contract, compile it and for testing you need to deploy the contract in ethereum blockchain. So when you start writing contract, use truffle for creating contracts development environment.so that you can speed up ur development by deploying into the ethereum simulator. If you use geth at time of development you have to wait for 1 minute because every deployment of contract it will go for mining.

So, I suggest at development time you use testrpc. Once you finished it, use geth for deployment of contacts because it give u closer look how the blockchain work.

| improve this answer | |
  • 1
    thanks for the answer. I agree with almost all of the text you've provided. However, one piece is missing: Why wouldn't we use truffle for real-world use cases? Therefore, I think your answer does not completely answer the question above. – Ay. Dec 7 '17 at 18:36

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