-
Connect to your Droplet by navigating to its page and clicking on the "Console" button.
-
Once connected, download the source code from GitHub by running:
git clone https://github.com/bitcoin-balancer/cli-lite.git
-
Navigate to the
cli-lite
directory and install the dependencies:cd cli-lite && npm install
-
Finally, build and start the CLI:
npm run build && npm start
Tip: you can exit the CLI by pressing
Ctrl+c
.
If your CLI isn't running, start it with:
npm start
Once the CLI is initialized, it will prompt you with a form where you can input the configuration for your Balancer instance.
Note: these values can be easily modified in the future.
Enter the URL that will be used to access your Balancer GUI (Graphical User Interface).
The URL can be any domain (e.g. https://mydomain.com) or a subdomain (e.g. https://balancer.mydomain.com).
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" guide and enter the Telegram Bot Token and the Chat ID when prompted.
If you do not wish to enable Telegram, simply leave the defaults by pressing enter twice.
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).
-
Navigate to your "Dashboard", expand the "Account" menu, and click on "API Management".
-
Click on the "Create API" button, select the "System generated" option, and name it "balancer".
-
Click on "Edit restrictions" and under "IP access restrictions", choose the option "Restrict access to trusted IPs only".
-
Enter your Droplet's IP Address (
ipv4
), confirm the input, and click on the "Save" button. -
Click on "Edit restrictions" again and ensure that the only checked API restrictions are:
- Enable Reading
- Enable Spot Trading
Then, click on the "Save" button.
Once you have configured your account's API, enter your API Key and Secret Key.
In order to be able to serve Balancer through a Cloudflare Tunnel, you need a domain and be able to manage its DNS records.
Follow these steps to generate your TUNNEL_TOKEN
:
-
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.
-
After completing the team creation process and being redirected to the Zero Trust Dashboard, navigate to
Networks/Tunnels
and click on "Add a tunnel". -
Select "Cloudflared" as your connector and click on Next
-
Enter the name of your tunnel (e.g.
balancer
) -
Choose "Docker" as your environment and extract your
TUNNEL_TOKEN
from the command provided by Cloudflare which comes in the following format:docker run cloudflare/cloudflared:latest tunnel --no-autoupdate run --token <TUNNEL_TOKEN>
-
Now that you have the
TUNNEL_TOKEN
, enter it intocli-lite
's prompt. -
Finally, add the public hostnames for Balancer:
- gui:
Subdomain: balancer Domain: yourdomain.com Path: leave this property blank Service Type: HTTP URL: gui:8090 <service-name:port>
- api:
IMPORTANT: the API must always be exposed under the
Subdomain: balancerapi Domain: yourdomain.com Path: leave this property blank Service Type: HTTP URL: api:5075 <service-name:port>
balancerapi
subdomain as its URL is derived by the GUI at runtime. For example:balancerapi.yourdomain.com
.
- gui:
Once your configuration has been saved, you're ready to build
and run
your Balancer instance by executing the Docker/up
action.
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
.
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.