blocknet icon indicating copy to clipboard operation
blocknet copied to clipboard

[feature] move critical settings from xbridge.conf to a different file

Open rikublock opened this issue 4 years ago • 1 comments

xbridge.conf currently contains a variety of options/settings. However, many of these settings are very specific to a blockchain and should only have a very distinct value. The current setup isn't very user-friendly as miss-configuring these settings can lead to all sorts of problems and bugs. Given that many (end) users do not understand these settings, they would very likely depend on some pre-configured template. Therefore, it is proposed to split off the critical settings from the xbridge.conf and move them to a new, developer reviewed and well maintained coin configuration file, which can then be shipped with blocknet releases.

Example of a coin section in xbridge.conf:

[SYS]
Title=Syscoin
Ip=127.0.0.1
Port=8370
AddressPrefix=63
ScriptPrefix=5
SecretPrefix=128
COIN=100000000
MinimumAmount=0
TxVersion=1
DustAmount=0
CreateTxMethod=BTC
MinTxFee=5000
BlockTime=60
GetNewKeySupported=true
ImportWithNoScanSupported=true
FeePerByte=10
Confirmations=0
Username=BlockDXSyscoin
Password=XXX
Address=
TxWithTimeField=false
LockCoinsSupported=false
JSONVersion=
ContentType=
CashAddrPrefix=

At least the following settings should be moved:

AddressPrefix=63
ScriptPrefix=5
SecretPrefix=128
COIN=100000000
MinimumAmount=0
TxVersion=1
DustAmount=0
CreateTxMethod=BTC
BlockTime=60

Such a coin configuration file would have the additional benefit of being sharable between projects like Blocknet Core, XLite or Block-DX (those need/have similar coin configs).

Support for new coins could still be added with pull requests.

rikublock avatar Oct 08 '21 14:10 rikublock

So you think Blocknet should ship all the the variety of xbridge configurations for every supported wallet version with?

I agree this configuration is not very user friendly and should not be edited by ordinary users(end non IT users).

But for end GUI users BlockDX should do the job.

What i I think was missing, so I was working on tool, that would help to configure and manage variety of wallet versions completely from scratch i mean build from source code on any arch up to configured xbridge+wallets config settings, whole process by editing ZERO/NONE file.

This tool allows also devs easy to share any custom wallet configuration easy and working like a charm. Also in comparison with docker, this system is using firejail sandbox, and all FS files, GUI, APP System calls, strace, debug whatever acting like native app not an image, but isolated. With this system is developer able to run native binary instead of isolated firejail, just by un-comment firejail lines in generated run script. Also dev could copy paste custom wallet configuration, edit and in few minutes running and configured another version in parallel.

Im still waiting for proposal, here is link with readme how to be used https://github.com/nnmfnwl7/cc.setup.helper.debian

This looks ie custom BTC config, one place, just edit, share, use, whatever done.

cc_setup_helper_version="20210827"

cc_ticker="BTC"
cc_bin_file_name_prefix="bitcoin"
cc_gui_cfg_dir_name="Bitcoin"

cc_install_dir_path_default="~/Downloads/ccwallets/bitcoin"
cc_chain_dir_path_default="~/.bitcoin"
cc_wallet_name_default="wallet_btc"
cc_conf_name_default="bitcoin.conf"


export CC=clang
export CXX=clang++

cc_firejail_make_args=''

cc_firejail_profile_add=''

cc_git_src_url="https://github.com/bitcoin/bitcoin.git"
cc_git_src_branch="v0.20.2"
cc_git_commit_id="29e129ab6bb03f595e9c4fd89fa701c0159441f2"

cc_make_cpu_threads=4

cc_make_depends="bdb"

cc_command_configure='
./configure --quiet
LDFLAGS="-L`pwd`/depends/${cc_archdir}/lib/"
CPPFLAGS="-I`pwd`/depends/${cc_archdir}/include/"
CXXFLAGS="-O3 -march=native"
--disable-bench --disable-gui-tests --disable-tests
--enable-reduce-exports --without-miniupnpc --without-zmq
--with-gui=auto
'

# HINT >> add to above configure parameter to compile with debug symbols >>
# --enable-debug

cc_command_pre_make='
'
# conf file will scanned and comment existing conflist lines
# config to add be be line by line evaluated and added

cc_port=8333
cc_rpcport=8332
cc_rpcuser="BlockDXBitcoin"
cc_rpcpassword=`cat /dev/urandom | tr -dc "a-zA-Z0-9" | fold -w 32 | head -n 1`

# lines will eval before add
cc_main_cfg_add='
server=1
listen=1
rpcbind=127.0.0.1
rpcallowip=127.0.0.1
port=${cc_port}
rpcport=${cc_rpcport}
rpcuser=${cc_rpcuser}
rpcpassword=${cc_rpcpassword}
txindex=1

addresstype=legacy
changetype=legacy

bantime=180
'

cc_xbridge_cfg_add='
Title=Bitcoin
Ip=127.0.0.1
Port=${cc_rpcport}
AddressPrefix=0
ScriptPrefix=5
SecretPrefix=128
COIN=100000000
MinimumAmount=0
TxVersion=2
DustAmount=0
CreateTxMethod=BTC
MinTxFee=12000
BlockTime=600
GetNewKeySupported=false
ImportWithNoScanSupported=false
FeePerByte=60
Confirmations=0
Username=${cc_rpcuser}
Password=${cc_rpcpassword}
Address=
TxWithTimeField=false
LockCoinsSupported=false
JSONVersion=
ContentType=
CashAddrPrefix=
'

Tool that could be used not only by Blocknet developers/traders/liquidity providers/end users.

nnmfnwl7 avatar Nov 16 '21 06:11 nnmfnwl7