diff --git a/basicswap/chainparams.py b/basicswap/chainparams.py index c1ce0ef..57163f3 100644 --- a/basicswap/chainparams.py +++ b/basicswap/chainparams.py @@ -31,6 +31,8 @@ class Coins(IntEnum): LTC_MWEB = 15 # ZANO = 16 BCH = 17 + GHOST = 18 + GHOST_ANON = 19 chainparams = { @@ -478,6 +480,47 @@ chainparams = { "max_amount": 10000000 * COIN, }, }, + + Coins.GHOST: { + "name": "ghost", + "ticker": "GHOST", + "message_magic": "Bitcoin Signed Message:\n", + "blocks_target": 60 * 2, + "decimal_places": 8, + "mainnet": { + "rpcport": 51728, + "pubkey_address": 0x26, + "script_address": 0x61, + "key_prefix": 0xA6, + "stealth_key_prefix": 0x14, + "hrp": "gw", + "bip44": 44, + "min_amount": 100000, + "max_amount": 10000000 * COIN, + }, + "testnet": { + "rpcport": 51928, + "pubkey_address": 0x4B, + "script_address": 0x89, + "key_prefix": 0x2E, + "stealth_key_prefix": 0x14, + "hrp": "tpw", + "bip44": 1, + "min_amount": 100000, + "max_amount": 10000000 * COIN, + }, + "regtest": { + "rpcport": 51936, + "pubkey_address": 0x76, + "script_address": 0x7A, + "key_prefix": 0x2E, + "stealth_key_prefix": 0x15, + "hrp": "rtpw", + "bip44": 1, + "min_amount": 100000, + "max_amount": 10000000 * COIN, + }, + }, } ticker_map = {} diff --git a/basicswap/config.py b/basicswap/config.py index 2ee7648..34e8cd4 100644 --- a/basicswap/config.py +++ b/basicswap/config.py @@ -49,4 +49,13 @@ XMR_BINDIR = os.path.expanduser( XMRD = os.getenv("XMRD", "monerod" + bin_suffix) XMR_WALLET_RPC = os.getenv("XMR_WALLET_RPC", "monero-wallet-rpc" + bin_suffix) + +GHOST_BINDIR = os.path.expanduser( + os.getenv("GHOST_BINDIR", os.path.join(DEFAULT_TEST_BINDIR, "ghost")) +) + +GHOSTD = os.getenv("GHOSTD", "ghostd" + bin_suffix) +GHOST_CLI = os.getenv("GHOST_CLI", "GHOST-cli" + bin_suffix) +GHOST_TX = os.getenv("GHOST_TX", "ghost-tx" + bin_suffix) + # NOTE: Adding coin definitions here is deprecated. Please add in coin test file. diff --git a/basicswap/static/images/coins/Ghost-20.png b/basicswap/static/images/coins/Ghost-20.png new file mode 100644 index 0000000..3895e20 Binary files /dev/null and b/basicswap/static/images/coins/Ghost-20.png differ diff --git a/basicswap/static/images/coins/Ghost.png b/basicswap/static/images/coins/Ghost.png new file mode 100644 index 0000000..3895e20 Binary files /dev/null and b/basicswap/static/images/coins/Ghost.png differ diff --git a/docker/production/compose-fragments/1_ghost.yml b/docker/production/compose-fragments/1_ghost.yml new file mode 100644 index 0000000..a602b87 --- /dev/null +++ b/docker/production/compose-fragments/1_ghost.yml @@ -0,0 +1,16 @@ + ghost_core: + image: i_ghost + build: + context: ghost + dockerfile: Dockerfile + container_name: ghost_core + volumes: + - ${DATA_PATH}/ghost-core:/data + expose: + - ${WOW_RPC_PORT} + logging: + driver: "json-file" + options: + max-size: "10m" + max-file: "3" + restart: unless-stopped diff --git a/docker/production/example.env b/docker/production/example.env index f451d38..fa13f47 100644 --- a/docker/production/example.env +++ b/docker/production/example.env @@ -78,3 +78,11 @@ BCH_RPC_HOST=bitcoincash_core BCH_RPC_PORT=19797 BCH_RPC_USER=bitcoincash_user BCH_RPC_PWD=bitcoincash_pwd + + +GHOST_DATA_DIR=/data/ghost +GHOST_RPC_HOST=ghost_core +GHOST_RPC_PORT=51728 +GHOST_ZMQ_PORT=20792 +GHOST_RPC_USER=ghost_user +GHOST_RPC_PWD=ghost_pwd \ No newline at end of file diff --git a/docker/production/ghost/Dockerfile b/docker/production/ghost/Dockerfile new file mode 100644 index 0000000..5d79ffd --- /dev/null +++ b/docker/production/ghost/Dockerfile @@ -0,0 +1,25 @@ +FROM i_swapclient as install_stage + +RUN basicswap-prepare --preparebinonly --bindir=/coin_bin --withcoin=ghost,particl && \ + find /coin_bin -name *.tar.gz -delete + +FROM debian:bullseye-slim +COPY --from=install_stage /coin_bin . + +ENV GHOST_DATA /data + +RUN groupadd -r ghost && useradd -r -m -g ghost ghost \ + && apt-get update \ + && apt-get install -qq --no-install-recommends gosu \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir -p "$GHOST_DATA" \ + && chown -R ghost:ghost "$GHOST_DATA" \ + && ln -sfn "$GHOST_DATA" /home/ghost/.ghost \ + && chown -h ghost:ghost /home/ghost/.ghost +VOLUME /data + +COPY entrypoint.sh /entrypoint.sh +ENTRYPOINT ["/entrypoint.sh"] + +EXPOSE 51735 20792 51738 +CMD ["/ghost/ghostd", "--datadir=/data"] diff --git a/docker/production/ghost/entrypoint.sh b/docker/production/ghost/entrypoint.sh new file mode 100755 index 0000000..609856f --- /dev/null +++ b/docker/production/ghost/entrypoint.sh @@ -0,0 +1,11 @@ +#!/bin/bash +set -e + +if [[ "$1" == "ghost-cli" || "$1" == "ghost-tx" || "$1" == "ghostd" || "$1" == "test_ghost" ]]; then + mkdir -p "$ghost_DATA" + + chown -h ghost:ghost /home/ghost/.ghost + exec gosu ghost "$@" +else + exec "$@" +fi