Browse Source

Update samourai-server app to v1.11.0 (#991)

Co-authored-by: Luke Childs <lukechilds123@gmail.com>
finance
Lounès Ksouri 3 years ago
committed by GitHub
parent
commit
9746ce033c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/registry.json
  2. 9
      apps/samourai-server/docker-compose.yml
  3. 203
      apps/samourai-server/mysql/db-scripts/1_db.sql
  4. 11
      apps/samourai-server/mysql/mysql-dojo.cnf
  5. 14
      apps/samourai-server/mysql/update-db.sh
  6. 8
      scripts/update/01-run.sh
  7. 3
      templates/bitcoin-sample.conf

2
apps/registry.json

@ -271,7 +271,7 @@
"id": "samourai-server",
"category": "Wallet Servers",
"name": "Samourai Server",
"version": "1.10.1",
"version": "1.11.0",
"tagline": "Your private backing server for Samourai Wallet",
"description": "Samourai Server is an exclusive Umbrel app that runs Samourai Dojo and Whirlpool backing servers, and provides you easy step-by-step instructions to connect your Samourai Wallet to them. Samourai Wallet is unrivaled in transaction privacy, but its default configuration is still subject to network level privacy loss.\n\nBy default, Samourai Wallet will connect to its centrally controlled Dojo hosted in Iceland. By hosting your own Samourai Server, you can bypass its servers completely when using Samourai Wallet or Sentinel, and gain total financial sovereignty without any complexity.\n\nBundles Whirlpool CLI v0.10.11.",
"developer": "Samourai",

9
apps/samourai-server/docker-compose.yml

@ -2,7 +2,7 @@ version: "3.7"
services:
db:
image: mariadb:10.5.12@sha256:dfcba5641bdbfd7cbf5b07eeed707e6a3672f46823695a0d3aba2e49bbd9b1dd
image: louneskmt/dojo-db:1.3.0-low-mem@sha256:6ca2bb6a3f0861abf1b5c9df7c4b6e85d13c3bf697fe81ea8d3d0d861116fe3b
init: true
restart: on-failure
stop_grace_period: 5m
@ -14,15 +14,12 @@ services:
MYSQL_PASSWORD: password
volumes:
- ${APP_DATA_DIR}/mysql/data:/var/lib/mysql
- ${APP_DATA_DIR}/mysql/db-scripts:/docker-entrypoint-initdb.d
- ${APP_DATA_DIR}/mysql/mysql-dojo.cnf:/etc/mysql/conf.d/mysql-dojo.cnf
- ${APP_DATA_DIR}/mysql/update-db.sh:/update-db.sh
networks:
default:
ipv4_address: $APP_SAMOURAI_SERVER_DB_IP
node:
image: louneskmt/dojo-nodejs:1.10.1@sha256:d1460df18df091837718fcd0a6d3850e2f1a4a49da5914a697648c40d5477184
image: louneskmt/dojo-nodejs:1.11.0@sha256:6d2102a4f75a60f7cf29e4aea00e0e713cd7b5423d8b29b541591daa19c22d42
init: true
restart: on-failure
command: "/home/node/app/wait-for-it.sh ${APP_SAMOURAI_SERVER_DB_IP}:3306 --timeout=720 --strict -- /home/node/app/restart.sh"
@ -30,7 +27,7 @@ services:
environment:
# GLOBAL
COMMON_BTC_NETWORK: $BITCOIN_NETWORK
DOJO_NODEJS_VERSION_TAG: 1.10.1
DOJO_NODEJS_VERSION_TAG: 1.11.0
NET_DOJO_TOR_IPV4: $TOR_PROXY_IP
NET_DOJO_TOR_PORT: $TOR_PROXY_PORT
NET_DOJO_MYSQL_IPV4: $APP_SAMOURAI_SERVER_DB_IP

203
apps/samourai-server/mysql/db-scripts/1_db.sql

@ -1,203 +0,0 @@
# Database tables
# Copyright © 2019 – Katana Cryptographic Ltd. All Rights Reserved.
# Naming conventions
# 1. Table names are lowercase plural
# 2. Join table names are snake_case plural
# 3. Column names have a table prefix
# 4. Foreign key names match primary key of foreign table
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `addresses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `addresses` (
`addrID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`addrAddress` varchar(74) DEFAULT NULL,
PRIMARY KEY (`addrID`),
UNIQUE KEY `addrAddress` (`addrAddress`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `banned_addresses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `banned_addresses` (
`bannedAddressId` int(11) NOT NULL AUTO_INCREMENT,
`addrAddress` varchar(35) NOT NULL,
PRIMARY KEY (`bannedAddressId`),
UNIQUE KEY `banned_addresses_addresses` (`addrAddress`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `blocks`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `blocks` (
`blockID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`blockHash` char(64) NOT NULL DEFAULT '',
`blockParent` int(10) unsigned DEFAULT NULL,
`blockHeight` int(10) unsigned NOT NULL DEFAULT '0',
`blockTime` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`blockID`),
UNIQUE KEY `blockHash` (`blockHash`),
KEY `blockParent` (`blockParent`),
KEY `blockHeight` (`blockHeight`),
CONSTRAINT `blocks_ibfk_1` FOREIGN KEY (`blockParent`) REFERENCES `blocks` (`blockID`) ON DELETE SET NULL ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `hd`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `hd` (
`hdID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`hdXpub` char(112) DEFAULT NULL,
`hdCreated` int(10) unsigned NOT NULL DEFAULT '0',
`hdType` smallint(5) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`hdID`),
UNIQUE KEY `hdXpub` (`hdXpub`),
KEY `hdCreated` (`hdCreated`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `hd_addresses`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `hd_addresses` (
`hdAddrID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`hdID` int(10) unsigned NOT NULL DEFAULT '0',
`addrID` int(10) unsigned NOT NULL DEFAULT '0',
`hdAddrChain` smallint(5) unsigned NOT NULL DEFAULT '0',
`hdAddrIndex` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`hdAddrID`),
UNIQUE KEY `hdID_2` (`hdID`,`addrID`),
KEY `hdID` (`hdID`),
KEY `addrID` (`addrID`),
CONSTRAINT `hd_addresses_ibfk_1` FOREIGN KEY (`hdID`) REFERENCES `hd` (`hdID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `hd_addresses_ibfk_2` FOREIGN KEY (`addrID`) REFERENCES `addresses` (`addrID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `inputs`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `inputs` (
`inID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`outID` int(10) unsigned NOT NULL DEFAULT '0',
`txnID` int(10) unsigned NOT NULL DEFAULT '0',
`inIndex` int(10) unsigned NOT NULL DEFAULT '0',
`inSequence` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`inID`),
UNIQUE KEY `txnID_2` (`txnID`,`inIndex`),
KEY `outID` (`outID`),
KEY `txnID` (`txnID`),
CONSTRAINT `inputs_ibfk_1` FOREIGN KEY (`txnID`) REFERENCES `transactions` (`txnID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `inputs_ibfk_2` FOREIGN KEY (`outID`) REFERENCES `outputs` (`outID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `outputs`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `outputs` (
`outID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`txnID` int(10) unsigned NOT NULL DEFAULT '0',
`addrID` int(10) unsigned NOT NULL DEFAULT '0',
`outIndex` int(10) unsigned NOT NULL DEFAULT '0',
`outAmount` bigint(20) unsigned NOT NULL DEFAULT '0',
`outScript` varchar(20000) NOT NULL DEFAULT '',
PRIMARY KEY (`outID`),
UNIQUE KEY `txnID_2` (`txnID`,`addrID`,`outIndex`),
KEY `txnID` (`txnID`),
KEY `addrID` (`addrID`),
CONSTRAINT `outputs_ibfk_1` FOREIGN KEY (`txnID`) REFERENCES `transactions` (`txnID`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `outputs_ibfk_2` FOREIGN KEY (`addrID`) REFERENCES `addresses` (`addrID`) ON DELETE CASCADE ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `transactions`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `transactions` (
`txnID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`txnTxid` char(64) DEFAULT NULL,
`txnCreated` int(10) unsigned NOT NULL DEFAULT '0',
`txnVersion` int(10) unsigned NOT NULL DEFAULT '0',
`txnLocktime` int(10) unsigned NOT NULL DEFAULT '0',
`blockID` int(10) unsigned DEFAULT NULL,
PRIMARY KEY (`txnID`),
UNIQUE KEY `txnTxid` (`txnTxid`),
KEY `txnCreated` (`txnCreated`),
KEY `blockID` (`blockID`),
CONSTRAINT `transactions_ibfk_1` FOREIGN KEY (`blockID`) REFERENCES `blocks` (`blockID`) ON DELETE SET NULL ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `scheduled_transactions`
--
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE IF NOT EXISTS `scheduled_transactions` (
`schID` int(10) unsigned NOT NULL AUTO_INCREMENT,
`schTxid` char(64) NOT NULL DEFAULT '',
`schCreated` int(10) unsigned NOT NULL DEFAULT '0',
`schRaw` varchar(50000) NOT NULL DEFAULT '',
`schParentID` int(10) unsigned DEFAULT NULL,
`schParentTxid` char(64) DEFAULT '',
`schDelay` int(10) unsigned NOT NULL DEFAULT '0',
`schTrigger` int(10) unsigned NOT NULL DEFAULT '0',
PRIMARY KEY (`schID`),
UNIQUE KEY `schTxid` (`schTxid`),
KEY `schParentID` (`schParentID`),
CONSTRAINT `scheduled_transactions_ibfk_1` FOREIGN KEY (`schParentID`) REFERENCES `scheduled_transactions` (`schID`) ON DELETE SET NULL ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;

11
apps/samourai-server/mysql/mysql-dojo.cnf

@ -1,11 +0,0 @@
[mysqld]
sql_mode="NO_ENGINE_SUBSTITUTION"
transaction_isolation=READ-COMMITTED
performance_schema=off
innodb_buffer_pool_size=128M
innodb_buffer_pool_chunk_size=16M
key_buffer_size=8M
tmp_table_size=1M
max_connections=80
sort_buffer_size=1M
query_cache_size=8M

14
apps/samourai-server/mysql/update-db.sh

@ -1,14 +0,0 @@
#!/bin/bash
for i in {30..0}; do
if echo "SELECT 1" | mysql -h"db" -u"root" -p"$MYSQL_ROOT_PASSWORD" &> /dev/null; then
break
fi
echo "MySQL init process in progress..."
sleep 1
done
if [ -f /docker-entrypoint-initdb.d/2_update.sql ]; then
mysql -h"db" -u"root" -p"$MYSQL_ROOT_PASSWORD" "$MYSQL_DATABASE" < /docker-entrypoint-initdb.d/2_update.sql
echo "Updated database with 2_update.sql"
fi

8
scripts/update/01-run.sh

@ -210,14 +210,6 @@ if [[ -d "${samourai_app_dir}" ]] && [[ -d "${samourai_data_dir}" ]]; then
rsync --archive --verbose "${samourai_app_dir}/" "${samourai_data_dir}"
fi
# Handle updating mysql conf for samourai-server app
samourai_app_mysql_conf="${UMBREL_ROOT}/apps/samourai-server/mysql/mysql-dojo.cnf"
samourai_data_mysql_conf="${UMBREL_ROOT}/app-data/samourai-server/mysql/mysql-dojo.cnf"
if [[ -f "${samourai_app_mysql_conf}" ]] && [[ -f "${samourai_data_mysql_conf}" ]]; then
echo "Found samourai-server install, attempting to update DB configuration..."
cp "${samourai_app_mysql_conf}" "${samourai_data_mysql_conf}"
fi
# Handle hidden service migration for samourai-server app
samourai_app_dojo_tor_dir="${UMBREL_ROOT}/tor/data/app-samourai-server"
samourai_app_new_dojo_tor_dir="${UMBREL_ROOT}/tor/data/app-samourai-server-dojo"

3
templates/bitcoin-sample.conf

@ -34,4 +34,5 @@ peerbloomfilters=1
peerblockfilters=1
# Compatibility
deprecatedrpc=addresses # https://github.com/mempool/mempool/issues/778#issuecomment-919194258
deprecatedrpc=addresses # https://github.com/mempool/mempool/issues/778#issuecomment-919194258
rpcworkqueue=64 # https://code.samourai.io/dojo/samourai-dojo/-/commit/54836226af024cb880ab490c994a9d7b0cd7afad
Loading…
Cancel
Save