decred.org/dcrdex@v1.0.5/dex/testing/firo/electrumx.sh (about)

     1  #!/usr/bin/env bash
     2  #
     3  # Set up ElectrumX-Firo (electrumX) regtest server for testing.
     4  # - Expects the firo regtest chain harness to be running and listening
     5  #   for RPC's on harness.sh ALPHA_RPC_PORT="53768"
     6  # - Exposes default RPC port at localhost:8000
     7  # - Exposes wallet SSL connection service at localhost:50002
     8  #
     9  # Requires:
    10  # - python3  - tested python3.10 and minimal testing python3.7
    11  # - pip3     - for boostrap loading pip
    12  # - gencerts - go install github.com/decred/dcrd/cmd/gencerts@release-v1.7
    13  # - git
    14  #
    15  # See Also: README_ELECTRUM_HARNESSES.md and README_HARNESS.md
    16  
    17  set -ex
    18  
    19  # No external releases - just master
    20  # May 11, 2023
    21  # COMMIT=c0cdcc0dfcaa057058fd1ed281557dede924cd27
    22  #  Jul 8, 2024
    23  COMMIT=937e4bb3d8802317b64231844b698d8758029ca5
    24  
    25  ELECTRUMX_DIR=~/dextest/electrum/firo/server
    26  REPO_DIR=${ELECTRUMX_DIR}/electrumx-repo
    27  DATA_DIR=${ELECTRUMX_DIR}/data
    28  rm -rf ${DATA_DIR}
    29  mkdir -p ${REPO_DIR} ${DATA_DIR}
    30  
    31  cd ${REPO_DIR}
    32  
    33  if [ ! -d "${REPO_DIR}/.git" ]; then
    34      git init
    35      git remote add origin https://github.com/firoorg/electrumx-firo.git
    36  fi
    37  
    38  git remote -v
    39  
    40  git fetch --depth 1 origin ${COMMIT}
    41  git reset --hard FETCH_HEAD
    42  
    43  if [ ! -d "${ELECTRUMX_DIR}/venv" ]; then
    44      python3 -m venv ${ELECTRUMX_DIR}/venv
    45  fi
    46  source ${ELECTRUMX_DIR}/venv/bin/activate
    47  python -m ensurepip --upgrade
    48  pip install .
    49  
    50  gencerts -L ${DATA_DIR}/ssl.cert ${DATA_DIR}/ssl.key
    51  
    52  set +x
    53  
    54  # Server Config
    55  export COIN="Firo"
    56  export NET="regtest"
    57  export DB_ENGINE="leveldb"
    58  export DB_DIRECTORY="${DATA_DIR}"
    59  export DAEMON_URL="http://user:pass@127.0.0.1:53768"    # harness:alpha:rpc
    60  export SERVICES="ssl://localhost:50002,tcp://localhost:50001,rpc://"
    61  export SSL_CERTFILE="${DATA_DIR}/ssl.cert"
    62  export SSL_KEYFILE="${DATA_DIR}/ssl.key"
    63  export PEER_DISCOVERY="off"
    64  export PEER_ANNOUNCE=
    65  export LOG_LEVEL=DEBUG
    66  
    67  ./electrumx_server