First try with Ganache

Ganache first try

Install

https://www.trufflesuite.com/ganache

Click to enter the official website to download.image-20231106171624167

Downloading is relatively simple, just click DOWNLOAD (normally the operating system of the current computer will be recognized).
The following installation takes WINDOWS as an example:
Open it directly after downloading: image-20231106171807498

Then the installation interface will be displayed, just click to install. Then wait for the installation process. If "Start when ready" is checked, Ganache will start automatically after the installation is complete.

image-20231106164931518

Start and create a local blockchain

After startup, there will be a statement about data collection and analysis, saying that it will collect some usage data to help Ganache improve. Due to my screen ratio problem, I found that there are no buttons here and I can't move the screen inside. The button will appear normally only after the window is enlarged.

image-20231106165051617

After the window is enlarged, you can see the options in the lower left corner and CONTINUE in the lower right corner. In the lower left corner, you can choose whether to agree to the collection of analysis information to help developers improve.

image-20231106165123637

Click CONTINUE to continue. The following interface will appear. There are two main buttons, one is QUICK START and the other is NEW WORKSPACE. They are all used to create Ethereum private chains. If you select QUICK START, they will be generated directly without entering any configuration. Selecting WORKSPACE will first pop up an interface for you to make some configurations (of course, you can also directly confirm and continue without entering any configuration).

image-20231106165455249

There is also a downward arrow on the right side of the button. Click to select the type of blockchain to create. There are two options: ETHEREUM and FILECOIN.image-20231106172655978

Here we click QUICKSTART and wait for the ETHEREUM blockchain to be created.

image-20231106165532883

official use

After the blockchain is created, the following interface will appear.

image-20231106165543910

You can see that there are six functional areas above: ACCOUNT, BLOCKS, TRANSACTIONS, CONTRACTS, EVENTS, LOGS

ACCOUNTS ACCOUNTS

The accounts functional area displays the account information of the current blockchain, and 10 accounts will be created by default. In this interface, you can directly see the address (ADDRESS), balance (BALANCE), transaction number (TX COUNT), and serial number (INDEX) of each account.

There is also a small key button on the right. When clicked, the address and private key of the corresponding account will be displayed, which is very convenient.

image-20231106165921582

image-20231106165938852

BLOCKS blocks

image-20231106170009952

BLOCKS partition, now only the genesis block BLOCK 0. Click to view further detailed information about the block.

image-20231106170124545

TRANSACTIONS

Since the newly created blockchain does not have any transactions yet, no transactions are displayed here (NO TRANSACTION)

image-20231106170224436

CONTRACTS smart contracts

image-20231106170238262

EVENTS

image-20231106170257513

Some operations on the upper sidebar

You will find that there is a column above that does not change when switching functional partitions.

image-20231106174335481

This column provides some key information about blockchain networks.

Click on the rightSAVE to save the current blockchain network. At the same time, the SAVE button will disappear, and Ganache will automatically assign you a WORKSPACE name.

image-20231106170323305

ClickSWITCH will exit the current WORKSPACE. If there is no SAVE current WORKSPACE, it will be equivalent to a one-click destruction effect.

Click thesmall gear on the right to enter more advanced settings.

For example, you can set the name of WORKSPACE, etc.

image-20231106170401193

Or set the hard fork type in the CHAIN ​​settings section (actually select the type of Ethereum blockchain).

image-20231106170741603

For more functions and interpretations, you can directly view the official documents and explore by yourself:
Ganache | Overview - Truffle Suite

For interpretation, you can directly view the official documents and explore by yourself:
Ganache | Overview - Truffle Suite

Ganache is indeed a powerful tool for Dapp development.

Guess you like

Origin blog.csdn.net/weixin_43469174/article/details/134251772