# Quickstart

{% hint style="danger" %}
**Disclaimer**: Canopy is alpha-stage software. While documentation and guides are provided to assist users, they are offered without warranties, guarantees, or assurances of reliability. Users are solely responsible for any issues that may arise, including but not limited to the loss of funds. Please proceed with caution.
{% endhint %}

### 0. Dependencies

<details>

<summary>Install Docker + Docker Compose V2</summary>

```bash
sudo apt update
sudo apt install -y ca-certificates curl gnupg lsb-release

# Add Docker’s official GPG key
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | \
  sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg

# Add Docker repo
echo \
  "deb [arch=$(dpkg --print-architecture) \
  signed-by=/etc/apt/keyrings/docker.gpg] \
  https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null

# Install Docker Engine + CLI + Compose plugin
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
```

</details>

<details>

<summary>Apache Utils</summary>

`sudo apt install apache2-utils`

</details>

<details>

<summary>Make</summary>

`sudo apt install make`

</details>

<details>

<summary>Git</summary>

`sudo apt install -y git`

</details>

{% hint style="info" %}
Ensure you've read and satisfied [Setup & Recommendations](/docs/secure-canopy/node-runner/setup-and-recommendations.md)  before doing quickstart!
{% endhint %}

### 1. Clone the deployments repo

```bash
git clone https://github.com/canopy-network/deployments.git
cd deployments
```

The [Canopy deployments repository](https://github.com/canopy-network/deployments) is the official source for setting up and operating validator infrastructure.&#x20;

It contains the configuration, scripts, and monitoring tools required to participate in the Canopy network.

{% hint style="success" %}
Checkout this and extend this repository for more configuration options
{% endhint %}

### 2. Run the setup script to create the keys for your canopy validator

```bash
chmod +x setup.sh
./setup.sh
```

This will prompt you to input:

1. **Stack type:** select option (2)
2. **A password:** to encrypt the validator key in the keystore
3. **A nickname:** for your validator key in the keystore, which will be the identity for your validator operator processes.
4. **A domain:** With a `DOMAIN` variable defined, traefik will expose and validate SSL on this endpoints externally using the prefix shown in the first running section
5. **An email:** This is simply the email address used when registering an account with an ACME certificate authority like **Let’s Encrypt.** We use this env variable to request SSL ACME certificate during [traefik HTTPS validation](https://github.com/canopy-network/deployments/blob/master/monitoring-stack/loadbalancer/traefik.yml).

{% hint style="warning" %}
Save this information! It'll be used later
{% endhint %}

### 3. Configure Grafana

```bash
cd monitoring-stack
vim .env

# Update Grafana Values
GF_SECURITY_ADMIN_PASSWORD=canopy
GF_SECURITY_ADMIN_USER=admin
GF_SMTP_HOST=smtp.gmail.com:587
GF_SMTP_USER=myadrress@gmail.com
GF_SMTP_PASSWORD=mypassword
GF_SMTP_FROM_ADDRESS=myaddress@gmail.com
```

{% hint style="danger" %}
Grafana configurations like `GF_SECURITY_ADMIN_PASSWORD` should also be updated for production setups. Checkout Grafana's [docker-image configuration guide](https://grafana.com/docs/grafana/latest/setup-grafana/configure-docker/)
{% endhint %}

### 4. Configure your DNS

*Your domain should point to your production server using wildcard subdomains:*

```
<YOUR_SUBDOMAIN>.<YOUR_DOMAIN> A record -> SERVER IP
*.<YOUR_SUBDOMAIN>.<YOUR_DOMAIN> A record -> SERVER IP
```

Domain propagation can take some time! Check it with the following commands:

```
nslookup monitoring.<YOURDOMAIN> -> SERVER IP
nslookup node1.<YOURDOMAIN> -> SERVER IP
nslookup node2.<YOURDOMAIN> -> SERVER IP
```

### 5. Set up alerting (optional)

To receive infrastructure and canopy alerts, configure the Discord and PagerDuty notification channels:

`/deployments/monitoring-stack/monitoring/grafana/provisioning/alerting`\
`/discord-alert.yaml`

```yaml
settings:
  avatar_url: https://miro.medium.com/v2/da:true/resize:fit:1200/0*ZjYSm_q36J4KChdn
  message: |-
      {{ define "alerts.message" -}}
        {{ if .Alerts.Firing -}}
          {{ len .Alerts.Firing }} firing alert(s)
          {{ template "alerts.summarize" .Alerts.Firing }}
        {{- end }}
        {{- if .Alerts.Resolved -}}
          {{ len .Alerts.Resolved }} resolved alert(s)
          {{ template "alerts.summarize" .Alerts.Resolved }}
        {{- end }}
      {{- end }}

      {{ define "alerts.summarize" -}}
        {{ range . -}}
        - {{ index .Annotations "summary" }}
        {{ end }}
      {{ end }}
  title: '{{ template "default.title" . }}'
  url: <YOUR-DISCORD-CHANNEL>
  use_discord_username: false
```

**Pagerduty**

`/deployments/monitoring-stack/monitoring/grafana/provisioning/alerting`\
`/pagerduty-alert.yaml`

```yaml
receivers:
  - uid: bekha14n1fgu8d
    type: pagerduty
    settings:
      integrationKey: <YOUR-PAGERDUTY-KEY>
    disableResolveMessage: false
```

### 6. Install Loki

Installing the loki-docker-driver lets your Docker containers stream logs directly to Loki, enabling real-time log aggregation and search in Grafana.&#x20;

```bash
sudo docker plugin install grafana/loki-docker-driver --alias loki
```

It's essential for end-to-end observability in your monitoring stack.

### 7. Run Canopy

Starting Canopy automatically pulls a snapshot of the latest blockchain.

```bash
cd /deployments/monitoring-stack/
sudo make start_with_snapshot
```

{% hint style="success" %}
Syncing from scratch is also an option: you may remove the `SNAPSHOT_1_URL`  and `SNAPSHOT_2_URL`  from the `.env` file.
{% endhint %}

{% hint style="warning" %}
Important:&#x20;

* Subsequent calls to start\_with\_snapshot will reset the datadirectory back to the latest snapshot
* Use `make up` for a standard start without downloading the snapshot.&#x20;
  * (See `/deployments/monitoring/makefile`  for additional details)
    {% endhint %}

### 8. Explore Setup

With Canopy running, it is recommended for you to familiarize yourself with the created endpoints:

* Grafana: <mark style="color:blue;"><https://monitoring.\\>\<YOUR\_DOMAIN></mark>
* Web wallet for CNPY: <mark style="color:blue;"><https://node1.\\>\<YOUR\_DOMAIN>/wallet</mark>
* Block Explorer for CNPY: <mark style="color:blue;"><https://node1.\\>\<YOUR\_DOMAIN>/explorer</mark>
* Web wallet for CNRY: <mark style="color:blue;"><https://node2.\\>\<YOUR\_DOMAIN>/wallet</mark>
* Block Explorer for CNRY: <mark style="color:blue;"><https://node2.\\>\<YOUR\_DOMAIN>/explorer</mark>

### 9. Sync the blockchain

While the snapshot is pretty close to the top of the blockchain, some syncing will be required in most cases.

Syncing status may be observed in the `monitoring` tab of your web wallet as well as logs and rpc.&#x20;

<figure><img src="/files/pF5WrkWgVJn6hGGz21Hl" alt=""><figcaption></figcaption></figure>

⚠️ Importantly, both CNPY and CNRY should be fully synced and stable before staking.

If there's any sign of corruption or 'stuck' node or if there's any doubt, contact the community in discord.

### 10. Create an 'output' private key

Go to <mark style="color:blue;"><https://node1.\\>\<YOUR\_DOMAIN>/wallet</mark>

<figure><img src="/files/3SmEA6jarALUXLUAoj1E" alt=""><figcaption></figcaption></figure>

Press "New Private Key" and fill out the form:

{% hint style="info" %}
**Nickname**: name to identify the new key

**Password**: used to encrypt the new key
{% endhint %}

**This new key will later receive your validator rewards**. It is recommended to download the `keyfile.json` and backup using the "Download Keys" button.

### 11. Get CNPY

{% hint style="warning" %}
Canopy Betanet is permissioned. Please fill out [this application](https://forms.fillout.com/t/o8nxPZDTipus) for consideration.&#x20;
{% endhint %}

### 12. Stake CNPY

At  <mark style="color:blue;"><https://node1.\\>\<YOUR\_DOMAIN>/wallet</mark>: click the **STAKE** button to initiate a **STAKE** transaction

<figure><img src="/files/HuEnaCA36OC1Ogf0jWjQ" alt="" width="563"><figcaption></figcaption></figure>

**Parameters:**

* Account: `<nickname from step 2>`
  * Important: ⚠️ use the key from step 2 not step 12 ⚠️
  * This account should be the 'funded' account from step 13
  * This is the operator address, where subsequent validator transactions like (edit-stake and unstake) should be sent from.
* Delegate: `false`&#x20;
  * Delegates are not active validators so is not applicable for this guide
* Committees: `1,2`
  * Chain IDs where stake should be allocated
* Amount: CNPY to stake (6 decimals)
  * Leave a few CNPY unstaked for various transactions
* Withdrawal: `false` to auto-compound rewards&#x20;
  * You may use `true` to withdrawal the rewards automatically (comes with penalty)
* Net-addr: `tcp://<YOUR_DOMAIN>`
  * validator's TCP address (\<YOUR DOMAIN> defined in step 4)
* Output: `<nickname from step 12>`&#x20;
  * Important: ⚠️ use the key from step 12 not step 2 ⚠️
  * This address to receive staking rewards (recommended: use key from step 16)
* Signer: `<nickname from step 2>`
  * Account that signs the transaction
* Memo: `optional`
* Txn-fee: `<default is pre-filled>`
  * transaction fee (default is pre-filled)
* Password: `<password from step 2>`
  * Password of signer account

If successful, you'll see something like:

<figure><img src="/files/KnwVdNknNkA32G4bD6nn" alt=""><figcaption></figcaption></figure>

### 13. Watch for 10 minutes

* If STAKED STATUS remains `STAKED` then it's a good sign that your Validator is online and healthy

{% hint style="info" %}
See  [Manage](/docs/secure-canopy/node-runner/manage.md) for monitoring and management details
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://canopy-network.gitbook.io/docs/secure-canopy/node-runner/quickstart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
