كيفية تشغيل بكتوس في وضع سطر الأوامر؟

Preface

Pactus can be run in different modes, including the command-line interface (CLI) and the graphical user interface (GUI). This tutorial will guide you through the steps to run Pactus in CLI mode, suitable for advanced users.

Prerequisites

Before proceeding with the steps below, ensure that you have the following:

  • A computer running Windows, macOS, or Linux
  • Suitable internet connection

Download

To get started, download and extract the Pactus CLI file from here.

Initializing the node

Now you need to create a wallet and setup a working directory for your node. A working directory is a place where you save blockchain data and wallets. Open the Terminal and run the following command:

./pactus-daemon init -w ~/pactus --testnet

This command creates your wallet and setup the working working directory at ~/pactus.

./pactus-daemon init -w ~/pactus --testnet

This command creates your wallet and setup the working working directory at ~/pactus.

pactus-daemon.exe init -w c:\pactus --testnet

This command creates your wallet and setup the working working directory at c:\pactus.

Make sure you write down your 12-word mnemonic on a piece of paper to recover your wallet in the future in case your computer is lost, damaged, or stolen.

The working directory contains:

  • Default wallet
  • Genesis file
  • Config file

Feel free to take a look at these files.

Running the node

Now you can start the node and sync with the network. Run the following command in the Terminal:

./pactus-daemon start -w ~/pactus
./pactus-daemon start -w ~/pactus
pactus-daemon.exe start -w c:\pactus

When the Pactus node starts running, it begins syncing with the network. This process may take some time, as your node needs to download and verify the entire blockchain history. Please be patient while your node syncs.

To become a validator and participate in the consensus algorithm to earn rewards, you first need to stake some coins. In the next tutorial, we will explain how to send a Bond transaction to become a validator.


By running a Pactus node, you contribute to the decentralization and security of the Pactus blockchain network. Thank you for your participation!