Skip to content

Commit 094eba3

Browse files
committed
Complete the install-configure-cli-lite docs
The TUNNEL_TOKEN property is now required to be able to run Balancer using the cli-lite Signed-off-by: Jesus Graterol <[email protected]>
1 parent c051dd7 commit 094eba3

File tree

3 files changed

+55
-49
lines changed

3 files changed

+55
-49
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ cd cli-lite && npm start
5858
1. [Setup a virtual machine (DigitalOcean)](./docs/setup-vm/index.md)
5959
2. [Install dependencies](./docs/install-dependencies/index.md)
6060
3. [Install and configure `cli-lite`](./docs/install-configure-cli-lite/index.md)
61-
4. [Setup a Cloudflare Tunnel](./docs/setup-cloudflare-tunnel/index.md)
62-
5. [Setup Telegram (Optional)](./docs/setup-telegram/index.md)
61+
4. [Setup Telegram (Optional)](./docs/setup-telegram/index.md)
6362

6463

6564

docs/install-configure-cli-lite/index.md

Lines changed: 54 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22

33
# Installing `cli-lite`
44

5-
1. Connect to your Droplet by navigating to its page and clicking on the **"Console"** button
5+
1. Connect to your Droplet by navigating to its page and clicking on the **"Console"** button.
66

7-
2. Once the connection has been established, download the source code from [GitHub](https://github.com/bitcoin-balancer/cli-lite) by running:
7+
2. Once connected, download the source code from [GitHub](https://github.com/bitcoin-balancer/cli-lite) by running:
88

99
```bash
1010
git clone https://github.com/bitcoin-balancer/cli-lite.git
@@ -22,10 +22,7 @@
2222
npm run build && npm start
2323
```
2424

25-
**Tip:** you can exit the CLI by pressing `Ctrl+c`
26-
27-
28-
25+
**Tip:** you can exit the CLI by pressing `Ctrl+c`.
2926

3027
<br/><br/><br/>
3128

@@ -37,22 +34,23 @@ If your CLI isn't running, start it with:
3734
npm start
3835
```
3936

40-
Once the CLI is initialized, it will prompt you with a form where you will be able to input the configuration that will be used by your Balancer instance.
37+
Once the CLI is initialized, it will prompt you with a form where you can input the configuration for your Balancer instance.
4138

4239
**Note:** these values can be easily modified in the future.
4340

4441
## `GUI_URL`
4542

46-
If you own a domain and are going to setup a [Cloudflare Tunnel](../setup-cloudflare-tunnel/index.md), enter the URL to your domain (e.g https://yourdomain.com). Alternatively, you can make use of a subdomain as follows: https://balancer.yourdomain.com.
43+
Enter the URL that will be used to access your Balancer GUI (Graphical User Interface).
44+
45+
The URL can be any domain (e.g. https://mydomain.com) or a subdomain (e.g. https://balancer.mydomain.com).
4746

48-
Otherwise, enter your Droplet's IP Address (`ipv4`) followed by the GUI's port (`8090`). For example: http://143.244.128.76:8090.
4947

5048

5149
<br/>
5250

5351
## `TELEGRAM`
5452

55-
Enabling Telegram on your Balancer instance will create a communication stream that will keep you up-to-date with your position and the market state in general. If you wish to do so, follow the ["Setup Telegram"](./docs/setup-telegram/index.md) guide and enter the **Telegram Bot Token** and the **Chat ID** when prompted.
53+
Enabling Telegram on your Balancer instance will create a communication stream that keeps you up-to-date with your position and the market state. If you wish to enable this feature, follow the ["Setup Telegram"](../setup-telegram/index.md) guide and enter the **Telegram Bot Token** and the **Chat ID** when prompted.
5654

5755
If you do not wish to enable Telegram, simply leave the defaults by pressing enter twice.
5856

@@ -62,25 +60,23 @@ If you do not wish to enable Telegram, simply leave the defaults by pressing ent
6260

6361
## `EXCHANGE_CONFIGURATION`
6462

65-
You will be asked to select the quote asset you wish to trade with (Defaults to **USDT**). Additionally, you will be able to select the exchange that will be used by the indicators and the position module (Defaults to **binance**).
66-
67-
63+
You will be asked to select the quote asset you wish to trade with (Defaults to **USDT**). Additionally, you can select the exchange that will be used by the indicators and the position module (Defaults to **binance**).
6864

6965
<br/>
7066

7167
## `EXCHANGE_CREDENTIALS`
7268

7369
### Creating an API Key & Secret (Binance)
7470

75-
1. Navigate to your "Dashboard", expand the "Account" menu and click on ["API MAnagement"](https://www.binance.com/en/my/settings/api-management).
71+
1. Navigate to your "Dashboard", expand the "Account" menu, and click on ["API Management"](https://www.binance.com/en/my/settings/api-management).
7672

77-
2. Click on the "Create API" button, select the **"System generated"** option and name it "balancer".
73+
2. Click on the "Create API" button, select the **"System generated"** option, and name it "balancer".
7874

7975
3. Click on "Edit restrictions" and under "IP access restrictions", choose the option "Restrict access to trusted IPs only".
8076

81-
4. Enter your Droplets IP Address (`ipv4`), confirm the input and click on the "Save" button.
77+
4. Enter your Droplet's IP Address (`ipv4`), confirm the input, and click on the "Save" button.
8278

83-
5. Click on "Edit restrictions" again and make sure that the only checked API restrictions are:
79+
5. Click on "Edit restrictions" again and ensure that the only checked API restrictions are:
8480
- Enable Reading
8581
- Enable Spot Trading
8682

@@ -97,16 +93,53 @@ Once you have configured your account's API, enter your **API Key** and **Secret
9793

9894
## `TUNNEL_TOKEN`
9995

100-
Setting up a [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/) increases the security and reliability of your Balancer instance significantly for very little effort and allows you to serve your Balancer instance through a domain you own.
96+
In order to be able to serve Balancer through a [Cloudflare Tunnel](https://developers.cloudflare.com/cloudflare-one/connections/connect-networks/), you need a domain and be able to manage its DNS records.
97+
98+
Follow these steps to generate your `TUNNEL_TOKEN`:
99+
100+
1. Log into your Cloudflare account and navigate to the "Zero Trust" section. Follow the steps and create your team. Note that you can always choose the free plan despite the apparent pay wall.
101101

102-
If you with to enable this feature go through the ["Setup a Cloudflare Tunnel"](../setup-cloudflare-tunnel/index.md) guide and enter the **Tunnel Token** once you have generated it.
102+
2. After completing the team creation process and being redirected to the Zero Trust Dashboard, navigate to `Networks/Tunnels` and click on **"Add a tunnel"**.
103+
104+
3. Select **"Cloudflared"** as your connector and click on **Next**
105+
106+
4. Enter the name of your tunnel (e.g. `balancer`)
107+
108+
5. Choose **"Docker"** as your environment and extract your `TUNNEL_TOKEN` from the command provided by Cloudflare which comes in the following format:
109+
```bash
110+
docker run cloudflare/cloudflared:latest tunnel --no-autoupdate run --token <TUNNEL_TOKEN>
111+
```
112+
113+
6. Now that you have the `TUNNEL_TOKEN`, enter it into `cli-lite`'s prompt.
114+
115+
7. Finally, add the public hostnames for Balancer:
116+
- **gui**:
117+
```text
118+
Subdomain: balancer
119+
Domain: yourdomain.com
120+
Path: leave this property blank
121+
Service Type: HTTP
122+
URL: gui:8090 <service-name:port>
123+
```
124+
- **api**:
125+
```text
126+
Subdomain: balancerapi
127+
Domain: yourdomain.com
128+
Path: leave this property blank
129+
Service Type: HTTP
130+
URL: api:5075 <service-name:port>
131+
```
132+
**IMPORTANT:** the API must always be exposed under the `balancerapi` subdomain as its URL is derived by the GUI at runtime. For example: `balancerapi.yourdomain.com`.
103133
104-
Otherwise, just press enter to continue.
105134
106135
107136
108137
<br/><br/><br/>
109138
110139
# Next step
111140
112-
[Setup a Cloudflare Tunnel](../setup-cloudflare-tunnel/index.md)
141+
Once your configuration has been saved, you're ready to `build` and `run` your Balancer instance by executing the `Docker/up` action.
142+
143+
When all the images have been downloaded and the containers have been created, you can access your instance through the URL you entered into `GUI_URL`.
144+
145+
In order to authenticate, execute the `Configuration/view-config` and make use of the `ROOT_ACCOUNT` credentials. Keep in mind that you must enter the generated `otpSecret` into your Google Authenticator to be able to generate valid OTP Tokens.

docs/setup-cloudflare-tunnel/index.md

Lines changed: 0 additions & 26 deletions
This file was deleted.

0 commit comments

Comments
 (0)