> For the complete documentation index, see [llms.txt](https://docs.bosagora.org/en/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.bosagora.org/en/validator-start/running-an-agora-node-and-validator/agora-mainnet.md).

# Agora Mainnet

### Install Docker Engine

To run an Agora node, you must first have Docker installed and running.\
See [here](https://docs.docker.com/engine/install/) for instructions on how to install the Docker Engine\
<https://docs.docker.com/engine/install/>

## For Linux or macOS users

### Install mainnet

See [here](https://github.com/bosagora/agora-chain#for-linux-or-macos-users) for instructions on how to install

```
mkdir agora-chain
cd agora-chain
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/agora.sh)"
./agora.sh network mainnet
```

* Available commands and descriptions of agora.sh

  ```
  ./agora.sh 
  agora.sh version 2.0.0
  Usage: ./agora.sh PROCESS FLAGS.
  PROCESS can be el-node, cl-node, validator, docker-compose, docker-compose-monitoring, start, stop, upgrade

  ./agora.sh network <network to change>
         - <network to change> is one of mainnet, testnet, and devnet, and the default is mainnet.
         - If <network to change> is not specified, it shows the currently set up network.

  ./agora.sh el-node ( init, run )
      el-node init
         - Initialize agora-el. At this point, all existing block data is deleted.
      el-node run
         - Run agora-el.

  ./agora.sh cl-node ( run )
      cl-node run
         - Run agora-cl.

  ./agora.sh validator ( accounts, exit, withdraw, slashing-protection-history )

  ./agora.sh validator accounts ( import, list, backup )
      validator accounts import <validator keys folder>
         - Add the validator's keys to the local wallet.
      validator accounts list
         - Show the validator's keys stored in the local wallet.
      validator accounts delete
         - Delete the validator's keys from the local wallet.
      validator accounts backup <validator keys folder>
         - Back up the validator's keys stored in the local wallet.

      validator exit
         - Used to voluntarily exit the validator's function. After this is done, you will see a screen where you select the validator's keys.
      validator withdraw <data folder>
         - Send pre-created withdrawal address registration data to the network.
         - Currently, only devnet is supported. Other networks will be supported later.

  ./agora.sh validator slashing-protection-history ( export, import ) 
      validator slashing-protection-history export <data folder>
         - Save the information that the verifiers worked on as a file. At this point, the validator on the current server must be stopped.
         - One validator must validate only once per block. Otherwise, the validator may be slashed.
             - If a validator runs on multiple servers, that validator may violate the above condition.
             - If a validator's server is changed to another server, the validator may violate the above condition.
             - To avoid this, you need to transfer the block verification information that the validators has performed so far.
      validator slashing-protection-history import <data folder>
         - Register block verification information performed by validators.

  ./agora.sh deposit-cli ( new-mnemonic, existing-mnemonic, generate-bls-to-execution-change )
      deposit-cli new-mnemonic
         - This command is used to generate keystores with a new mnemonic.
      deposit-cli existing-mnemonic
         - This command is used to re-generate or derive new keys from your existing mnemonic.
      deposit-cli generate-bls-to-execution-change <data folder>
         - Generates the data required to register the address to which the validator's amount will be withdrawn.
         - Currently, only devnet is supported. Other networks will be supported later.        

  ./agora.sh docker-compose ( up, down )
      docker-compose up
         - Run agora-el, agora-cl, validator.
      docker-compose down
         - Stop agora-el, agora-cl, validator.

  ./agora.sh docker-compose-monitoring ( up, down )
      docker-compose-monitoring up
          - Run agora-el, agora-cl, validator, and containers required for monitoring.
      docker-compose-monitoring down
         - Stop agora-el, agora-cl, validator, and containers required for monitoring.

  ./agora.sh start
         - Run agora-el, agora-cl, validator, and containers required for monitoring.
         - It's the same as './agora.sh docker-compose-monitoring up'

  ./agora.sh stop
         - Stop agora-el, agora-cl, validator, and containers required for monitoring.
         - It's the same as './agora.sh docker-compose-monitoring down'

  ./agora.sh upgrade
         - The latest version is installed, at which point the user data is preserved.
  ```

#### Upgrade for Linux or macOS

```
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.sh)"
```

#### Execution Layer for Linux or MacOS

* Init execution node

  ```
  ./agora.sh el-node init
  ```
* Run execution node

  ```
  ./agora.sh el-node run
  ```

#### Consensus Layer for Linux or MacOS

* Run consensus node

  ```
  ./agora.sh cl-node run
  ```

#### Validator accounts for Linux or MacOS

* Generate your validator keys when you don't have mnemonic

  ```
  ./agora.sh deposit-cli new-mnemonic
  ```
* Generate your validator keys when you have mnemonic

  ```
  ./agora.sh deposit-cli existing-mnemonic
  ```
* Import your key stores

  ```
  ./agora.sh validator import <your key stores folder>
  ```

  or

  ```
  ./agora.sh validator accounts import <your key stores folder>
  ```

  `<your key stores folder>` is where the validator keys are stored. The default folder is `./validator_keys`
* List your key stores in your wallet

  ```
  ./agora.sh validator accounts list
  ```
* Backup your key stores in your wallet

  ```
  ./agora.sh validator accounts backup <folder>
  ```

  `<folder>` is where the backup key is stored. The default folder is `./backup-wallet`

#### Validator execution for Linux or MacOS

* Run validator

  ```
  ./agora.sh validator run
  ```

#### Validator exit for Linux or MacOS

* Voluntary exit of the validator

  ```
  ./agora.sh validator exit
  ```

#### Validator withdrawals for Linux or MacOS

* Generate the SignedBLSToExecutionChange data to enable withdrawals

  ```
  ./agora.sh deposit-cli generate-bls-to-execution-change <folder>
  ```

  `<folder>` is where the SignedBLSToExecutionChange data is stored. The default folder is `./bls_to_execution_changes`
* Send the SignedBLSToExecutionChange data to enable withdrawals

  ```
  ./agora.sh validator withdraw <folder>
  ```

  `<folder>` is where the SignedBLSToExecutionChange data is stored. The default folder is `./bls_to_execution_changes`

#### Validator slashing protection for Linux or MacOS

* export

  ```
  ./agora.sh validator slashing-protection-history export <folder>
  ```

  `<folder>` is where the slashing protection history data is stored. The default folder is `./slashing-protection-export`
* import

  ```
  ./agora.sh validator slashing-protection-history import <folder>
  ```

  `<folder>` is where the slashing protection history data is stored. The default folder is `./slashing-protection-export`

#### Using docker-compose for Linux or MacOS

1. Init the execution node

```
./agora.sh el-node init
```

2. Import your key stores

```
./agora.sh validator import <your key stores folder>
```

or

```
./agora.sh validator accounts import <your key stores folder>
```

3. Edit wallet password

```
nano ./root/config/cl/password.txt
```

4. Edit transaction fee receiving address

```
nano ./root/config/cl/proposer_config.json
```

5. Run docker-compose

```
./agora.sh docker-compose up
```

6. Stop docker-compose

```
./agora.sh docker-compose down
```

#### Using docker-compose with monitoring for Linux or MacOS

1. Init the execution node

```
./agora.sh el-node init
```

2. Import your key stores

```
./agora.sh validator import <your key stores folder>
```

or

```
./agora.sh validator accounts import <your key stores folder>
```

3. Edit wallet password

```
nano ./root/config/cl/password.txt
```

4. Edit transaction fee receiving address

```
nano ./root/config/cl/proposer_config.json
```

5. Run docker-compose

```
./agora.sh docker-compose-monitoring up
```

or

```
./agora.sh start
```

6. Stop docker-compose

```
./agora.sh docker-compose-monitoring down
```

or

```
./agora.sh stop
```

## For Windows users

### Install Mainnet for Windows

```
mkdir agora-chain
cd agora-chain
curl -S -L -o agora.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/agora.bat
call agora.bat
agora.bat network mainnet
```

* Available commands and descriptions of agora.bat

  ```
  agora.bat
  agora.bat version 2.0.0
  Usage: agora.bat PROCESS FLAGS.
  PROCESS can be el-node, cl-node, validator, docker-compose, docker-compose-monitoring, start, stop, upgrade

  agora.bat network <network to change>
         - <network to change> is one of mainnet, testnet, and devnet, and the default is mainnet.
         - If <network to change> is not specified, it shows the currently set up network.

  agora.bat el-node ( init, run )
      el-node init
         - Initialize agora-el. At this point, all existing block data is deleted.
      el-node run
         - Run agora-el.

  agora.bat cl-node ( run )
      cl-node run
         - Run agora-cl.

  agora.bat validator ( accounts, exit, withdraw, slashing-protection-history )

  agora.bat validator accounts ( import, list, backup )
      validator accounts import <validator keys folder>
         - Add the validator's keys to the local wallet.
      validator accounts list
         - Show the validator's keys stored in the local wallet.
      validator accounts delete
         - Delete the validator's keys from the local wallet.
      validator accounts backup <validator keys folder>
         - Back up the validator's keys stored in the local wallet.

      validator exit
         - Used to voluntarily exit the validator's function. After this is done, you will see a screen where you select the validator's keys.
      validator withdraw <data folder>
         - Send pre-created withdrawal address registration data to the network.
         - Currently, only devnet is supported. Other networks will be supported later.

  agora.bat validator slashing-protection-history ( export, import ) 
      validator slashing-protection-history export <data folder>
         - Save the information that the verifiers worked on as a file. At this point, the validator on the current server must be stopped.
         - One validator must validate only once per block. Otherwise, the validator may be slashed.
             - If a validator runs on multiple servers, that validator may violate the above condition.
             - If a validator's server is changed to another server, the validator may violate the above condition.
             - To avoid this, you need to transfer the block verification information that the validators has performed so far.
      validator slashing-protection-history import <data folder>
         - Register block verification information performed by validators.

  agora.bat deposit-cli ( new-mnemonic, existing-mnemonic, generate-bls-to-execution-change )
      deposit-cli new-mnemonic
         - This command is used to generate keystores with a new mnemonic.
      deposit-cli existing-mnemonic
         - This command is used to re-generate or derive new keys from your existing mnemonic.
      deposit-cli generate-bls-to-execution-change <data folder>
         - Generates the data required to register the address to which the validator's amount will be withdrawn.
         - Currently, only devnet is supported. Other networks will be supported later.        

  agora.bat docker-compose ( up, down )
      docker-compose up
         - Run agora-el, agora-cl, validator.
      docker-compose down
         - Stop agora-el, agora-cl, validator.

  agora.bat docker-compose-monitoring ( up, down )
      docker-compose-monitoring up
          - Run agora-el, agora-cl, validator, and containers required for monitoring.
      docker-compose-monitoring down
         - Stop agora-el, agora-cl, validator, and containers required for monitoring.

  agora.bat start
         - Run agora-el, agora-cl, validator, and containers required for monitoring.
         - It's the same as 'agora.bat docker-compose-monitoring up'

  agora.bat stop
         - Stop agora-el, agora-cl, validator, and containers required for monitoring.
         - It's the same as 'agora.bat docker-compose-monitoring down'

  agora.bat upgrade
         - The latest version is installed, at which point the user data is preserved.
  ```

#### Upgrade for Windows

```
curl -S -L -o upgrade.bat https://raw.githubusercontent.com/bosagora/agora-chain/v0.x.x/upgrade.bat
upgrade.bat
```

#### Execution Layer for Windows

* Init execution node

  ```
  agora.bat el-node init
  ```
* Run execution node

  ```
  agora.bat el-node run
  ```

#### Consensus Layer for Windows

* Run consensus node

  ```
  agora.bat cl-node run
  ```

#### Validator accounts for Windows

* Generate your validator keys when you don't have mnemonic

  ```
  agora.bat deposit-cli new-mnemonic
  ```
* Generate your validator keys when you have mnemonic

  ```
  agora.bat deposit-cli existing-mnemonic
  ```
* Import your key stores

  ```
  agora.bat validator import <your key stores folder>
  ```

  or

  ```
  agora.bat validator accounts import <your key stores folder>
  ```

  `<your key stores folder>` is where the validator keys are stored. The default folder is `./validator_keys`
* List your key stores in your wallet

  ```
  agora.bat validator accounts list
  ```
* Backup your key stores in your wallet

  ```
  agora.bat validator accounts backup <folder>
  ```

  `<folder>` is where the backup key is stored. The default folder is `./backup-wallet`

#### Validator execution for Windows

* Run validator

  ```
  agora.bat validator run
  ```

#### Validator exit for Windows

* Voluntary exit of the validator

  ```
  agora.bat validator exit
  ```

#### Validator withdrawals for Windows

* Generate the SignedBLSToExecutionChange data to enable withdrawals

  ```
  agora.bat deposit-cli generate-bls-to-execution-change <folder>
  ```

  `<folder>` is where the SignedBLSToExecutionChange data is stored. The default folder is `./bls_to_execution_changes`
* Send the SignedBLSToExecutionChange data to enable withdrawals

  ```
  agora.bat validator withdraw <folder>
  ```

  `<folder>` is where the SignedBLSToExecutionChange data is stored. The default folder is `./bls_to_execution_changes`

#### Validator slashing protection for Windows

* export

  ```
  ./agora.bat validator slashing-protection-history export <folder>
  ```

  `<folder>` is where the slashing protection history data is stored. The default folder is `./slashing-protection-export`
* import

  ```
  ./agora.bat validator slashing-protection-history import <folder>
  ```

  `<folder>` is where the slashing protection history data is stored. The default folder is `./slashing-protection-export`

#### Using docker-compose for Windows

1. Init the execution node

```
agora.bat el-node init
```

2. Import your key stores

```
agora.bat validator import <your key stores folder>
```

or

```
agora.bat validator accounts import <your key stores folder>
```

3. Edit wallet password

```
notepad ./root/config/cl/password.txt
```

4. Edit transaction fee receiving address

```
notepad ./root/config/cl/proposer_config.json
```

5. Run docker-compose

```
agora.bat docker-compose up
```

6. Stop docker-compose

```
agora.bat docker-compose down
```

#### Using docker-compose with monitoring for Windows

1. Init the execution node

```
agora.bat el-node init
```

2. Import your key stores

```
agora.bat validator import <your key stores folder>
```

or

```
agora.bat validator accounts import <your key stores folder>
```

3. Edit wallet password

```
notepad ./root/config/cl/password.txt
```

4. Edit transaction fee receiving address

```
notepad ./root/config/cl/proposer_config.json
```

5. Run docker-compose

```
agora.bat docker-compose-monitoring up
```

or

```
agora.bat start
```

6. Stop docker-compose

```
agora.bat docker-compose-monitoring down
```

or

```
agora.bat stop
```

## Other features

### Documentation of Agora-cl

Go to website <https://agora-cl-docs.bosagora.org/>

### To check the status and rewards of the validator

Go to website <https://www.agorascan.io/>
