> ## Documentation Index
> Fetch the complete documentation index at: https://covalenthq.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Run EWM Light Client

The **EWM Light Client** can be run using four methods. Follow the instructions below based on your preferred approach:

* **Run with Docker Compose**
* **Run with Installer for macOS**
* **Run with Pre-complied Binaries**
* **Build & Run from Source**

***

## 1. Run with Docker Compose

### Instructions to Run EWM Light Client with Docker

<Steps>
  <Step title="Clone the Repository">
    ```shell theme={null}
    git clone https://github.com/covalenthq/ewm-das
    cd ewm-das
    ```
  </Step>

  <Step title="Build the Docker Image">
    ```shell theme={null}
    docker build -t covalent/light-client -f Dockerfile.lc .
    ```

    <Note>**Note:** If you are running the client on **Windows**, you may have to modify the Dockerfile.lc script since the lining on Windows is different than Linux.</Note>

    #### For Windows:

    ```shell theme={null}
    # Install dos2unix to fix line endings
    RUN apk add --no-cache dos2unix
    ```
  </Step>

  <Step title="Run the Docker Container">
    You need to provide the `PRIVATE_KEY` of your burner address, which was generated as part of [Prerequisites Step 2](/ewm-light-client/lc-setup/).

    ```shell theme={null}
    docker run -d --restart always --name light-client -e PRIVATE_KEY="YOUR_HEX_PRIVATE_KEY" covalent/light-client
    ```
  </Step>

  <Step title="Check the Status of the Light Client">
    ```shell theme={null}
    docker logs -f light-client
    ```
  </Step>
</Steps>

**Expected Output:**
For version details, please refer to our Discord's `light-client` channel.

```bash theme={null}
Version: v0.x.0, commit: 8d6709bee9e79d3c4e6ece35fed65da02f3850f4
2024-09-18T15:45:01.238-0700	INFO	light-client	light-client/main.go:91	Starting client...
2024-09-18T15:45:01.238-0700	INFO	light-client	light-client/main.go:97	Client identity: 0x51b6D674514849aF97FB77BCac51bcdD7799842C
...
```

## 2. Run using Installer for macOS only:

### Running Light Client on macOS

<Steps>
  <Step title="Install IPFS Kubo Client (If Not Already Installed)">
    ```shell theme={null}
    brew install ipfs
    ```
  </Step>

  <Step title="Configure IPFS Kubo Client">
    ```shell theme={null}
    ipfs init
    ```
  </Step>

  <Step title="Install and Launch the Light Client">
    You need to provide the `PRIVATE_KEY` of your burner address, which was generated as part of [Prerequisites Step 2](/ewm-light-client/lc-setup/).

    **Single Command Installation:**

    ```shell theme={null}
    curl -sSf https://storage.googleapis.com/ewm-release-artefacts/{{VERSION}}/macos/install.sh | bash -s <YOUR PRIVATE KEY>
    ```

    **Alternative Installation Method:**

    1. Go to the [Light Client Releases](https://github.com/covalenthq/ewm-das/releases) page and download the latest release.
    2. Unzip the downloaded archive and navigate to the directory:
       ```shell theme={null}
       cd das-macos-latest
       ```
    3. Run the installation script:
       ```shell theme={null}
       ./install.sh <YOUR_PRIVATE_KEY>
       ```

    *The script will install all files in the `$HOME/.covalent` directory.*
  </Step>

  <Step title="Check the Status of the Light Client">
    ```shell theme={null}
    tail -n 1000 -f $HOME/.covalent/light-client.log
    ```

    **Expected Output:**
    For version details, please refer to our Discord's `light-client` channel.

    ```shell theme={null}
    Version: v0.x.0, commit: 8d6709bee9e79d3c4e6ece35fed65da02f3850f4
    2024-09-18T15:45:01.238-0700	INFO	light-client	light-client/main.go:91	Starting client...
    2024-09-18T15:45:01.238-0700	INFO	light-client	light-client/main.go:97	Client identity: 0x51b6D674514849aF97FB77BCac51bcdD7799842C
    ...
    ```
  </Step>

  <Step title="Uninstall the Light Client">
    ```shell theme={null}
    $HOME/.covalent/uninstall.sh
    ```
  </Step>
</Steps>

***

## 3. Run with Pre-complied Binaries

### Running from Binaries

<Steps>
  <Step title="Install IPFS Kubo Client (If Not Already Installed)">
    ```shell theme={null}
    brew install ipfs
    ```
  </Step>

  <Step title="Configure IPFS Kubo Client">
    ```shell theme={null}
    ipfs init
    ```
  </Step>

  <Step title="Download Binary for Your Platform">
    Get the required pre-compiled binaries for Ubuntu or macOS from the [Releases](https://github.com/covalenthq/ewm-das/tags) page.
  </Step>

  <Step title="Run the Light Client">
    You need to provide the `PRIVATE_KEY` of your burner address, which was generated as part of [Prerequisites Step 2](/ewm-light-client/lc-setup/).

    ```shell theme={null}
    ./bin/light-client --rpc-url <rpc-url> \
        --collect-url <collect-url> \
        --private-key <private-key>
    ```

    **Command:**

    ```shell theme={null}
    ./bin/light-client --rpc-url ws://coordinator.das.test.covalentnetwork.org/rpc --collect-url https://us-central1-covalent-network-team-sandbox.cloudfunctions.net/ewm-das-collector --private-key ${PRIVATE_KEY}
    ```
  </Step>

  <Step title="Check the Status of the Light Client">
    ```shell theme={null}
    tail -n 1000 -f $HOME/.covalent/light-client.log
    ```
  </Step>
</Steps>

***

## 4. Build & Run from Source

### Building from the Source

<Steps>
  <Step title="Clone the Repository">
    ```shell theme={null}
    git clone https://github.com/covalenthq/ewm-das
    cd ewm-das
    ```
  </Step>

  <Step title="Install Dependencies">
    ```shell theme={null}
    make deps
    ```
  </Step>

  <Step title="Build Binaries">
    ```shell theme={null}
    make
    ```

    <Note>**Note:** The binaries will be built in the `bin` directory.</Note>
  </Step>

  <Step title="Run the Light Client">
    You need to provide the `PRIVATE_KEY` of your burner address, which was generated as part of [Prerequisites Step 2](/ewm-light-client/lc-setup/).

    ```shell theme={null}
    ./bin/light-client --rpc-url <rpc-url> \
        --collect-url <collect-url> \
        --private-key <private-key>
    ```

    **Command:**

    ```shell theme={null}
    ./bin/light-client --rpc-url ws://coordinator.das.test.covalentnetwork.org/rpc --collect-url https://us-central1-covalent-network-team-sandbox.cloudfunctions.net/ewm-das-collector --private-key ${PRIVATE_KEY}
    ```
  </Step>

  <Step title="Check the Status of the Light Client">
    ```shell theme={null}
    tail -n 1000 -f $HOME/.covalent/light-client.log
    ```

    **Expected Output:**
    For version details, please refer to our Discord's `light-client` channel.

    ```shell theme={null}
    Version: v0.x.0, commit: 8d6709bee9e79d3c4e6ece35fed65da02f3850f4
    2024-09-18T15:45:01.238-0700	INFO	light-client	light-client/main.go:91	Starting client...
    2024-09-18T15:45:01.238-0700	INFO	light-client	light-client/main.go:97	Client identity: 0x51b6D674514849aF97FB77BCac51bcdD7799842C
    ...
    ```
  </Step>

  <Step title="Clean Up Build Artifacts">
    To remove build artifacts, run:

    ```shell theme={null}
    make clean
    ```
  </Step>
</Steps>
