> For the complete documentation index, see [llms.txt](https://tv-connector.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://tv-connector.gitbook.io/docs/setup/run-on-local-pc.md).

# Run on local PC

This guide shows steps to run the tool on your local.

\*You can skip this part and go to [Run on cloud service](/docs/setup/run-on-cloud-service.md) if you don't need to test on your local PC.

### Prerequisites of this guide

* Node.js v22.14.x\~
* yarn v1.22.17\~

### Steps

1. Install source code.

```
git clone https://github.com/junta/tradingview-alert-connector.git
```

```
cd tradingview-alert-connector
```

&#x20;  2\. Get your Keys

a. For Perpetual Protocol or GMX, [Export your account's private key](https://metamask.zendesk.com/hc/en-us/articles/360015289632-How-to-export-an-account-s-private-key#:~:text=On%20the%20account%20page%2C%20click,click%20%E2%80%9CConfirm%E2%80%9D%20to%20proceed.)

(creating a new and dedicated account is strongly recommended)

b. For dYdX v4, [Export your secret phrase ](https://tv-connector.gitbook.io/docs/setup/dydx-v4-setup#export-your-secret-phrase-a-set-of-24-words-from-dxdx-website-then-put-it-in-.env-file)

&#x20;  3\. Rename ".env.sample" file to ".env"

&#x20;  4\. Open .env in an editor and fill each variable

#### Environment Variables

<table><thead><tr><th width="255.98808258934082">Key</th><th width="278.7299875770638">Value</th><th>Required</th></tr></thead><tbody><tr><td>PERPETUAL_PRIVATE_KEY</td><td>Your Private Key of Ethereum Address</td><td>Yes for Perpetual Protocol</td></tr><tr><td>GMX_PRIVATE_KEY</td><td>Your Private Key of Ethereum Address</td><td>Yes for GMX</td></tr><tr><td>GMX_LEVERAGE</td><td>Number. Put 2 for 2x Leverage</td><td>Yes for GMX</td></tr><tr><td>DYDX_V4_MNEMONIC</td><td>Your mnemonic(seed) phrase</td><td>Yes for dYdX v4 </td></tr><tr><td>BLUEFIN_MNEMONIC</td><td>Your mnemonic(seed) phrase of SUI chain compatible wallet</td><td>Yes for Bluefin</td></tr><tr><td>HYPERLIQUID_PRIVATE_KEY</td><td>Your Private Key of Ethereum Address</td><td>Yes for hyperliquid</td></tr><tr><td>TRADINGVIEW_PASSPHRASE</td><td>Unique password to enhance your security. Optional but recommended to be set.</td><td>No</td></tr><tr><td>SENTRY_DNS</td><td>your sentry.io URL.<br>If you want to add monitoring by Sentry.io, please follow <a href="/docs/setup/add-sentry.io-monitoring.md">this guide</a>.</td><td>No</td></tr></tbody></table>

5\.  Install ngrok, sign up, and add authtoken with the following guide

We use ngrok to get public URL and tunnel to your localhost to receive webhook from Tradingview

{% embed url="<https://ngrok.com/download>" %}

6\. Run the connector web server

#### Option1: Run on docker container(recommended)

Install docker desktop(if not installed yet)

{% embed url="<https://www.docker.com/products/docker-desktop/>" %}

Build and start docker container

```
// run for mainnet
docker-compose up -d
```

&#x20;Open a **new terminal window** and start ngrok

```
yarn ngrok:docker
```

#### Option2: Run without docker

Open Terminal, then

* Install dependencies.

```
npm install --force
```

* Start the web server

```
yarn start
```

* Open a **new terminal window** and start ngrok

```
yarn ngrok
```

7. check your console running ngrok. outputs should be as follows.

![](https://1420663172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0DdMLXZFpK1vsL3ZKiG%2Fuploads%2FUiTkRal4JdNXwWzaQ789%2F%E3%82%B9%E3%82%AF%E3%83%AA%E3%83%BC%E3%83%B3%E3%82%B7%E3%83%A7%E3%83%83%E3%83%88%202022-03-24%2013.53.44.png?alt=media\&token=89326eaa-269e-414a-9557-adc0840090fa)

8\. Open your browser and access <http://localhost:3000/accounts>

If you see a status message of your set up on your browser, the server is running properly.

<figure><img src="https://1420663172-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fb0DdMLXZFpK1vsL3ZKiG%2Fuploads%2F2NjWoRz4vf3jAH2vHSmv%2FScreenshot%202024-06-06%20at%2019.29.51.png?alt=media&amp;token=b5ef1621-0678-4988-9200-8fee1cb98f74" alt=""><figcaption></figcaption></figure>

9\. Go to [Test Tradingview strategy alert](/docs/setup/test-tradingview-strategy-alert.md) page and check if you can receive alert from Tradingview
