Unverified Commit 91a5584e authored by Pavel Ševčík's avatar Pavel Ševčík
Browse files

Merge remote-tracking branch 'upstream/develop' into develop

# Conflicts:
#	docker/my-dojo/bitcoin/Dockerfile
parents 20173ee2 43ab3507
......@@ -109,7 +109,7 @@ class ApiHelper {
* Express middleware validating if entities params are well formed
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateEntitiesParams(req, res, next) {
const params = this.checkEntitiesParams(req.query) ? req.query : req.body
......
......@@ -57,7 +57,7 @@ class HeadersRestApi {
* Validate request arguments
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsGetHeader(req, res, next) {
const isValidHash = validator.isHash(req.params.hash, 'sha256')
......
......@@ -79,7 +79,7 @@ class MultiaddrRestApi {
} finally {
if (debugApi) {
const strParams =
const strParams =
`${req.query.active ? req.query.active : ''} \
${req.query.new ? req.query.new : ''} \
${req.query.pubkey ? req.query.pubkey : ''} \
......@@ -120,7 +120,7 @@ class MultiaddrRestApi {
} finally {
if (debugApi) {
const strParams =
const strParams =
`${req.body.active ? req.body.active : ''} \
${req.body.new ? req.body.new : ''} \
${req.body.pubkey ? req.body.pubkey : ''} \
......
......@@ -336,7 +336,7 @@ class SupportRestApi {
* Validate arguments related to GET xpub info requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsGetXpubInfo(req, res, next) {
const isValidXpub = validator.isAlphanumeric(req.params.xpub)
......@@ -353,7 +353,7 @@ class SupportRestApi {
* Validate arguments related to GET xpub rescan requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsGetXpubRescan(req, res, next) {
const isValidXpub = validator.isAlphanumeric(req.params.xpub)
......@@ -371,7 +371,7 @@ class SupportRestApi {
* Validate arguments related to GET xpub delete requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsGetXpubDelete(req, res, next) {
const isValidXpub = validator.isAlphanumeric(req.params.xpub)
......@@ -388,7 +388,7 @@ class SupportRestApi {
* Validate arguments related to addresses requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateAddress(req, res, next) {
const isValidAddress = validator.isAlphanumeric(req.params.addr)
......
......@@ -112,7 +112,7 @@ class TransactionsRestApi {
* Validate arguments of /tx requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsGetTransaction(req, res, next) {
const isValidTxid = validator.isHash(req.params.txid, 'sha256')
......@@ -137,7 +137,7 @@ class TransactionsRestApi {
* Validate arguments of /txs requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsGetTransactions(req, res, next) {
const isValidPage =
......
......@@ -40,7 +40,7 @@ class UnspentRestApi {
)
this.httpServer.app.post(
'/unspent',
'/unspent',
urlencodedParser,
authMgr.checkAuthentication.bind(authMgr),
apiHelper.validateEntitiesParams.bind(apiHelper),
......@@ -79,7 +79,7 @@ class UnspentRestApi {
} finally {
if (debugApi) {
const strParams =
const strParams =
`${req.query.active ? req.query.active : ''} \
${req.query.new ? req.query.new : ''} \
${req.query.pubkey ? req.query.pubkey : ''} \
......@@ -120,7 +120,7 @@ class UnspentRestApi {
} finally {
if (debugApi) {
const strParams =
const strParams =
`${req.body.active ? req.body.active : ''} \
${req.body.new ? req.body.new : ''} \
${req.body.pubkey ? req.body.pubkey : ''} \
......@@ -134,4 +134,4 @@ class UnspentRestApi {
}
module.exports = UnspentRestApi
\ No newline at end of file
module.exports = UnspentRestApi
......@@ -78,7 +78,7 @@ class WalletRestApi {
} finally {
if (debugApi) {
const strParams =
const strParams =
`${req.query.active ? req.query.active : ''} \
${req.query.new ? req.query.new : ''} \
${req.query.pubkey ? req.query.pubkey : ''} \
......@@ -119,7 +119,7 @@ class WalletRestApi {
} finally {
if (debugApi) {
const strParams =
const strParams =
`${req.body.active ? req.body.active : ''} \
${req.body.new ? req.body.new : ''} \
${req.body.pubkey ? req.body.pubkey : ''} \
......
......@@ -404,7 +404,7 @@ class XPubRestApi {
* Validate arguments of postXpub requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsPostXpub(req, res, next) {
const isValidXpub = validator.isAlphanumeric(req.body.xpub)
......@@ -436,7 +436,7 @@ class XPubRestApi {
* Validate arguments of getXpub requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsGetXpub(req, res, next) {
const isValidXpub = validator.isAlphanumeric(req.params.xpub)
......@@ -456,7 +456,7 @@ class XPubRestApi {
* Validate arguments of postLockXpub requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsPostLockXpub(req, res, next) {
const isValidXpub = validator.isAlphanumeric(req.params.xpub)
......@@ -480,7 +480,7 @@ class XPubRestApi {
* Validate arguments of deleteXpub requests
* @param {object} req - http request object
* @param {object} res - http response object
* @param {function} next - next express middleware
* @param {function} next - next tiny-http middleware
*/
validateArgsDeleteXpub(req, res, next) {
const isValidXpub = validator.isAlphanumeric(req.params.xpub)
......
......@@ -11,7 +11,7 @@ A word of caution, though, the default values of these options try to maximize y
- [Local Electrum server used as data source for imports/rescans](#local_electrum)
- [Local Whirlpool client](#local_whirlpool)
- [External Bitcoin full node](#external_bitcoind)
- [bitcoind RPC API ans ZMQ notifications exposed to external apps](#exposed_rpc_zmq)
- [bitcoind RPC API and ZMQ notifications exposed to external apps](#exposed_rpc_zmq)
- [Static onion address for bitcoind hidden service](#static_onion)
- [Configure Tor Bridges](#tor_bridges)
- [Support of testnet](#testnet)
......@@ -282,7 +282,7 @@ Follow these steps if you want to speed up this operation by preloading an archi
<a name="exposed_rpc_zmq"/>
## bitcoind RPC API ans ZMQ notifications exposed to external apps ##
## bitcoind RPC API and ZMQ notifications exposed to external apps ##
By default, access to the RPC API of your bitcoind is restricted to Docker containers hosted on the "dojonet" network.
......
......@@ -17,7 +17,7 @@ DOJO_BITCOIND_VERSION_TAG=1.12.0
DOJO_NODEJS_VERSION_TAG=1.10.0
DOJO_NGINX_VERSION_TAG=1.6.0
DOJO_TOR_VERSION_TAG=1.8.0
DOJO_EXPLORER_VERSION_TAG=1.6.0
DOJO_EXPLORER_VERSION_TAG=1.7.0
DOJO_INDEXER_VERSION_TAG=1.3.0
DOJO_WHIRLPOOL_VERSION_TAG=1.4.0
......
FROM debian:buster
FROM debian:buster-slim
#################################################################
......
FROM node:12-buster
FROM node:12-alpine
ENV NODE_ENV production
ENV APP_DIR /home/node/app
ENV EXPLORER_URL https://github.com/janoside/btc-rpc-explorer/archive
ENV EXPLORER_VERSION 3.0.0
ENV EXPLORER_VERSION 3.1.1
# Install netcat
RUN set -ex && \
apt-get update && \
apt-get install -y netcat
apk --no-cache add bash gcc g++ make python3 git netcat-openbsd
# Download the source code and install it
RUN set -ex && \
......@@ -29,4 +30,4 @@ RUN chown node:node "$APP_DIR/restart.sh" && \
EXPOSE 3002
USER node
\ No newline at end of file
USER node
[mysqld]
sql_mode="NO_ENGINE_SUBSTITUTION"
\ No newline at end of file
sql_mode="NO_ENGINE_SUBSTITUTION"
transaction_isolation=READ-COMMITTED
\ No newline at end of file
[mysqld]
sql_mode="NO_ENGINE_SUBSTITUTION"
transaction_isolation=READ-COMMITTED
performance_schema=off
innodb_buffer_pool_size=128M
innodb_buffer_pool_chunk_size=16M
......
FROM node:12-buster
FROM node:12-alpine
ENV NODE_ENV production
ENV APP_DIR /home/node/app
ARG TOR_LINUX_GID
RUN set -ex && \
apk --no-cache add shadow bash gcc g++ make python3
# Add node user to tor group
RUN addgroup --system -gid ${TOR_LINUX_GID} tor && \
RUN addgroup -S -g ${TOR_LINUX_GID} tor && \
usermod -a -G tor node
# Install forever
......@@ -40,4 +44,4 @@ RUN chown node:node "$APP_DIR/wait-for-it.sh" && \
chmod u+x "$APP_DIR/wait-for-it.sh" && \
chmod g+x "$APP_DIR/wait-for-it.sh"
USER node
\ No newline at end of file
USER node
#!/bin/bash
cd /home/node/app/accounts
forever start -a -l /dev/stdout -o /dev/null -e /dev/null index.js "$COMMON_BTC_NETWORK"
forever start -a -l /dev/stdout -o /dev/null -e /dev/null index.js
cd /home/node/app/pushtx
forever start -a -l /dev/stdout -o /dev/null -e /dev/null index.js "$COMMON_BTC_NETWORK"
forever start -a -l /dev/stdout -o /dev/null -e /dev/null index-orchestrator.js "$COMMON_BTC_NETWORK"
forever start -a -l /dev/stdout -o /dev/null -e /dev/null index.js
forever start -a -l /dev/stdout -o /dev/null -e /dev/null index-orchestrator.js
cd /home/node/app/tracker
forever start -a -l /dev/stdout -o /dev/null -e /dev/null index.js "$COMMON_BTC_NETWORK"
forever start -a -l /dev/stdout -o /dev/null -e /dev/null index.js
# Keep the container up
while true
......
......@@ -146,7 +146,11 @@ WAITFORIT_TIMEOUT_PATH=$(type -p timeout)
WAITFORIT_TIMEOUT_PATH=$(realpath $WAITFORIT_TIMEOUT_PATH 2>/dev/null || readlink -f $WAITFORIT_TIMEOUT_PATH)
if [[ $WAITFORIT_TIMEOUT_PATH =~ "busybox" ]]; then
WAITFORIT_ISBUSY=1
WAITFORIT_BUSYTIMEFLAG="-t"
# Check if busybox timeout uses -t flag
# (recent Alpine versions don't support -t anymore)
if timeout &>/dev/stdout | grep -q -e '-t '; then
WAITFORIT_BUSYTIMEFLAG="-t"
fi
else
WAITFORIT_ISBUSY=0
......
FROM debian:buster
FROM debian:buster-slim
ENV TOR_HOME /var/lib/tor
ENV TOR_URL https://dist.torproject.org
......@@ -24,7 +24,7 @@ ARG TOR_LINUX_GID
# Install Tor
RUN set -ex && \
apt-get update && \
apt-get install -y git libevent-dev zlib1g-dev libssl-dev gcc make automake ca-certificates autoconf musl-dev coreutils gpg wget && \
apt-get install -y git libevent-dev zlib1g-dev libssl-dev gcc make automake ca-certificates autoconf musl-dev coreutils gpg wget python3 && \
mkdir -p /usr/local/src/ && \
cd /usr/local/src && \
res=0; \
......
FROM debian:buster
FROM debian:buster-slim
ENV WHIRLPOOL_HOME /home/whirlpool
ENV WHIRLPOOL_DIR /usr/local/whirlpool-cli
......@@ -8,8 +8,12 @@ ARG WHIRLPOOL_LINUX_GID
# Install prerequisites
# Create group & user whirlpool
# Create /usr/share/man/man1 directory
# Create .whirlpool-cli subdirectory of WHIRLPOOL_HOME
# Create /usr/local/src/whirlpool-cli directory
RUN mkdir -p /usr/share/man/man1
RUN set -ex && \
apt-get update && \
apt-get install -y libevent-dev zlib1g-dev libssl-dev gcc make automake ca-certificates autoconf musl-dev coreutils gpg wget default-jdk && \
......
......@@ -6,6 +6,7 @@
/**
* Desired structure of /keys/index.js, which is ignored in the repository.
* index.js should store only one of the 2 sets of parameters (mainnet or testnet)
*/
module.exports = {
/*
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment