hojas/bisq_arbitrage_notes/operation/Install bisq daemon and CLI.md

88 lines
2.3 KiB
Markdown
Raw Normal View History

2023-12-09 19:27:21 +01:00
# Installation of bisq daemon and CLI
## Installing
### Java
```bash
apt update
apt install default-jdk
java -version
```
Java must be installed.
### Daemon and CLI
```bash
cd
mkdir bisq
cd bisq
BISQ_VERSION="1.9.4"
wget "https://github.com/bisq-network/bisq/releases/download/v${BISQ_VERSION}/bisq-daemon-${BISQ_VERSION}.zip"
wget "https://github.com/bisq-network/bisq/releases/download/v${BISQ_VERSION}/bisq-cli-${BISQ_VERSION}.zip"
unzip bisq-daemon-${BISQ_VERSION}.zip
unzip bisq-cli-${BISQ_VERSION}.zip
rm bisq-daemon-${BISQ_VERSION}.zip
rm bisq-cli-${BISQ_VERSION}.zip
```
1. Copy the pre-built bisq cli from github
2. Copy the pre-built bisq daemon from github
3. Unzip both
```bash
cd ~/bisq/bisq-daemon-1.9.4
java -jar daemon.jar --apiPassword=noesfacilvivirsinbisq
# Give it some time to start up
cd ~/bisq/bisq-cli-1.9.4
java -jar cli.jar --password=noesfacilvivirsinbisq getversion
```
4. Run the bisq-daemon
5. Make a test call from the CLI to test
NOTE: the daemon consumes some RAM. Ensure that there is at least a 2Gb of RAM ready for the daemon to use, otherwise Java runs out of memory and behaves weird.
### Payment Accounts
To copy over existing payment accounts from another instance, one has to copy the `UserPayload` file, located in `$BISQ_DATA/btc_mainnet/db/UserPayload` into the bisq daemon data folder.
---
A few CLI calls to practice:
- Get BSQ balance
```shell
java -jar cli.jar --password=noesfacilvivirsinbisq getbalance --currency-code=BSQ
```
- Get BTC balance
``` bash
java -jar cli.jar --password=noesfacilvivirsinbisq getbalance --currency-code=BTC
```
- Set a password on the wallet
```bash
java -jar cli.jar --password=noesfacilvivirsinbisq setwalletpassword --wallet-password="noesfacilvivirsinbisq"
```
- Unlock the wallet for 60 seconds
```bash
java -jar cli.jar --password=noesfacilvivirsinbisq unlockwallet --wallet-password="noesfacilvivirsinbisq" --timeout=60
```
- Get EUR/BTC price
```bash
java -jar cli.jar --password=noesfacilvivirsinbisq getbtcprice --currency-code=EUR
```
- Get a funding address
```bash
java -jar cli.jar --password=noesfacilvivirsinbisq getfundingaddresses
```
- Get offers for a certain market and direction
```bash
java -jar cli.jar --password=noesfacilvivirsinbisq getoffers --direction=BUY --currency-code=EUR
```
- Stop the daemon
```bash
java -jar cli.jar --password=noesfacilvivirsinbisq stop
```