8

Hi I am new to blockchain topic and I am trying to make an Ethereum smart contract. First step I installed truffle and when I try to migrate it throws an error because I have no ethereum client. For solving this problem truffle develop, ganache, geth are recommended but I couldnt decide to which one is more suitable and I dont understand the difference of ganache and geth. Basically are they serving same thing or not? Here is error:

Could not connect to your Ethereum client with the following parameters:
- host       > 127.0.0.1
- port       > 7545
- network_id > *
Please check that your Ethereum client:
- is running
- is accepting RPC connections (i.e., "--rpc" option is used in geth)
- is accessible over the network
- is properly configured in your Truffle configuration file (truffle-config.js)

2 Answers 2

13

Truffle

As you already did, you migrated a contract. So Truffle can be used for contract compilation and migration. It aims for easy and fast migration.

Geth

Is an Ethereum-client, which means that you can run your own private blockchain with it. You can adjust your needs by defining for example the amount of threads you offer for mining. Geth itself is a command line tool, which can run a full Ethereum node implemented in Go. It provides the command lines, a Json-rpc server and an interactive console, where you can run your own scripts written in javascript.

Ganache

If you want a GUI, where you can track all deployments and transactions on your blockchain, you can choose Ganache. It allows you to create your own private blockchain mainly for testing purposes. It is used for deployment-testing for example, because there are no real miners on a "ganache-blockchain", so you can test if your contracts work.

I would suggest you to use Geth and Truffle if you want to set up your own blockchain on your local node and then deploy some contracts on it. There are plenty of manuals online on how to set up your own local node. For example:

After you created your node, you can deploy some contracts with truffle to it. I hope I could help you.

Sign up to request clarification or add additional context in comments.

Thanks for the simple definitions. Why did you propose geth over ganache?
It depends on your use-case. If you need a quick test for a smart contract you have built - Ganache is your choice. It is very self explaining. If Ganache is not sufficient for your testing, switch to Geth.
5

TLDR : start with Ganache and learn Geth along the way.

Truffle is a compiler and out of question.

But between Geth and Ganache :

Why Ganache ? Because it is easy !

Geth is a real deal , for a small local chain you have to run it's service first then create genesis block then you need to bring some miner to mine the transaction to the blockchain and generate some eath! then you can migrate smart contract to it but Ganache will do all of that for you!

Why use Geth? from here :

1- Geth is the official client software provided by the Ethereum foundation.

2- Comes with a JavaScript console (run it with geth console).

3- Has an interoperable JavaScript client (web3js).

4- Built-in access to the Rinkeby test net (or build your own private Ethereum network).

5- It is generally considered to be the reference implementation for other Ethereum nodes.

From my experience at this time/date, Ganache cloud be buggy and will give you some errors irrelevant to your code , but if you need to migrate your code to a test nest like Rinkeby Testnet, eventually you need to learn Geth.

Amazing answer, I loved reading it. To the point.

Your Answer

Draft saved
Draft discarded

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.