0

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?

closed as primarily opinion-based by Richard Horrocks, Ismael, pabloruiz55, Malone, Distic Dec 12 '17 at 15:16

Many good questions generate some degree of opinion based on expert experience, but answers to this question will tend to be almost entirely based on opinions, rather than facts, references, or specific expertise. If this question can be reworded to fit the rules in the help center, please edit the question.

  • 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
  • 2
    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
2

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.

  • 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.