mirror of
https://github.com/haveno-dex/haveno.git
synced 2024-10-01 01:35:48 -04:00
remove some more files
This commit is contained in:
parent
986364f588
commit
2bd9a2b327
@ -1,138 +0,0 @@
|
|||||||
# Bisq DAO development setup guide
|
|
||||||
|
|
||||||
This guide describes how to setup a Bisq DAO development environment running against a local Bitcoin regtest network.
|
|
||||||
It assumes you have already configured your development environment following the [dev setup guide](dev-setup.md).
|
|
||||||
|
|
||||||
## Configure Bitcoin Core
|
|
||||||
|
|
||||||
1. Create/configure the [bitcoin.conf](https://en.bitcoin.it/wiki/Running_Bitcoin#Bitcoin.conf_Configuration_File) file inside the Bitcoin Core [data directory](https://en.bitcoin.it/wiki/Data_directory#Default_Location) as follows.
|
|
||||||
|
|
||||||
_Please note that `txindex` triggers a resync of the entire blockchain and be aware if you set that on mainnet it will take a while. Also, extra settings for more security are recommended if you run this in mainnet mode._
|
|
||||||
|
|
||||||
Linux:
|
|
||||||
```
|
|
||||||
regtest=1
|
|
||||||
|
|
||||||
# The default rpcPort for regtest from Bitcoin Core 0.16 and higher is: 18443
|
|
||||||
# The default rpcPort for testnet is: 18332
|
|
||||||
# For mainnet: 8332
|
|
||||||
[regtest]
|
|
||||||
peerbloomfilters=1
|
|
||||||
rpcport=18443
|
|
||||||
|
|
||||||
server=1
|
|
||||||
txindex=1
|
|
||||||
rpcuser=YOUR_USER_NAME
|
|
||||||
rpcpassword=YOUR_PW
|
|
||||||
blocknotify=bash ~/.bitcoin/blocknotify %s
|
|
||||||
```
|
|
||||||
|
|
||||||
MacOS:
|
|
||||||
```
|
|
||||||
regtest=1
|
|
||||||
|
|
||||||
# The default rpcPort for regtest from Bitcoin Core 0.16 and higher is: 18443
|
|
||||||
# The default rpcPort for testnet is: 18332
|
|
||||||
# For mainnet: 8332
|
|
||||||
[regtest]
|
|
||||||
peerbloomfilters=1
|
|
||||||
rpcport=18443
|
|
||||||
|
|
||||||
server=1
|
|
||||||
txindex=1
|
|
||||||
rpcuser=YOUR_USER_NAME
|
|
||||||
rpcpassword=YOUR_PW
|
|
||||||
blocknotify=bash ~/Library/Application\ Support/Bitcoin/blocknotify %s
|
|
||||||
```
|
|
||||||
|
|
||||||
Windows:
|
|
||||||
```
|
|
||||||
regtest=1
|
|
||||||
|
|
||||||
# The default rpcPort for regtest from Bitcoin Core 0.16 and higher is: 18443
|
|
||||||
# The default rpcPort for testnet is: 18332
|
|
||||||
# For mainnet: 8332
|
|
||||||
[regtest]
|
|
||||||
peerbloomfilters=1
|
|
||||||
rpcport=18443
|
|
||||||
|
|
||||||
server=1
|
|
||||||
txindex=1
|
|
||||||
rpcuser=YOUR_USER_NAME
|
|
||||||
rpcpassword=YOUR_PW
|
|
||||||
blocknotify="%AppData%\Bitcoin\blocknotify.bat" %s
|
|
||||||
```
|
|
||||||
|
|
||||||
2. Create a `blocknotify` file (`blocknotify.bat` on Windows) inside the Bitcoin Core [data directory](https://en.bitcoin.it/wiki/Data_directory#Default_Location) with the following content.
|
|
||||||
This defines the ports where a new block event gets forwarded. Bisq will listen on that port and each Bisq node needs to use a different port. You can add or remove ports as needed.
|
|
||||||
|
|
||||||
_On Windows, you will need to download and install [ncat](https://nmap.org/ncat/) to be able to use the ncat command._
|
|
||||||
|
|
||||||
Linux/MacOS:
|
|
||||||
```bash
|
|
||||||
#!/bin/bash
|
|
||||||
echo $1 | nc -w 1 127.0.0.1 5120
|
|
||||||
echo $1 | nc -w 1 127.0.0.1 5121
|
|
||||||
echo $1 | nc -w 1 127.0.0.1 5122
|
|
||||||
echo $1 | nc -w 1 127.0.0.1 5123
|
|
||||||
```
|
|
||||||
|
|
||||||
Windows:
|
|
||||||
```batch
|
|
||||||
echo %1 | ncat -w 1 127.0.0.1 5120
|
|
||||||
echo %1 | ncat -w 1 127.0.0.1 5121
|
|
||||||
echo %1 | ncat -w 1 127.0.0.1 5122
|
|
||||||
echo %1 | ncat -w 1 127.0.0.1 5123
|
|
||||||
```
|
|
||||||
|
|
||||||
|
|
||||||
## Program arguments for DAO mode
|
|
||||||
|
|
||||||
- `--daoActivated`: If set to true it enables the DAO mode. For testnet and regtest it is enabled by default.
|
|
||||||
- `--genesisBlockHeight`: If set it overrides the hard coded block height of the genesis tx. Set it to your local genesis tx height.
|
|
||||||
- `--genesisTxId`: If set it overrides the hard coded genesis tx ID. Set it to your local genesis tx ID.
|
|
||||||
- `--fullDaoNode`: If true it enables full DAO node mode (in contrast to default lite node mode). At least one seed node must be running as a full DAO node to support other lite nodes.
|
|
||||||
- `--rpcUser`: RPC user as defined in bitcoin.conf
|
|
||||||
- `--rpcPassword`: RPC pw as defined in bitcoin.conf
|
|
||||||
- `--rpcPort`: RPC port. For regtest 18443
|
|
||||||
- `--rpcBlockNotificationPort`: One of the ports defined in the `blocknotify` file.
|
|
||||||
|
|
||||||
|
|
||||||
## Run the application in DAO mode
|
|
||||||
|
|
||||||
If you want to run any instance in DAO mode, use the following program arguments.
|
|
||||||
|
|
||||||
Full node mode:
|
|
||||||
|
|
||||||
`--daoActivated=true --genesisBlockHeight=111 --genesisTxId=30af0050040befd8af25068cc697e418e09c2d8ebd8d411d2240591b9ec203cf --baseCurrencyNetwork=BTC_REGTEST --useDevPrivilegeKeys=true --useLocalhostForP2P=true --nodePort=7777 --appName=bisq-BTC_REGTEST_Alice_dao --fullDaoNode=true --rpcUser=YOUR_USER_NAME --rpcPassword=YOUR_PW --rpcPort=18443 --rpcBlockNotificationPort=5120`
|
|
||||||
|
|
||||||
Lite node mode:
|
|
||||||
|
|
||||||
Note: At least one seed node must be running as a full DAO node to support other lite nodes.
|
|
||||||
|
|
||||||
`--daoActivated=true --genesisBlockHeight=111 --genesisTxId=30af0050040befd8af25068cc697e418e09c2d8ebd8d411d2240591b9ec203cf --baseCurrencyNetwork=BTC_REGTEST --useDevPrivilegeKeys=true --useLocalhostForP2P=true --nodePort=8888 --appName=bisq-BTC_REGTEST_Bob_dao`
|
|
||||||
|
|
||||||
_Don't forget to use different rpcBlockNotificationPorts for different full node instances, otherwise only one node will receive the new block event forwarded to that port._
|
|
||||||
|
|
||||||
|
|
||||||
## DAO genesis transaction
|
|
||||||
|
|
||||||
### Use the predefined setup
|
|
||||||
|
|
||||||
The creation of the genesis tx is a bit cumbersome. To make it easier to get started you can use the [dao-setup.zip](dao-setup.zip) file.
|
|
||||||
Extract the file and use those data directories for the Bitcoin Core as well as the Alice and Bob instances which are configured to have the genesis tx as defined in the above program arguments (`30af0050040befd8af25068cc697e418e09c2d8ebd8d411d2240591b9ec203cf` at height `111`).
|
|
||||||
|
|
||||||
_You need to adjust the path to the `blocknotify` file inside of `bitcoin.conf` before starting Bitcoin Core._
|
|
||||||
|
|
||||||
### Setup a custom DAO genesis transaction
|
|
||||||
|
|
||||||
To create your own genesis transaction follow these steps:
|
|
||||||
|
|
||||||
- Send 2.50010000 BTC from Bitcoin Core to another address inside Bitcoin Core (label it with `Genesis funding address`).
|
|
||||||
- Go to the send screen and open the coin control feature. Select the labeled transaction output of the address labeled with `Genesis funding address`. Use that as the only input source for the genesis tx.
|
|
||||||
- Start Alice in full or lite node mode and go to the DAO/Wallet/Receive screen. Copy the BSQ address and use it for one of the receivers of the genesis tx. When pasting into Bitcoin Core remove the `B` prefix - that prefix is marking a BSQ address but technically it is a BTC address.
|
|
||||||
- Do the same with Bob.
|
|
||||||
- You send in sum exactly 2.5 BTC to both Alice and Bob. You can choose how to distribute it (e.g. 1 BTC to Alice 1.5 BTC to Bob).
|
|
||||||
- Set the miner fee so that it is exactly the remaining 0.00010000 BTC. That might be the tricky part as miner fee selection is not very convenient in Bitcoin Core. In worst case if you cannot get the right miner fee you can add the difference to one of the receivers (e.g. send 1.0000234 BTC instead of 1 BTC).
|
|
||||||
|
|
||||||
_Note: It is important that there is exactly 2.5 BTC spent entirely as described, otherwise the genesis tx is invalid._
|
|
Binary file not shown.
@ -1,50 +0,0 @@
|
|||||||
# Translation Process
|
|
||||||
|
|
||||||
### Overview
|
|
||||||
|
|
||||||
Bisq is offered in multiple languages. Translations are managed with Transifex online software.
|
|
||||||
|
|
||||||
User facing texts **must not** be hardcoded in the source code files.
|
|
||||||
|
|
||||||
English is the base language for translations.
|
|
||||||
|
|
||||||
### Adding or changing English texts
|
|
||||||
|
|
||||||
Being a base language English is managed directly in the project.
|
|
||||||
|
|
||||||
Edit `core/src/main/resources/i18n/displayStrings.properties` to add or modify English texts.
|
|
||||||
Mind the chapters. Fit your entry properly.
|
|
||||||
|
|
||||||
Once your changes get merged the Transifex will sync itself with GitHub.
|
|
||||||
|
|
||||||
However, **do not** edit files for other languages. They are synced from Transifex.
|
|
||||||
|
|
||||||
### Adding or changing texts in other languages (non-English)
|
|
||||||
|
|
||||||
All translations are managed with [Transifex](https://www.transifex.com/).
|
|
||||||
Sign up, find `bisq-desktop` project, and join the team.
|
|
||||||
Once accepted, you will be able to edit translations.
|
|
||||||
|
|
||||||
The entry must exist in English to be available for translation.
|
|
||||||
|
|
||||||
To make translations effective in the project you need to install the Transifex client and run the script to pull the updates.
|
|
||||||
This is described below.
|
|
||||||
|
|
||||||
### Installing the Transifex client command-line tool
|
|
||||||
|
|
||||||
You'll find a detailed guide [how to install the Transifex client](https://docs.transifex.com/client/installing-the-client) on the Transifex page.
|
|
||||||
|
|
||||||
The Transifex Bisq project config file is included as part of the repository. It can be found at `core/.tx/config`.
|
|
||||||
|
|
||||||
### Synchronising translations
|
|
||||||
|
|
||||||
We've prepared a script to update the translation files with the Transifex client command-line tool.
|
|
||||||
|
|
||||||
* Run [update_translations.sh](https://github.com/bisq-network/bisq/blob/master/core/update_translations.sh)
|
|
||||||
|
|
||||||
Synchronization output expected:
|
|
||||||
|
|
||||||
* All translation files in [i18n directory](https://github.com/bisq-network/bisq/blob/master/core/src/main/resources/i18n) have been updated.
|
|
||||||
|
|
||||||
Go over the changes if there are any obvious issues (Transifex had once a problem which caused a rewrite of certain keys)
|
|
||||||
and commit and push them to master.
|
|
@ -1,196 +0,0 @@
|
|||||||
#!/usr/bin/env bash
|
|
||||||
# This script can be used to create a Bisq DAO genesis transaction on either regtest or testnet.
|
|
||||||
# Requirements:
|
|
||||||
# - bc and jq must be installed (e.g. sudo apt install bc jq)
|
|
||||||
|
|
||||||
set -e
|
|
||||||
|
|
||||||
BTC_NETWORK=regtest
|
|
||||||
GENESIS_BSQ_AMOUNT=0
|
|
||||||
GENESIS_BSQ_DISTRIBUTION=()
|
|
||||||
BITCOIND_CONFIG=/var/lib/bitcoind/bitcoin.conf
|
|
||||||
|
|
||||||
function show_help() {
|
|
||||||
cat << END
|
|
||||||
Usage: ${0##*/} [-h] [-c CONF_FILE] [-n NETWORK] [GENESIS_BSQ_AMOUNT] [GENESIS_BSQ_DISTRIBUTION]
|
|
||||||
|
|
||||||
GENESIS_BSQ_AMOUNT
|
|
||||||
Total amount of BSQ to include in the genesis transaction (if not specified, will be prompted).
|
|
||||||
|
|
||||||
GENESIS_BSQ_DISTRIBUTION
|
|
||||||
Distribution of BSQ within the genesis transaction [bsq_amount:bsq_address,...] (if not specified, will be prompted).
|
|
||||||
|
|
||||||
-h --help
|
|
||||||
Display this help message and exit.
|
|
||||||
|
|
||||||
-c --conf <CONF_FILE>
|
|
||||||
Path to bitcoind configuration file (default is /var/lib/bitcoind/bitcoin.conf).
|
|
||||||
|
|
||||||
-n --network <NETWORK>
|
|
||||||
Bitcoin network [REGTEST|TESTNET] (default is REGTEST).
|
|
||||||
END
|
|
||||||
}
|
|
||||||
|
|
||||||
function read_input() {
|
|
||||||
while true; do
|
|
||||||
read input
|
|
||||||
if [[ ${input} =~ $1 ]]; then
|
|
||||||
echo "${input}"
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
echo >&2 "Invalid input, try again"
|
|
||||||
done
|
|
||||||
}
|
|
||||||
|
|
||||||
function generate_prevtx_json() {
|
|
||||||
json_file="prevtxs.json"
|
|
||||||
local tx_data=$1
|
|
||||||
local txid=$2
|
|
||||||
local vout=$(echo ${tx_data} | jq '.n')
|
|
||||||
local scriptPubkey=$(echo ${tx_data} | jq '.scriptPubKey.hex')
|
|
||||||
local amount=$(echo ${tx_data} | jq '.value')
|
|
||||||
echo -en "[{\n" > ${json_file}
|
|
||||||
echo -en " \"txid\": \"${txid}\",\n" >> ${json_file}
|
|
||||||
echo -en " \"vout\": ${vout},\n" >> ${json_file}
|
|
||||||
echo -en " \"scriptPubKey\": ${scriptPubkey},\n" >> ${json_file}
|
|
||||||
echo -en " \"amount\": ${amount}\n" >> ${json_file}
|
|
||||||
echo -en "}]\n" >> ${json_file}
|
|
||||||
}
|
|
||||||
|
|
||||||
function generate_privkeys_json() {
|
|
||||||
json_file="privatekeys.json"
|
|
||||||
local address=$1
|
|
||||||
local privkey=$(${BITCOIN_CLI} dumpprivkey ${address})
|
|
||||||
echo -en "[\"$privkey\"]\n" > ${json_file}
|
|
||||||
}
|
|
||||||
|
|
||||||
while (( $# )); do
|
|
||||||
case ${1:-} in
|
|
||||||
-h|-\?|--help)
|
|
||||||
show_help
|
|
||||||
exit
|
|
||||||
;;
|
|
||||||
-c|--conf)
|
|
||||||
if [[ -f "$2" ]]; then
|
|
||||||
BITCOIND_CONFIG=$2
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
echo "ERROR: Specified 'conf' file does not exist"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
-n|--network)
|
|
||||||
if [[ $2 =~ ^REGTEST|TESTNET$ ]]; then
|
|
||||||
BTC_NETWORK=$2
|
|
||||||
shift
|
|
||||||
else
|
|
||||||
echo "ERROR: Specified 'network' is not valid, must be REGTEST or TESTNET"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
;;
|
|
||||||
--) # End of all options
|
|
||||||
shift
|
|
||||||
break
|
|
||||||
;;
|
|
||||||
-?*)
|
|
||||||
printf "ERROR: Unknown option: %s\n" "$1"
|
|
||||||
exit 1
|
|
||||||
;;
|
|
||||||
*) # Default case; no more options, so break out of the loop
|
|
||||||
break
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ $1 =~ ^[0-9]+\.?[0-9]*$ ]]; then
|
|
||||||
GENESIS_BSQ_AMOUNT=$1
|
|
||||||
elif [[ "$1" ]]; then
|
|
||||||
echo "ERROR: Invalid BSQ amount"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $2 =~ ^([0-9]+\.?[0-9]*:B.+)(,[0-9]+\.?[0-9]*:B.+)*$ ]]; then
|
|
||||||
IFS=',' read -r -a GENESIS_BSQ_DISTRIBUTION <<< "$2"
|
|
||||||
elif [[ "$2" ]]; then
|
|
||||||
echo "ERROR: Invalid BSQ distribution format, must be [bsq_amount:bsq_address,...]"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
BITCOIN_CLI="bitcoin-cli -conf=${BITCOIND_CONFIG}"
|
|
||||||
BITCOIN_TX="bitcoin-tx -${BTC_NETWORK}"
|
|
||||||
|
|
||||||
${BITCOIN_CLI} getblockcount &>/dev/null
|
|
||||||
if [[ $? -eq 1 ]]; then
|
|
||||||
echo "ERROR: bitcoind must be running"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if (( $(echo "${GENESIS_BSQ_AMOUNT} == 0" | bc -l) )); then
|
|
||||||
echo "How much BSQ would you like to distribute in the genesis transaction?"
|
|
||||||
GENESIS_BSQ_AMOUNT=$(read_input "^[0-9]+\.?[0-9]*$")
|
|
||||||
fi
|
|
||||||
|
|
||||||
GENESIS_BTC_AMOUNT=$(awk "BEGIN {printf \"%.8f\",${GENESIS_BSQ_AMOUNT}/1000000.00}")
|
|
||||||
GENESIS_BTC_FUNDING_AMOUNT=$(awk "BEGIN {printf \"%.8f\",${GENESIS_BTC_AMOUNT}+0.0001}")
|
|
||||||
|
|
||||||
btc_balance=$(${BITCOIN_CLI} getbalance)
|
|
||||||
if (( $(echo "${btc_balance} < ${GENESIS_BTC_FUNDING_AMOUNT}" | bc -l) )); then
|
|
||||||
printf "ERROR: Insufficient balance; %'.8f BTC is required but only %'.8f BTC is available\n" ${GENESIS_BTC_FUNDING_AMOUNT} ${btc_balance}
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
distributed_bsq_amount=0
|
|
||||||
if [[ ${#GENESIS_BSQ_DISTRIBUTION[@]} -eq 0 ]]; then
|
|
||||||
printf "How many contributors would you like to include in the genesis transaction? (totaling %'.2f BSQ)\n" ${GENESIS_BSQ_AMOUNT}
|
|
||||||
contributor_count=$(read_input "^[0-9]+$")
|
|
||||||
for (( i = 1; i <= ${contributor_count}; ++i )); do
|
|
||||||
echo "Enter the BSQ address of contributor ${i}:"
|
|
||||||
bsq_address=$(read_input "^B.+$")
|
|
||||||
echo "Enter the amount of BSQ for contributor ${i}:"
|
|
||||||
bsq_amount=$(read_input "^[0-9]+\.?[0-9]*$")
|
|
||||||
GENESIS_BSQ_DISTRIBUTION+=("${bsq_amount}:${bsq_address}")
|
|
||||||
distributed_bsq_amount=$(awk "BEGIN {printf \"%.2f\",${distributed_bsq_amount}+${bsq_amount}}")
|
|
||||||
done
|
|
||||||
else
|
|
||||||
for item in "${GENESIS_BSQ_DISTRIBUTION[@]}"; do
|
|
||||||
bsq_amount="${item%%:*}"
|
|
||||||
distributed_bsq_amount=$(awk "BEGIN {printf \"%.2f\",${distributed_bsq_amount}+${bsq_amount}}")
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
if (( $(echo "${distributed_bsq_amount} != ${GENESIS_BSQ_AMOUNT}" | bc -l) )); then
|
|
||||||
printf "ERROR: The BSQ amount being distributed is %'.2f but must total %'.2f\n" ${distributed_bsq_amount} ${GENESIS_BSQ_AMOUNT}
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
genesis_input_address=$(${BITCOIN_CLI} getnewaddress "Genesis funding address")
|
|
||||||
printf "Sending %'.8f BTC to genesis funding address ${genesis_input_address}\n" ${GENESIS_BTC_FUNDING_AMOUNT}
|
|
||||||
genesis_input_txid=$(${BITCOIN_CLI} sendtoaddress ${genesis_input_address} ${GENESIS_BTC_FUNDING_AMOUNT})
|
|
||||||
echo "Genesis funding txid is ${genesis_input_txid}"
|
|
||||||
|
|
||||||
echo "Creating genesis transaction"
|
|
||||||
tx_hex=$(${BITCOIN_CLI} gettransaction ${genesis_input_txid} | jq '.hex'|tr -d '"')
|
|
||||||
vin_json=$(${BITCOIN_CLI} decoderawtransaction ${tx_hex} | jq ".vout | map(select(.value==${GENESIS_BTC_FUNDING_AMOUNT}))[0]" | tr -d "[ \n\t]")
|
|
||||||
vout=$(echo ${vin_json}|jq '.n')
|
|
||||||
|
|
||||||
generate_prevtx_json ${vin_json} ${genesis_input_txid}
|
|
||||||
generate_privkeys_json ${genesis_input_address}
|
|
||||||
|
|
||||||
outaddr=
|
|
||||||
for item in "${GENESIS_BSQ_DISTRIBUTION[@]}"; do
|
|
||||||
bsq_amount="${item%%:*}"
|
|
||||||
btc_amount="$(awk "BEGIN {printf \"%.8f\",${bsq_amount}/1000000.00}")"
|
|
||||||
bsq_address="${item##*:}"
|
|
||||||
outaddr="${outaddr}outaddr=${btc_amount}:${bsq_address##B} "
|
|
||||||
done
|
|
||||||
|
|
||||||
genesis_raw=$(${BITCOIN_TX} -create in=${genesis_input_txid}:${vout} ${outaddr} load=prevtxs:prevtxs.json load=privatekeys:privatekeys.json sign=ALL)
|
|
||||||
echo "The raw genesis transaction is $genesis_raw"
|
|
||||||
|
|
||||||
echo "Decoded transaction:"
|
|
||||||
genesis_decoded=$(${BITCOIN_CLI} decoderawtransaction ${genesis_raw})
|
|
||||||
echo ${genesis_decoded}| jq '.'
|
|
||||||
genesis_txid=$(echo ${genesis_decoded}| jq '.txid'|tr -d '"')
|
|
||||||
|
|
||||||
echo "Please ensure the above decoded transaction looks valid, and then press Enter to broadcast the genesis transaction (Ctrl+C otherwise)"
|
|
||||||
read
|
|
||||||
echo "Genesis txid is $(${BITCOIN_CLI} sendrawtransaction ${genesis_raw})"
|
|
Loading…
Reference in New Issue
Block a user