# Run from source code

## Download the Client

Execute the following command to clone the repository :

```
git clone https://github.com/exsat-network/exsat-client
```

## Build the client

<pre><code>cd exsat-client
<strong>yarn install &#x26;&#x26; yarn build
</strong></code></pre>

## Edit the .env configuration file

Please generate ".env" file by coping from ".env.example":

```
cp .env.example .env
```

Please edit the ".env" file to configure the settings.

```
vim .env
```

Please ensure all configurations are correctly set. Some settings can also be adjusted by executing the Client. Detailed configurations can be found [here](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/environment-variables).

## Execute the client

### 1. Initiate the validator account

#### Create or import the account

If you don't have a validator account, please [create a new BTC Validator account](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/validator-operations/create-new-btc-validator-account).

If you already have a validator account, and wish to import it to your client, please [import seed phase](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/import-from-seed-phrase) or [import private key](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/import-from-private-key).

#### Stake for your validator account

To qualify as a BTC Validator, you must stake a minimum of 100 BTC. This can be done through either [Credit Staking](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/validator-operations/stake-for-validator-via-credit-staking) or [XBTC Staking](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/validator-operations/stake-for-validator-via-xbtc-staking-or-xsat-staking). Learn more about the two staking methods [here](https://docs.exsat.network/guides-of-data-consensus/run-a-btc-validator/credit-staking-and-xbtc-staking).

### 2. Configurations

You can complete some client configurations or perform operations on your account:

* [Set BTC RPC Node](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/set-btc-rpc-node) (**required**, can also be done by editing the .env file)
* [Bridge BTC for gas fee](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/refill-btc-for-gas-fees) (**required**)
* [Change Stake Address](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/validator-operations/change-stake-address) (optional)
* [Change Reward Address](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/synchronizer-operations/change-reward-address) (optional)
* [Change Commission Ratio](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/validator-operations/change-commission-ratio) (optional)
* [Configure Display Information](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/validator-operations/configure-display-information-for-your-validator-account) (optional)
* [Export private key](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/export-private-key) (optional)
* [Remove your account](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/remove-your-account) (optional)
* [New version check](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/upgrade-to-new-version) (optional)

### 3. Execute the client

Please be aware that completing [Set BTC RPC Node](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/set-btc-rpc-node) and [Bridge BTC for gas fee ](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/common-operations/refill-btc-for-gas-fees)is mandatory.

Once the above operations are completed, your account and client are ready, and you can [start it for long-term running](https://docs.exsat.network/guides-of-data-consensus/others/operation-references/validator-operations/execute-the-validator-client).

### 4. Check and claim rewards

You could [check and claim rewards](https://docs.exsat.network/others/operation-references/validator-operations/stake-for-validator-via-xbtc-staking-or-xsat-staking#claim-rewards) on the front-page with the reward address.
