diff --git a/client/asset/firo/firo.go b/client/asset/firo/firo.go index 0a1eac740d..107272ac08 100644 --- a/client/asset/firo/firo.go +++ b/client/asset/firo/firo.go @@ -153,7 +153,7 @@ func NewWallet(cfg *asset.WalletConfig, logger dex.Logger, network dex.Network) Segwit: false, InitTxSize: dexbtc.InitTxSize, InitTxSizeBase: dexbtc.InitTxSizeBase, - LegacyBalance: true, + LegacyBalance: false, // set true only for walletTypeRPC below LegacyRawFeeLimit: true, // sendrawtransaction Has single arg allowhighfees ArglessChangeAddrRPC: true, // getrawchangeaddress has No address-type arg OmitAddressType: true, // getnewaddress has No address-type arg @@ -171,6 +171,7 @@ func NewWallet(cfg *asset.WalletConfig, logger dex.Logger, network dex.Network) switch cfg.Type { case walletTypeRPC, walletTypeLegacy: + cloneCFG.LegacyBalance = true var exw *btc.ExchangeWalletFullNode // override PrivKeyFunc - we Do need our own Firo dumpprivkey fn cloneCFG.PrivKeyFunc = func(addr string) (*btcec.PrivateKey, error) { diff --git a/dex/testing/firo/README_ELECTRUM_HARNESSES.md b/dex/testing/firo/README_ELECTRUM_HARNESSES.md index 130ff4116a..e01183f21c 100644 --- a/dex/testing/firo/README_ELECTRUM_HARNESSES.md +++ b/dex/testing/firo/README_ELECTRUM_HARNESSES.md @@ -104,6 +104,9 @@ this point. A prepared, empty but encrypted electrum wallet is copied to the electrum data directory at **~/dextest/electrum/firo/client/wallet/regtest/wallets** directory. +By default the electrum client is started as a daemon and the default wallet is loaded. +Use **stop-daemon** script to stop the daemon. + The electrum client wallet will connect to the firo electrumX daemon. ### Simnet Trade Testing diff --git a/dex/testing/firo/electrum.sh b/dex/testing/firo/electrum.sh index 9596b8feea..aaa4f03a71 100755 --- a/dex/testing/firo/electrum.sh +++ b/dex/testing/firo/electrum.sh @@ -34,6 +34,12 @@ REPO_DIR=${ELECTRUM_DIR}/electrum-repo WALLET_DIR=${ELECTRUM_DIR}/wallet NET_DIR=${WALLET_DIR}/regtest +# startup options (Default start as a daemon) +# Uncomment this line to start with gui +#START_WITH_GUI="1" +ELECTRUM_REGTEST_ARGS="--regtest --dir=${WALLET_DIR}" +WALLET_PASSWORD="abc" + rm -rf ${NET_DIR}/blockchain_headers ${NET_DIR}/forks ${NET_DIR}/certs ${NET_DIR}/wallets/default_wallet mkdir -p ${NET_DIR}/regtest mkdir -p ${NET_DIR}/wallets @@ -59,7 +65,11 @@ source ${ELECTRUM_DIR}/venv/bin/activate python --version python -m pip install --upgrade pip # can support more versions than ensurepip pip install -e . -pip install requests cryptography pycryptodomex pyqt5 +pip install requests cryptography pycryptodomex +if [ -n "$START_WITH_GUI" ]; +then + pip install pyqt5 +fi cp "${SCRIPT_DIR}/electrum_regtest_wallet" "${NET_DIR}/wallets/default_wallet" @@ -100,4 +110,13 @@ rpcpassword=pass rpcbind=127.0.0.1:${RPCPORT} EOF -./electrum-firo --regtest --dir=${WALLET_DIR} \ No newline at end of file +if [ -n "$START_WITH_GUI" ]; +then + ./electrum-firo ${ELECTRUM_REGTEST_ARGS} +else + ./electrum-firo ${ELECTRUM_REGTEST_ARGS} daemon --detach + ./electrum-firo ${ELECTRUM_REGTEST_ARGS} load_wallet --password=${WALLET_PASSWORD} + ./electrum-firo ${ELECTRUM_REGTEST_ARGS} list_wallets + ./electrum-firo ${ELECTRUM_REGTEST_ARGS} getinfo + echo "use 'stop_daemon.sh' to stop the daemon" +fi \ No newline at end of file diff --git a/dex/testing/firo/stop-daemon b/dex/testing/firo/stop-daemon new file mode 100755 index 0000000000..5857f944d4 --- /dev/null +++ b/dex/testing/firo/stop-daemon @@ -0,0 +1,5 @@ +#!/bin/bash + +curl --data-binary \ + '{"jsonrpc":"2.0","id":"curltext","method":"stop","params":[]}' \ + http://user:pass@127.0.0.1:8001