diff --git a/apps/elements/data/.gitkeep b/apps/elements/data/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/apps/elements/docker-compose.yml b/apps/elements/docker-compose.yml new file mode 100644 index 0000000..0129079 --- /dev/null +++ b/apps/elements/docker-compose.yml @@ -0,0 +1,56 @@ +version: "3.8" + +services: + node: + image: ghcr.io/vulpemventures/elements:0.21.0.2@sha256:60f082b13b366743ef3cd113cb20397b586fd7032c0eb9c0a2a242ebc528f537 + restart: on-failure + stop_grace_period: 1m + ports: + - $APP_ELEMENTS_NODE_RPC_PORT:$APP_ELEMENTS_NODE_RPC_PORT # JSONRPC + - $APP_ELEMENTS_NODE_P2P_PORT:$APP_ELEMENTS_NODE_P2P_PORT # P2P PORT + volumes: + - ${APP_DATA_DIR}/data:/home/elements/.elements + command: + - -listen=1 + - -txindex=1 + - -validatepegin=1 + - -fallbackfee=0.000001 + # Attach to Bitcoin network + - -mainchainrpchost=$BITCOIN_IP + - -mainchainrpcport=$BITCOIN_RPC_PORT + - -mainchainrpcuser=$BITCOIN_RPC_USER + - -mainchainrpcpassword=$BITCOIN_RPC_PASS + # Elements RPC + - -rpcuser=elements + - -rpcpassword=$APP_PASSWORD + - -rpcbind=0.0.0.0 # can we do better here? + - -rpcallowip=0.0.0.0/0 # can we do better here? + - -rpcport=$APP_ELEMENTS_NODE_RPC_PORT + # P2P + - -port=$APP_ELEMENTS_NODE_P2P_PORT + - -blockfilterindex=1 + - -peerblockfilters=1 + networks: + default: + ipv4_address: $APP_ELEMENTS_NODE_IP + web: + image: ghcr.io/tiero/elements-web:v0.0.3@sha256:b80dc0df2a4693668a97b874aad6d0a8d3239d03f4d05b4342600166934d0b87 + depends_on: + - node + restart: on-failure + ports: + - $APP_ELEMENTS_PORT:8080 + environment: + RPC_USER: elements + RPC_PASS: $APP_PASSWORD + RPC_PORT: $APP_ELEMENTS_NODE_RPC_PORT + RPC_HOST: $APP_ELEMENTS_NODE_IP + P2P_PORT: $APP_ELEMENTS_NODE_P2P_PORT + # Remote + REMOTE_RPC_HOST: $ELEMENTS_RPC_HIDDEN_SERVICE + REMOTE_P2P_HOST: $ELEMENTS_P2P_HIDDEN_SERVICE + networks: + default: + ipv4_address: $APP_ELEMENTS_IP + + diff --git a/apps/registry.json b/apps/registry.json index 4bef997..b593933 100644 --- a/apps/registry.json +++ b/apps/registry.json @@ -1064,5 +1064,29 @@ "path": "", "deterministicPassword": true, "torOnly": false + }, + { + "id": "elements", + "category": "Wallet Servers", + "name": "Elements Core", + "version": "v0.21.0.2", + "tagline": "Liquid Network full node", + "description": "Elements is an open source full node implementation to run the Liquid Network, a Bitcoin layer-2 solution enabling the fast, confidential settlement and issuance of digital assets, such as stablecoins, security tokens, and other financial instruments, on top of the Bitcoin timechain.", + "developer": "Elements Core Developers", + "website": "https://elementsproject.org", + "dependencies": [ + "bitcoind" + ], + "repo": "https://github.com/ElementsProject/elements", + "support": "https://t.me/liquid_community", + "port": 3042, + "gallery": [ + "1.jpg", + "2.jpg", + "3.jpg" + ], + "path": "", + "deterministicPassword": false, + "torOnly": false } ] diff --git a/scripts/app b/scripts/app index 4da9a3a..6322ca7 100755 --- a/scripts/app +++ b/scripts/app @@ -125,6 +125,8 @@ compose() { local whirlpool_hidden_service_file="${UMBREL_ROOT}/tor/data/app-${app}-whirlpool/hostname" local squeaknode_p2p_hidden_service_file="${UMBREL_ROOT}/tor/data/app-${app}-p2p/hostname" local suredbits_wallet_p2p_hidden_service_file="${UMBREL_ROOT}/tor/data/app-${app}-p2p/hostname" + local elements_rpc_hidden_service_file="${UMBREL_ROOT}/tor/data/app-${app}-rpc/hostname" + local elements_p2p_hidden_service_file="${UMBREL_ROOT}/tor/data/app-${app}-p2p/hostname" export SAMOURAI_SERVER_DOJO_HIDDEN_SERVICE="$(cat "${dojo_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" export SAMOURAI_SERVER_WHIRLPOOL_HIDDEN_SERVICE="$(cat "${whirlpool_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" export SAMOURAI_SERVER_NODE_API_KEY=$(derive_entropy "env-${app_entropy_identifier}-NODE_API_KEY") @@ -133,6 +135,8 @@ compose() { export SAMOURAI_SERVER_WHIRLPOOL_API_KEY=$(derive_entropy "env-${app_entropy_identifier}-WHIRLPOOL_API_KEY") export SQUEAKNODE_P2P_HIDDEN_SERVICE="$(cat "${squeaknode_p2p_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" export SUREDBITS_WALLET_P2P_HIDDEN_SERVICE="$(cat "${suredbits_wallet_p2p_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" + export ELEMENTS_RPC_HIDDEN_SERVICE="$(cat "${elements_rpc_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" + export ELEMENTS_P2P_HIDDEN_SERVICE="$(cat "${elements_p2p_hidden_service_file}" 2>/dev/null || echo "notyetset.onion")" docker-compose \ --env-file "${env_file}" \ diff --git a/scripts/configure b/scripts/configure index 5e561e5..908fb06 100755 --- a/scripts/configure +++ b/scripts/configure @@ -262,6 +262,11 @@ APP_AGORA_SERVER_IP="10.21.21.88" APP_AGORA_FILEBROWSER_IP="10.21.21.89" APP_SPARKKIOSK_IP="10.21.21.90" APP_SPARKKIOSK_PORT="21214" +APP_ELEMENTS_PORT="3042" +APP_ELEMENTS_IP="10.21.21.91" +APP_ELEMENTS_NODE_IP="10.21.21.92" +APP_ELEMENTS_NODE_RPC_PORT="7041" +APP_ELEMENTS_NODE_P2P_PORT="18332" # Generate RPC credentials if [[ -z ${BITCOIN_RPC_USER+x} ]] || [[ -z ${BITCOIN_RPC_PASS+x} ]] || [[ -z ${BITCOIN_RPC_AUTH+x} ]]; then @@ -524,6 +529,11 @@ for template in "${NGINX_CONF_FILE}" "${BITCOIN_CONF_FILE}" "${LND_CONF_FILE}" " sed -i "s//${APP_AGORA_FILEBROWSER_IP}/g" "${template}" sed -i "s//${APP_SPARKKIOSK_IP}/g" "${template}" sed -i "s//${APP_SPARKKIOSK_PORT}/g" "${template}" + sed -i "s//${APP_ELEMENTS_PORT}/g" "${template}" + sed -i "s//${APP_ELEMENTS_IP}/g" "${template}" + sed -i "s//${APP_ELEMENTS_NODE_IP}/g" "${template}" + sed -i "s//${APP_ELEMENTS_NODE_RPC_PORT}/g" "${template}" + sed -i "s//${APP_ELEMENTS_NODE_P2P_PORT}/g" "${template}" done ########################################################## diff --git a/templates/.env-sample b/templates/.env-sample index 0aadf3e..ed04312 100644 --- a/templates/.env-sample +++ b/templates/.env-sample @@ -159,4 +159,9 @@ APP_AGORA_PORT= APP_AGORA_SERVER_IP= APP_AGORA_FILEBROWSER_IP= APP_SPARKKIOSK_IP= -APP_SPARKKIOSK_PORT= \ No newline at end of file +APP_SPARKKIOSK_PORT= +APP_ELEMENTS_PORT= +APP_ELEMENTS_IP= +APP_ELEMENTS_NODE_IP= +APP_ELEMENTS_NODE_RPC_PORT= +APP_ELEMENTS_NODE_P2P_PORT= diff --git a/templates/torrc-server-sample b/templates/torrc-server-sample index 9ada665..cc3bff1 100644 --- a/templates/torrc-server-sample +++ b/templates/torrc-server-sample @@ -232,4 +232,16 @@ HiddenServicePort 80 :80 # sparkkiosk Hidden Service HiddenServiceDir /data/app-sparkkiosk -HiddenServicePort 80 :21214 \ No newline at end of file +HiddenServicePort 80 :21214 + +# elements Hidden Service +HiddenServiceDir /data/app-elements +HiddenServicePort 80 :8080 + +# elements rpc Hidden Service +HiddenServiceDir /data/app-elements-rpc +HiddenServicePort : + +# elements p2p Hidden Service +HiddenServiceDir /data/app-elements-p2p +HiddenServicePort :