├── .drone.yml ├── .gitignore ├── Gemfile ├── Gemfile.lock ├── README ├── README.md ├── bch ├── .gitignore ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 ├── config │ ├── mainnet-bch.conf │ └── testnet-bch.conf ├── docker-compose.yml └── scripts │ └── docker-entrypoint.sh ├── bgoldd ├── .env ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 ├── config │ ├── mainnet │ │ └── bitcoingold.conf │ └── testnet │ │ └── bitcoingold.conf ├── docker-compose.yml └── scripts │ └── docker-entrypoint.sh ├── bitcoind ├── .env ├── .gitignore ├── Dockerfile ├── README.md ├── VERSION ├── bitcoin-0.20.1-x86_64-linux-gnu.tar.gz ├── blocks │ ├── mainnet │ │ └── .gitkeep │ └── testnet │ │ └── .gitkeep ├── checksum.sha256 ├── config │ ├── mainnet-bitcoin.conf │ └── testnet-bitcoin.conf ├── docker-compose.yml ├── keys │ ├── mainnet │ │ └── .gitkeep │ └── testnet │ │ └── .gitkeep └── scripts │ └── docker-entrypoint.sh ├── btcd ├── Dockerfile ├── VERSION ├── config │ ├── mainnet-btcd.conf │ └── testnet-btcd.conf └── docker-compose.yml ├── dashd ├── .gitignore ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 ├── config │ ├── mainnet-dash.conf │ └── testnet-dash.conf ├── docker-compose.yml └── scripts │ └── dash_oneshot ├── electron-cash ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 └── start-electron-cash.py ├── electrum-dash ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 └── start-electrum.py ├── electrum-ltc ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 └── start-electrum.py ├── electrum ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 └── start-electrum.py ├── fluentd ├── Dockerfile ├── Gemfile ├── Gemfile.lock ├── VERSION ├── conf │ ├── fluent.conf │ ├── kubernetes.conf │ ├── prometheus.conf │ └── systemd.conf ├── entrypoint.sh └── plugins │ ├── .gitkeep │ ├── parser_kubernetes.rb │ └── parser_multiline_kubernetes.rb ├── influxdb ├── Dockerfile └── README.md ├── k8s-go-tools ├── Dockerfile ├── README.md └── VERSION ├── litecoind ├── Dockerfile ├── README.md ├── VERSION ├── config │ ├── mainnet.conf │ └── testnet.conf ├── docker-compose.yml └── docker-entrypoint.sh ├── monerod ├── .env ├── .gitignore ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 ├── config │ └── stagenet │ │ ├── bitmonero.conf │ │ └── monero-wallet-rpc.conf ├── docker-compose.yml └── scripts │ └── docker-entrypoint.sh ├── mysql ├── Dockerfile └── README.md ├── openethereum ├── .env ├── Dockerfile ├── README.md ├── VERSION ├── config │ ├── classic │ │ └── parity.toml │ ├── dev │ │ ├── parity.toml │ │ ├── ss1.pw │ │ ├── ss1.toml │ │ ├── ss2.toml │ │ └── ss3.toml │ ├── kotti │ │ └── parity.toml │ ├── kovan │ │ └── openethereum.toml │ └── mainnet │ │ └── parity.toml ├── docker-compose.yml └── scripts │ └── docker-entrypoint.sh ├── ow-cli ├── parity ├── .env ├── Dockerfile ├── README.md ├── VERSION ├── checksum.sha256 ├── config │ ├── classic │ │ └── parity.toml │ ├── kotti │ │ └── parity.toml │ ├── kovan │ │ └── parity.toml │ └── mainnet │ │ └── parity.toml ├── docker-compose.yml └── scripts │ └── docker-entrypoint.sh ├── postgres ├── Dockerfile ├── README.md └── VERSION ├── protobuf-build ├── Dockerfile ├── README.md └── VERSION ├── rippled ├── .env ├── .gitignore ├── Dockerfile ├── README.md ├── VERSION ├── config-testnet │ ├── rippled.cfg │ └── validators.txt ├── config │ ├── rippled.cfg │ └── validators.txt ├── docker-compose.yml └── entrypoint ├── spark ├── Dockerfile ├── VERSION ├── prebuildfs │ ├── opt │ │ └── bitnami │ │ │ ├── .bitnami_components.json │ │ │ ├── licenses │ │ │ └── licenses.txt │ │ │ └── scripts │ │ │ ├── libbitnami.sh │ │ │ ├── libfile.sh │ │ │ ├── libfs.sh │ │ │ ├── libhook.sh │ │ │ ├── liblog.sh │ │ │ ├── libnet.sh │ │ │ ├── libos.sh │ │ │ ├── libpersistence.sh │ │ │ ├── libservice.sh │ │ │ ├── libvalidations.sh │ │ │ ├── libversion.sh │ │ │ └── libwebserver.sh │ └── usr │ │ └── sbin │ │ └── install_packages └── rootfs │ └── opt │ └── bitnami │ └── scripts │ ├── java │ ├── entrypoint.sh │ └── postunpack.sh │ ├── libspark.sh │ └── spark │ ├── entrypoint.sh │ ├── postunpack.sh │ ├── run.sh │ └── setup.sh ├── supabase-postgres ├── Dockerfile └── README.md └── testground ├── Dockerfile ├── README.md └── VERSION /.drone.yml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: pipeline 3 | type: docker 4 | name: New version 5 | 6 | steps: 7 | - name: Build updated images 8 | image: ruby:2.6.5 9 | volumes: 10 | - name: docker 11 | path: /var/run/docker.sock 12 | environment: 13 | REGISTRY_USER: 14 | from_secret: ow_registry_username 15 | REGISTRY_PASSWORD: 16 | from_secret: ow_registry_password 17 | commands: 18 | - gem update bundler 19 | - bundle install 20 | - curl -fsSL https://get.docker.com | bash 21 | - docker login quay.io -u $REGISTRY_USER -p $REGISTRY_PASSWORD 22 | - bundle exec ruby ow-cli incremental-build --push 23 | 24 | volumes: 25 | - name: docker 26 | host: 27 | path: /var/run/docker.sock 28 | 29 | trigger: 30 | event: 31 | - push 32 | branch: 33 | - master 34 | 35 | --- 36 | kind: pipeline 37 | type: docker 38 | name: Push 39 | 40 | steps: 41 | - name: Build updated images 42 | image: ruby:2.6.5 43 | volumes: 44 | - name: docker 45 | path: /var/run/docker.sock 46 | environment: 47 | REGISTRY_USER: 48 | from_secret: ow_registry_username 49 | REGISTRY_PASSWORD: 50 | from_secret: ow_registry_password 51 | commands: 52 | - gem update bundler 53 | - bundle install 54 | - curl -fsSL https://get.docker.com | bash 55 | - docker login quay.io -u $REGISTRY_USER -p $REGISTRY_PASSWORD 56 | - bundle exec ruby ow-cli incremental-build 57 | 58 | volumes: 59 | - name: docker 60 | host: 61 | path: /var/run/docker.sock 62 | 63 | trigger: 64 | event: 65 | - push 66 | branch: 67 | exclude: 68 | - master 69 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | blocks/ 2 | keys/ 3 | data/ 4 | -------------------------------------------------------------------------------- /Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source "https://rubygems.org" 4 | 5 | git_source(:github) {|repo_name| "https://github.com/#{repo_name}" } 6 | 7 | gem "clamp", "~> 1.3" 8 | -------------------------------------------------------------------------------- /Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | clamp (1.3.1) 5 | 6 | PLATFORMS 7 | ruby 8 | 9 | DEPENDENCIES 10 | clamp (~> 1.3) 11 | 12 | BUNDLED WITH 13 | 2.0.2 14 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openware/images/3dd03c51c1640054241a5854945d04c30f2f6b4c/README -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Openware docker images 2 | 3 | This repository contains docker images maintained by openware team. Mostly blockchain cryptonodes. 4 | You can find the list of available images and tag here: https://quay.io/organization/openware 5 | 6 | ## Development guidelines 7 | 8 | We are focusing our efforts to keep a high level of trust and security on those images. 9 | Please follow the following principles when developing an image: 10 | 11 | 1. Use official images as source (ex: debian:buster, alpine, python), don't use sources from third parties 12 | 2. Install dependencies by downloading from official repositories (do not add them to the git reposity) 13 | 3. Use recent versions 14 | 4. The target application should be downloaded from well identified sources (ex: github official repository releases) 15 | 5. Store the checksums of the binaries you install and check them during the build in the Dockerfile. 16 | See the following example: [electrum/Dockerfile](./electrum/Dockerfile) and [electrum/checksum.sha256](./electrum/checksum.sha256) 17 | 6. The application version must be stored in VERSION file, the content is passed as argument during the build and it's used to tag the image. 18 | It **must be used to download the application binaries or sources** 19 | You can build manually with the following command: ```docker build --build-arg VERSION=1.2.3``` 20 | 7. The image should contain a README.md with instructions to do basic operations 21 | 8. Include a docker-compose.yml file with example how to deploy a testnet and mainnet node (add configuration files if necessary) 22 | 9. Create volumes for data directories (blockchain storage and wallets) 23 | -------------------------------------------------------------------------------- /bch/.gitignore: -------------------------------------------------------------------------------- 1 | blocks/mainnet/blk00000.dat 2 | blocks/mainnet/index/ 3 | blocks/mainnet/rev00000.dat 4 | keys/mainnet/.walletlock 5 | keys/mainnet/db.log 6 | keys/mainnet/wallet.dat 7 | blocks/testnet/blk00000.dat 8 | blocks/testnet/index/ 9 | blocks/testnet/rev00000.dat 10 | keys/testnet/.walletlock 11 | keys/testnet/db.log 12 | keys/testnet/wallet.dat 13 | 14 | -------------------------------------------------------------------------------- /bch/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:stretch-slim 2 | 3 | ENV USER_ID ${USER_ID:-1000} 4 | ENV GROUP_ID ${GROUP_ID:-1000} 5 | 6 | RUN groupadd -g ${GROUP_ID} bitcoincash \ 7 | && useradd -u ${USER_ID} -g bitcoincash -s /bin/bash -m -d /bitcoincash bitcoincash 8 | 9 | RUN set -ex \ 10 | && apt-get update \ 11 | && apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu gpg wget \ 12 | && rm -rf /var/lib/apt/lists/* 13 | 14 | COPY VERSION /tmp/VERSION 15 | COPY checksum.sha256 /tmp/checksum.sha256 16 | 17 | RUN set -ex \ 18 | && cd /tmp \ 19 | && wget -qO bitcoin-cash.tar.gz "https://download.bitcoinabc.org/bchn/$(cat VERSION)/linux/bitcoin-abc-$(cat VERSION)-x86_64-linux-gnu.tar.gz" \ 20 | && cat checksum.sha256 | sha256sum -c - \ 21 | && tar -xzvf bitcoin-cash.tar.gz -C /usr/local --strip-components=1 --exclude=*-qt \ 22 | && rm -rf /tmp/* 23 | 24 | VOLUME ["/bitcoincash"] 25 | EXPOSE 8332 8333 18332 18333 26 | 27 | WORKDIR /bitcoincash 28 | 29 | COPY scripts/docker-entrypoint.sh /usr/local/bin/entrypoint.sh 30 | ENTRYPOINT ["entrypoint.sh"] 31 | -------------------------------------------------------------------------------- /bch/README.md: -------------------------------------------------------------------------------- 1 | # Bitcoind 2 | 3 | ## Start the cryptonode 4 | 5 | ```shell 6 | docker-compose up -Vd *mainnet or testnet*` 7 | ``` 8 | ## Usage 9 | ### Create a new account 10 | 11 | ```shell 12 | curl -H "Content-Type: application/json" --data '{"method": "getnewaddress"}' rpcuser:rpcpassword@ip:port 13 | ``` 14 | Or, you can specify account and get this address assigned to new address 15 | 16 | ```shell 17 | curl -H "Content-Type: application/json" --data '{"method": "getnewaddress", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 18 | ``` 19 | 20 | Where 'billy' is your account name. You can check that address for account was created properly: 21 | 22 | ```shell 23 | curl -H "Content-Type: application/json" --data '{"method": "validateaddress", "params": ["bitcoincash:qrf8qjayhg0cakja6e34hpwy6lyeuf2q9g3zpjy7ez"]}' rpcuser:rpcpassword@ip:port 24 | ``` 25 | 26 | ### General Blockchain info 27 | ``` shell 28 | curl -H "Content-Type: application/json" --data '{"method": "getblockchaininfo"}' rpcuser:rpcpassword@ip:port 29 | ``` 30 | 31 | More: 32 | [BitcoinCash RPC API](https://www.bitcoincash.org/spec/JSON-RPC.html) 33 | -------------------------------------------------------------------------------- /bch/VERSION: -------------------------------------------------------------------------------- 1 | 0.22.9 2 | -------------------------------------------------------------------------------- /bch/checksum.sha256: -------------------------------------------------------------------------------- 1 | ef789839441cf1def30ebd02bd155a7c0ca1ff5dfe0d5b82df0589fde7ae7814 bitcoin-cash.tar.gz 2 | -------------------------------------------------------------------------------- /bch/config/mainnet-bch.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | upnp=0 3 | printtoconsole=1 4 | server=1 5 | #rpc 6 | rpcuser=deploy 7 | rpcpassword=changeme 8 | rpcallowip=0.0.0.0/0 9 | port=8333 10 | rpcport=8332 11 | rpcbind=0.0.0.0 12 | # [wallet] 13 | wallet=/bitcoincash/wallet -------------------------------------------------------------------------------- /bch/config/testnet-bch.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | upnp=0 3 | printtoconsole=1 4 | onlynet=ipv4 5 | server=1 6 | testnet=1 7 | #rpc 8 | rpcuser=deploy 9 | rpcpassword=changeme 10 | [test] 11 | rpcallowip=0.0.0.0/0 12 | port=18333 13 | rpcport=18332 14 | rpcbind=0.0.0.0 15 | # [wallet] 16 | wallet=/bitcoincash/wallet 17 | -------------------------------------------------------------------------------- /bch/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | mainnet: 5 | image: quay.io/openware/bch:0.22.9 6 | restart: always 7 | user: root 8 | command: bitcoind 9 | ports: 10 | - "8332:8332" 11 | volumes: 12 | - ./keys/mainnet:/bitcoincash/wallet 13 | - ./blocks/mainnet:/bitcoincash/.bitcoin/blocks 14 | - ./config/mainnet-bch.conf:/bitcoincash/.bitcoin/bitcoin.conf 15 | 16 | testnet: 17 | image: quay.io/openware/bch:0.22.9 18 | restart: always 19 | user: root 20 | command: bitcoind 21 | ports: 22 | - "18332:18332" 23 | volumes: 24 | - ./keys/testnet:/bitcoincash/wallet 25 | - ./blocks/testnet:/bitcoincash/.bitcoin/testnet3/blocks 26 | - ./config/testnet-bch.conf:/bitcoincash/.bitcoin/bitcoin.conf 27 | -------------------------------------------------------------------------------- /bch/scripts/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -e 3 | 4 | # allow the container to be started with `--user` 5 | if [ "$(id -u)" = '0' ]; then 6 | chown -R bitcoincash . 7 | exec gosu bitcoincash "$0" "$@" 8 | fi 9 | 10 | exec "$@" -------------------------------------------------------------------------------- /bgoldd/.env: -------------------------------------------------------------------------------- 1 | COMPOSE_PROJECT_NAME=bgoldd 2 | -------------------------------------------------------------------------------- /bgoldd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster 2 | 3 | ARG VERSION 4 | 5 | ENV USER_ID ${USER_ID:-1000} 6 | ENV GROUP_ID ${GROUP_ID:-1000} 7 | 8 | RUN groupadd -g ${GROUP_ID} bitcoingold \ 9 | && useradd -u ${USER_ID} -g bitcoingold -s /bin/bash -m -d /bitcoingold bitcoingold 10 | 11 | RUN apt-get update && apt-get -y upgrade && apt-get install -y wget ca-certificates gpg gpg-agent && \ 12 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 13 | 14 | COPY checksum.sha256 /root 15 | 16 | RUN cd /root && \ 17 | wget -q https://github.com/BTCGPU/BTCGPU/releases/download/v0.15.2/bitcoin-gold-0.15.2-x86_64-linux-gnu.tar.gz && \ 18 | cat checksum.sha256 | grep ${VERSION} | sha256sum -c &&\ 19 | tar xvf bitcoin-gold-${VERSION}-x86_64-linux-gnu.tar.gz && \ 20 | cd bitcoin-gold-${VERSION} && \ 21 | mv bin/* /usr/bin/ && \ 22 | mv lib/* /usr/bin/ && \ 23 | mv include/* /usr/bin/ && \ 24 | mv share/* /usr/bin/ && \ 25 | cd /root && \ 26 | rm -Rf bitcoin-gold-${VERSION} bitcoin-gold-${VERSION}-x86_64-linux-gnu.tar.gz 27 | 28 | ENV GOSU_VERSION 1.11 29 | RUN set -x \ 30 | && apt-get install -y --no-install-recommends \ 31 | ca-certificates \ 32 | && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ 33 | && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ 34 | && export GNUPGHOME="$(mktemp -d)" \ 35 | && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ 36 | && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ 37 | && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ 38 | && chmod +x /usr/local/bin/gosu \ 39 | && gosu nobody true 40 | 41 | 42 | VOLUME ["/bitcoingold"] 43 | EXPOSE 8332 8333 18332 18333 44 | 45 | WORKDIR /bitcoingold 46 | 47 | COPY scripts/docker-entrypoint.sh /usr/local/bin/ 48 | ENTRYPOINT ["docker-entrypoint.sh"] 49 | -------------------------------------------------------------------------------- /bgoldd/README.md: -------------------------------------------------------------------------------- 1 | # Bgoldd 2 | 3 | ## Start the cryptonode 4 | 5 | ```shell 6 | docker-compose up -Vd *mainnet or testnet*` 7 | ``` 8 | 9 | ## Usage 10 | ### Create a new account 11 | 12 | ```shell 13 | curl -H "Content-Type: application/json" --data '{"method": "getnewaddress"}' rpcuser:rpcpassword@ip:port 14 | ``` 15 | Or, you can specify account and get this address assigned to new address 16 | 17 | ```shell 18 | curl -H "Content-Type: application/json" --data '{"method": "getnewaddress", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 19 | ``` 20 | 21 | Where 'billy' is your account name. You can check that your account was created properly: 22 | 23 | ```shell 24 | curl -H "Content-Type: application/json" --data '{"method": "getaddressesbyaccount", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 25 | ``` 26 | 27 | ### General Blockchain info 28 | 29 | ``` shell 30 | curl -H "Content-Type: application/json" --data '{"method": "getinfo"}' rpcuser:rpcpassword@ip:port 31 | ``` 32 | 33 | ### Account info 34 | 35 | To get account by address: 36 | 37 | ```shell 38 | curl -H "Content-Type: application/json" --data '{"method": "getaccount", "params": ["bchtest:qpkgrpazps220qtnzvlvlcm62urtnq0edv7ufjr95n"]}' rpcuser:rpcpassword@ip:port 39 | ``` 40 | 41 | To get addresses associated with account: 42 | 43 | ```shell 44 | curl -H "Content-Type: application/json" --data '{"method": "getaddressesbyaccount", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 45 | ``` 46 | 47 | To get account balance: 48 | 49 | ```shell 50 | curl -H "Content-Type: application/json" --data '{"method": "getbalance", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 51 | ``` 52 | 53 | More: 54 | 55 | [Bitcoin Gold RPC API](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) 56 | -------------------------------------------------------------------------------- /bgoldd/VERSION: -------------------------------------------------------------------------------- 1 | 0.15.2 2 | -------------------------------------------------------------------------------- /bgoldd/checksum.sha256: -------------------------------------------------------------------------------- 1 | 484afd221a71702b8b3a8315bdef3dab4e07a689ffb8a553f09ba91e9e6c6b80 bitcoin-gold-0.15.2-x86_64-linux-gnu.tar.gz 2 | -------------------------------------------------------------------------------- /bgoldd/config/mainnet/bitcoingold.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | upnp=0 3 | printtoconsole=1 4 | 5 | server=1 6 | 7 | rpcuser=deploy 8 | rpcpassword=changeme 9 | port=8333 10 | rpcport=8332 11 | rpcbind=0.0.0.0 12 | rpcallowip=0.0.0.0/0 13 | -------------------------------------------------------------------------------- /bgoldd/config/testnet/bitcoingold.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | upnp=0 3 | printtoconsole=1 4 | 5 | server=1 6 | testnet=1 7 | onlynet=ipv4 8 | 9 | rpcuser=deploy 10 | rpcpassword=changeme 11 | port=18333 12 | rpcport=18332 13 | rpcbind=0.0.0.0 14 | rpcallowip=0.0.0.0/0 15 | -------------------------------------------------------------------------------- /bgoldd/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | mainnet: 5 | image: quay.io/openware/bgoldd:0.15.2 6 | restart: always 7 | user: root 8 | command: bgoldd 9 | ports: 10 | - "8332:8332" 11 | volumes: 12 | - ./data/mainnet:/bitcoingold/.bitcoingold 13 | - ./config/mainnet/bitcoingold.conf:/bitcoingold/.bitcoingold/bitcoingold.conf 14 | 15 | testnet: 16 | image: quay.io/openware/bgoldd:0.15.2 17 | restart: always 18 | user: root 19 | command: bgoldd 20 | ports: 21 | - "18332:18332" 22 | volumes: 23 | - ./data/testnet:/bitcoingold/.bitcoingold 24 | - ./config/testnet/bitcoingold.conf:/bitcoingold/.bitcoingold/bitcoingold.conf 25 | -------------------------------------------------------------------------------- /bgoldd/scripts/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | # allow the container to be started with `--user` 4 | if [ "$(id -u)" = '0' ]; then 5 | chown -R bitcoingold . 6 | exec gosu bitcoingold "$0" "$@" 7 | fi 8 | 9 | exec "$@" 10 | 11 | -------------------------------------------------------------------------------- /bitcoind/.env: -------------------------------------------------------------------------------- 1 | COMPOSE_PROJECT_NAME=bitcoind -------------------------------------------------------------------------------- /bitcoind/.gitignore: -------------------------------------------------------------------------------- 1 | blocks/mainnet/blk00000.dat 2 | blocks/mainnet/index/ 3 | blocks/mainnet/rev00000.dat 4 | keys/mainnet/.walletlock 5 | keys/mainnet/db.log 6 | keys/mainnet/wallet.dat 7 | blocks/testnet/blk00000.dat 8 | blocks/testnet/index/ 9 | blocks/testnet/rev00000.dat 10 | keys/testnet/.walletlock 11 | keys/testnet/db.log 12 | keys/testnet/wallet.dat 13 | -------------------------------------------------------------------------------- /bitcoind/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster 2 | 3 | ARG VERSION 4 | 5 | ENV USER_ID ${USER_ID:-1000} 6 | ENV GROUP_ID ${GROUP_ID:-1000} 7 | 8 | RUN groupadd -g ${GROUP_ID} bitcoin \ 9 | && useradd -u ${USER_ID} -g bitcoin -s /bin/bash -m -d /bitcoin bitcoin 10 | 11 | RUN apt-get update && apt-get -y upgrade && apt-get install -y wget ca-certificates gpg && \ 12 | apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* 13 | 14 | COPY checksum.sha256 /root 15 | 16 | RUN set -x && \ 17 | cd /root && \ 18 | wget -q https://bitcoincore.org/bin/bitcoin-core-${VERSION}/bitcoin-${VERSION}-x86_64-linux-gnu.tar.gz && \ 19 | cat checksum.sha256 | grep ${VERSION} | sha256sum -c && \ 20 | tar xvf bitcoin-${VERSION}-x86_64-linux-gnu.tar.gz && \ 21 | cd bitcoin-${VERSION} && \ 22 | mv bin/* /usr/bin/ && \ 23 | mv lib/* /usr/bin/ && \ 24 | mv include/* /usr/bin/ && \ 25 | mv share/* /usr/bin/ && \ 26 | cd /root && \ 27 | rm -Rf bitcoin-${VERSION} bitcoin-${VERSION}-x86_64-linux-gnu.tar.gz 28 | 29 | ENV GOSU_VERSION 1.7 30 | RUN set -x \ 31 | && apt-get install -y --no-install-recommends \ 32 | ca-certificates \ 33 | && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture)" \ 34 | && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$(dpkg --print-architecture).asc" \ 35 | && export GNUPGHOME="$(mktemp -d)" \ 36 | && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ 37 | && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ 38 | && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ 39 | && chmod +x /usr/local/bin/gosu \ 40 | && gosu nobody true 41 | 42 | 43 | VOLUME ["/bitcoin"] 44 | EXPOSE 8332 8333 18332 18333 45 | 46 | WORKDIR /bitcoin 47 | 48 | COPY scripts/docker-entrypoint.sh /usr/local/bin/ 49 | ENTRYPOINT ["docker-entrypoint.sh"] -------------------------------------------------------------------------------- /bitcoind/README.md: -------------------------------------------------------------------------------- 1 | # Bitcoind 2 | 3 | ## Start the cryptonode 4 | 5 | ```shell 6 | docker-compose up -Vd *mainnet or testnet*` 7 | ``` 8 | 9 | ## Usage 10 | ### Create a new account 11 | 12 | ```shell 13 | curl -H "Content-Type: application/json" --data '{"method": "getnewaddress"}' rpcuser:rpcpassword@ip:port 14 | ``` 15 | Or, you can specify account and get this address assigned to new address 16 | 17 | ```shell 18 | curl -H "Content-Type: application/json" --data '{"method": "getnewaddress", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 19 | ``` 20 | 21 | Where 'billy' is your account name. You can check that your account was created properly: 22 | 23 | ```shell 24 | curl -H "Content-Type: application/json" --data '{"method": "getaddressesbyaccount", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 25 | ``` 26 | 27 | ### General Blockchain info 28 | 29 | ``` shell 30 | curl -H "Content-Type: application/json" --data '{"method": "getinfo"}' rpcuser:rpcpassword@ip:port 31 | ``` 32 | 33 | ### Account info 34 | 35 | To get account by address: 36 | 37 | ```shell 38 | curl -H "Content-Type: application/json" --data '{"method": "getaccount", "params": ["bchtest:qpkgrpazps220qtnzvlvlcm62urtnq0edv7ufjr95n"]}' rpcuser:rpcpassword@ip:port 39 | ``` 40 | 41 | To get addresses associated with account: 42 | 43 | ```shell 44 | curl -H "Content-Type: application/json" --data '{"method": "getaddressesbyaccount", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 45 | ``` 46 | 47 | To get account balance: 48 | 49 | ```shell 50 | curl -H "Content-Type: application/json" --data '{"method": "getbalance", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 51 | ``` 52 | 53 | More: 54 | 55 | [Bitcoin RPC API](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) 56 | -------------------------------------------------------------------------------- /bitcoind/VERSION: -------------------------------------------------------------------------------- 1 | 0.20.1 2 | -------------------------------------------------------------------------------- /bitcoind/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openware/images/3dd03c51c1640054241a5854945d04c30f2f6b4c/bitcoind/bitcoin-0.20.1-x86_64-linux-gnu.tar.gz -------------------------------------------------------------------------------- /bitcoind/blocks/mainnet/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openware/images/3dd03c51c1640054241a5854945d04c30f2f6b4c/bitcoind/blocks/mainnet/.gitkeep -------------------------------------------------------------------------------- /bitcoind/blocks/testnet/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openware/images/3dd03c51c1640054241a5854945d04c30f2f6b4c/bitcoind/blocks/testnet/.gitkeep -------------------------------------------------------------------------------- /bitcoind/checksum.sha256: -------------------------------------------------------------------------------- 1 | 376194f06596ecfa40331167c39bc70c355f960280bd2a645fdbf18f66527397 bitcoin-0.20.1-x86_64-linux-gnu.tar.gz 2 | -------------------------------------------------------------------------------- /bitcoind/config/mainnet-bitcoin.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | dnsseed=0 3 | upnp=0 4 | printtoconsole=1 5 | 6 | server=1 7 | 8 | rpcuser=deploy 9 | rpcpassword=changeme 10 | port=8333 11 | rpcport=8332 12 | rpcbind=0.0.0.0 13 | rpcallowip=0.0.0.0/0 14 | 15 | wallet=/bitcoin/wallet -------------------------------------------------------------------------------- /bitcoind/config/testnet-bitcoin.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | upnp=0 3 | printtoconsole=1 4 | onlynet=ipv4 5 | 6 | server=1 7 | testnet=1 8 | 9 | rpcuser=deploy 10 | rpcpassword=changeme 11 | 12 | [test] 13 | port=18333 14 | rpcport=18332 15 | rpcbind=0.0.0.0 16 | rpcallowip=0.0.0.0/0 17 | 18 | wallet=/bitcoin/wallet -------------------------------------------------------------------------------- /bitcoind/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | mainnet: 5 | image: quay.io/openware/bitcoind:0.20.1 6 | restart: always 7 | user: root 8 | command: bitcoind 9 | ports: 10 | - "8332:8332" 11 | volumes: 12 | - ./keys/mainnet:/bitcoin/wallet 13 | - ./blocks/mainnet:/bitcoin/.bitcoin/blocks 14 | - ./config/mainnet-bitcoin.conf:/bitcoin/.bitcoin/bitcoin.conf 15 | 16 | testnet: 17 | image: quay.io/openware/bitcoind:0.20.1 18 | restart: always 19 | user: root 20 | command: bitcoind 21 | ports: 22 | - "18332:18332" 23 | volumes: 24 | - ./keys/testnet:/bitcoin/wallet 25 | - ./blocks/testnet:/bitcoin/.bitcoin/testnet3/blocks 26 | - ./config/testnet-bitcoin.conf:/bitcoin/.bitcoin/bitcoin.conf 27 | -------------------------------------------------------------------------------- /bitcoind/keys/mainnet/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openware/images/3dd03c51c1640054241a5854945d04c30f2f6b4c/bitcoind/keys/mainnet/.gitkeep -------------------------------------------------------------------------------- /bitcoind/keys/testnet/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openware/images/3dd03c51c1640054241a5854945d04c30f2f6b4c/bitcoind/keys/testnet/.gitkeep -------------------------------------------------------------------------------- /bitcoind/scripts/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -e 3 | # allow the container to be started with `--user` 4 | if [ "$(id -u)" = '0' ]; then 5 | chown -R bitcoin . 6 | exec gosu bitcoin "$0" "$@" 7 | fi 8 | 9 | exec "$@" 10 | 11 | -------------------------------------------------------------------------------- /btcd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:1.13-alpine AS builder 2 | 3 | ENV GO111MODULE=on 4 | 5 | RUN cd /root && \ 6 | go get github.com/btcsuite/btcd@f3ec130 && \ 7 | go get github.com/btcsuite/btcwallet@2fed914 8 | 9 | FROM alpine:3.9 10 | 11 | RUN apk add ca-certificates 12 | 13 | WORKDIR btcd 14 | 15 | RUN addgroup -g 1000 btc && \ 16 | adduser -u 1000 -G btc -s /bin/bash -D -h /btc btc 17 | 18 | COPY --from=builder /go/bin/btcd /bin/btcd 19 | COPY --from=builder /go/bin/btcwallet /bin/btcwallet 20 | 21 | VOLUME ["/btc"] 22 | 23 | USER btc 24 | WORKDIR /btc 25 | EXPOSE 8333 8334 26 | 27 | CMD ["/bin/btcd"] 28 | -------------------------------------------------------------------------------- /btcd/VERSION: -------------------------------------------------------------------------------- 1 | v0.20.1-beta -------------------------------------------------------------------------------- /btcd/config/mainnet-btcd.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | upnp=0 3 | 4 | rpcuser=deploy 5 | rpcpass=changeme 6 | 7 | listen=0.0.0.0:8333 8 | rpclisten=0.0.0.0:8334 9 | -------------------------------------------------------------------------------- /btcd/config/testnet-btcd.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | upnp=0 3 | 4 | rpcuser=deploy 5 | rpcpass=changeme 6 | 7 | testnet=1 8 | 9 | listen=0.0.0.0:18333 10 | rpclisten=0.0.0.0:18334 11 | -------------------------------------------------------------------------------- /btcd/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | mainnet: 5 | image: quay.io/openware/btcd:0.20.1-beta 6 | restart: always 7 | ports: 8 | - "0.0.0.0:8334:8334" 9 | volumes: 10 | - ./data/mainnet:/btc/.btcd 11 | - ./config/mainnet-btcd.conf:/btc/.btcd/btcd.conf 12 | 13 | testnet: 14 | image: quay.io/openware/btcd:0.20.1-beta 15 | restart: always 16 | ports: 17 | - "0.0.0.0:18334:18334" 18 | volumes: 19 | volumes: 20 | - ./data/testnet:/btc/.btcd 21 | - ./config/testnet-btcd.conf:/btc/.btcd/btcd.conf 22 | -------------------------------------------------------------------------------- /dashd/.gitignore: -------------------------------------------------------------------------------- 1 | blocks/mainnet/blk00000.dat 2 | blocks/mainnet/index/ 3 | blocks/mainnet/rev00000.dat 4 | keys/mainnet/.walletlock 5 | keys/mainnet/db.log 6 | keys/mainnet/wallet.dat 7 | blocks/testnet/blk00000.dat 8 | blocks/testnet/index/ 9 | blocks/testnet/rev00000.dat 10 | keys/testnet/.walletlock 11 | keys/testnet/db.log 12 | keys/testnet/wallet.dat 13 | -------------------------------------------------------------------------------- /dashd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster 2 | 3 | ARG USER_ID 4 | ARG GROUP_ID 5 | 6 | ENV HOME /dash 7 | 8 | # add user with specified (or default) user/group ids 9 | ENV USER_ID ${USER_ID:-1000} 10 | ENV GROUP_ID ${GROUP_ID:-1000} 11 | RUN groupadd -g ${GROUP_ID} dash 12 | RUN useradd -u ${USER_ID} -g dash -s /bin/bash -m -d /dash dash 13 | 14 | RUN chown dash:dash -R /dash 15 | COPY checksum.sha256 /tmp/checksum.sha256 16 | COPY VERSION /tmp/VERSION 17 | 18 | RUN set -ex \ 19 | && apt-get update \ 20 | && apt-get install -qq --no-install-recommends ca-certificates dirmngr gosu gpg wget 21 | 22 | RUN set -ex \ 23 | && cd /tmp \ 24 | && wget -qO dashcore.tar.gz "https://github.com/dashpay/dash/releases/download/v$(cat VERSION)/dashcore-$(cat VERSION)-x86_64-linux-gnu.tar.gz" 25 | 26 | RUN cd /tmp && cat checksum.sha256 | sha256sum -c - 27 | RUN tar -xvf /tmp/dashcore.tar.gz -C /tmp/ 28 | RUN cp /tmp/dashcore*/bin/* /usr/local/bin 29 | RUN rm -rf /tmp/dashcore* 30 | 31 | ADD ./scripts /usr/local/bin 32 | RUN chmod a+x /usr/local/bin/* 33 | 34 | USER dash 35 | 36 | VOLUME ["/dash"] 37 | 38 | EXPOSE 9998 9999 19998 19999 39 | 40 | WORKDIR /dash 41 | 42 | CMD ["dash_oneshot"] 43 | -------------------------------------------------------------------------------- /dashd/README.md: -------------------------------------------------------------------------------- 1 | # Bitcoind 2 | 3 | ## Start the cryptonode 4 | 5 | ```shell 6 | docker-compose up -Vd *mainnet or testnet*` 7 | ``` 8 | 9 | ## Usage 10 | ### Create a new account 11 | 12 | ```shell 13 | curl -H "Content-Type: application/json" --data '{"method": "getnewaddress"}' rpcuser:rpcpassword@ip:port 14 | ``` 15 | Or, you can specify account and get this address assigned to new address 16 | 17 | ```shell 18 | curl -H "Content-Type: application/json" --data '{"method": "getnewaddress", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 19 | ``` 20 | 21 | Where 'billy' is your account name. You can check that your account was created properly: 22 | 23 | ```shell 24 | curl -H "Content-Type: application/json" --data '{"method": "getaddressesbyaccount", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 25 | ``` 26 | 27 | ### General Blockchain info 28 | 29 | ``` shell 30 | curl -H "Content-Type: application/json" --data '{"method": "getblockchaininfo"}' rpcuser:rpcpassword@ip:port 31 | ``` 32 | 33 | ### Account info 34 | 35 | To get account by address: 36 | 37 | ```shell 38 | curl -H "Content-Type: application/json" --data '{"method": "getaccount", "params": ["bchtest:qpkgrpazps220qtnzvlvlcm62urtnq0edv7ufjr95n"]}' rpcuser:rpcpassword@ip:port 39 | ``` 40 | 41 | To get addresses associated with account: 42 | 43 | ```shell 44 | curl -H "Content-Type: application/json" --data '{"method": "getaddressesbyaccount", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 45 | ``` 46 | 47 | To get account balance: 48 | 49 | ```shell 50 | curl -H "Content-Type: application/json" --data '{"method": "getbalance", "params": ["billy"]}' rpcuser:rpcpassword@ip:port 51 | ``` 52 | 53 | More: 54 | 55 | [Bitcoin RPC API](https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list) 56 | -------------------------------------------------------------------------------- /dashd/VERSION: -------------------------------------------------------------------------------- 1 | 0.16.1.1 2 | -------------------------------------------------------------------------------- /dashd/checksum.sha256: -------------------------------------------------------------------------------- 1 | 8803928bd18e9515f1254f97751eb6e537a084d66111ce7968eafb23e26bf3a5 dashcore.tar.gz 2 | -------------------------------------------------------------------------------- /dashd/config/mainnet-dash.conf: -------------------------------------------------------------------------------- 1 | upnp=0 2 | printtoconsole=1 3 | server=1 4 | rpcuser=deploy 5 | rpcpassword=changeme 6 | port=9999 7 | rpcport=9998 8 | rpcbind=0.0.0.0 9 | rpcallowip=0.0.0.0/0 10 | wallet=/dash/wallet 11 | -------------------------------------------------------------------------------- /dashd/config/testnet-dash.conf: -------------------------------------------------------------------------------- 1 | txindex=1 2 | upnp=0 3 | printtoconsole=1 4 | onlynet=ipv4 5 | server=1 6 | testnet=1 7 | rpcuser=deploy 8 | rpcpassword=changeme 9 | [test] 10 | port=19999 11 | rpcport=19998 12 | rpcbind=0.0.0.0 13 | rpcallowip=0.0.0.0/0 14 | wallet=/dash/wallet 15 | -------------------------------------------------------------------------------- /dashd/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '3.6' 2 | 3 | services: 4 | mainnet: 5 | image: quay.io/openware/dashd:0.16.1.1 6 | restart: always 7 | user: root 8 | ports: 9 | - "9998:9998" 10 | volumes: 11 | - ./keys/mainnet:/dash/wallet 12 | - ./blocks/mainnet:/dash/.dashcore/blocks 13 | - ./config/mainnet-dash.conf:/dash/.dashcore/dash.conf 14 | 15 | testnet: 16 | image: quay.io/openware/dashd:0.16.1.1 17 | restart: always 18 | user: root 19 | ports: 20 | - "19998:19998" 21 | volumes: 22 | - ./keys/testnet:/dash/wallet 23 | - ./blocks/testnet:/dash/.dashcore/testnet3/blocks 24 | - ./config/testnet-dash.conf:/dash/.dashcore/dash.conf 25 | -------------------------------------------------------------------------------- /dashd/scripts/dash_oneshot: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | if [ $# -gt 0 ]; then 6 | args=("$@") 7 | else 8 | args=("-rpcallowip=::/0") 9 | fi 10 | 11 | exec dashd "${args[@]}" 12 | -------------------------------------------------------------------------------- /electron-cash/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.8 2 | 3 | ARG VERSION 4 | ENV ELECTRONCASH_USER=electroncash 5 | ENV ELECTRONCASH_HOME=/home/$ELECTRONCASH_USER 6 | 7 | WORKDIR /root 8 | 9 | COPY checksum.sha256 . 10 | 11 | RUN cd \ 12 | && wget -q https://github.com/Electron-Cash/Electron-Cash/releases/download/${VERSION}/Electron-Cash-${VERSION}.tar.gz \ 13 | && sha256sum -c checksum.sha256 14 | 15 | RUN useradd -m $ELECTRONCASH_USER && \ 16 | pip3 install ~/Electron-Cash-${VERSION}.tar.gz && \ 17 | rm -f ~/Electron-Cash-${VERSION}.tar.gz 18 | 19 | RUN mkdir -p ${ELECTRONCASH_HOME}/.electron-cash/ /data && \ 20 | ln -sf ${ELECTRONCASH_HOME}/.electron-cash/ /data && \ 21 | chown ${ELECTRONCASH_USER} ${ELECTRONCASH_HOME}/.electron-cash /data 22 | 23 | USER $ELECTRONCASH_USER 24 | WORKDIR $ELECTRONCASH_HOME 25 | VOLUME /data 26 | EXPOSE 7000 27 | 28 | COPY start-electron-cash.py /usr/local/bin/ 29 | CMD ["/usr/local/bin/start-electron-cash.py"] 30 | -------------------------------------------------------------------------------- /electron-cash/README.md: -------------------------------------------------------------------------------- 1 | # Electron-cash server container 2 | 3 | Here are some examples of useful commands: 4 | 5 | ## List all available commands 6 | ```bash 7 | curl --data-binary '{"id":"curltext","method":"help","params":[]}' http://electrum:changeme@127.0.0.1:7000 8 | ``` 9 | 10 | ## Get the wallet balance 11 | ```bash 12 | curl --data-binary '{"id":"curltext","method":"getbalance","params":[]}' http://electrum:changeme@127.0.0.1:7000 13 | ``` 14 | 15 | ## Create a new wallet 16 | ```bash 17 | curl --data-binary '{"id":"curltext","method":"create","params":[null,"YourSecurePassphrase",true]}' http://electrum:changeme@127.0.0.1:7000 18 | ``` 19 | 20 | ## Create a new deposit address 21 | ```bash 22 | curl --data-binary '{"id":"curltext","method":"createnewaddress","params":[]}' http://electrum:changeme@127.0.0.1:7000 23 | ``` 24 | 25 | Here are the environment config 26 | 27 | ## WALLET_PASSPHRASE 28 | 29 | Passphrase of the wallet, this will encrypt the wallet 30 | 31 | ## VERBOSE 32 | 33 | Enable debug logs. Provide boolean. 34 | 35 | ## WALLET_SEED 36 | 37 | This can be used to restore wallet 38 | 39 | ## GAP_LIMIT 40 | 41 | Increase the Gap limit of your receiving wallets, by default only 20 wallets will be loaded this is bad if you have 100s of receiving wallets. 42 | 43 | ## TESTNET 44 | 45 | Enable testnet?, provide boolean 46 | 47 | ## ELECTRUM_USER 48 | 49 | Username for RPC 50 | 51 | ## ELECTRUM_PASSWORD 52 | 53 | Password for RPC -------------------------------------------------------------------------------- /electron-cash/VERSION: -------------------------------------------------------------------------------- 1 | 4.0.15 -------------------------------------------------------------------------------- /electron-cash/checksum.sha256: -------------------------------------------------------------------------------- 1 | 93dbdf5e1d784eba97c63dd6c17801c694a6277640b5da25e982cde643c2dcdb Electron-Cash-4.0.15.tar.gz 2 | -------------------------------------------------------------------------------- /electron-cash/start-electron-cash.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import asyncio 3 | import os 4 | import sys 5 | import warnings 6 | 7 | from electroncash import (networks, daemon) 8 | from electroncash.simple_config import SimpleConfig 9 | from electroncash.storage import WalletStorage 10 | from electroncash.util import (InvalidPassword, json_decode, json_encode, 11 | print_msg, print_stderr, set_verbosity) 12 | from electroncash.wallet import create_new_wallet, restore_wallet_from_text 13 | 14 | 15 | def init_plugins(config, gui_name): 16 | from electroncash.plugins import Plugins 17 | return Plugins(config, gui_name) 18 | 19 | 20 | config_options = { 21 | 'testnet': os.getenv("TESTNET", "true") == "true", 22 | "rpcuser": os.getenv("ELECTRUM_USER", "electrum"), 23 | "rpcpassword": os.getenv("ELECTRUM_PASSWORD", "changeme"), 24 | "rpcport": 7000, 25 | "rpchost": "0.0.0.0", 26 | 'cwd': os.getcwd(), 27 | 'auto_connect': True, 28 | 'verbose': os.getenv("VERBOSE", "false") == "true", 29 | 'wallet_password': os.getenv("WALLET_PASSPHRASE"), 30 | "noonion": True, 31 | } 32 | 33 | if __name__ == '__main__': 34 | set_verbosity(config_options.get('verbose')) 35 | if config_options.get('testnet'): 36 | networks.set_testnet() 37 | 38 | config = SimpleConfig(config_options) 39 | storage = WalletStorage(config.get_wallet_path()) 40 | seed = os.getenv("WALLET_SEED") 41 | gap_limit = int(os.getenv("GAP_LIMIT", "20")) 42 | 43 | if not storage.file_exists(): 44 | print_msg("Wallet doesn't exist, creating...") 45 | if seed is not None: 46 | restore_wallet_from_text(seed, 47 | path=storage.path, 48 | config=config, 49 | password=config_options['wallet_password'], 50 | encrypt_file=True) 51 | else: 52 | data = create_new_wallet(path=storage.path, 53 | config=config, 54 | password=config_options['wallet_password'], 55 | encrypt_file=True) 56 | storage = WalletStorage(storage.path) 57 | 58 | if storage.is_encrypted() is False: 59 | print_msg("Error: Wallet is unencrypted") 60 | sys.exit(1) 61 | 62 | fd, server = daemon.get_fd_or_server(config) 63 | if fd is not None: 64 | plugins = init_plugins(config, 'cmdline') 65 | d = daemon.Daemon(config, fd, False, plugins) 66 | 67 | d.server.register_function(lambda: wallet.get_local_height(), 'get_local_height') 68 | 69 | wallet = d.load_wallet(path=storage.path, 70 | password=config_options['wallet_password']) 71 | 72 | if wallet is None: 73 | raise Exception("Failed to load wallet") 74 | 75 | d.cmd_runner.wallet = wallet 76 | 77 | wallet.change_gap_limit( gap_limit ) 78 | 79 | if config.get('websocket_server'): 80 | from electroncash import websockets 81 | websockets.WebSocketServer(config, d.network).start() 82 | 83 | d.start() 84 | d.join() 85 | sys.exit(0) 86 | else: 87 | result = server.daemon(config) 88 | -------------------------------------------------------------------------------- /electrum-dash/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.7-alpine 2 | 3 | ARG VERSION 4 | 5 | WORKDIR /root 6 | 7 | COPY checksum.sha256 . 8 | 9 | ENV ELECTRUM_VERSION $VERSION 10 | ENV ELECTRUM_USER electrum 11 | ENV ELECTRUM_HOME /home/$ELECTRUM_USER 12 | 13 | RUN set -x && apk --update-cache add --virtual build-dependencies gcc musl-dev openssl-dev gmp-dev && \ 14 | adduser -D $ELECTRUM_USER && \ 15 | wget -q https://github.com/akhavr/electrum-dash/releases/download/${ELECTRUM_VERSION}/Dash-Electrum-${ELECTRUM_VERSION}.tar.gz && \ 16 | sha256sum -c checksum.sha256 && \ 17 | pip3 install Dash-Electrum-${ELECTRUM_VERSION}.tar.gz && \ 18 | apk del build-dependencies gcc musl-dev openssl-dev && \ 19 | rm -f Dash-Electrum-${ELECTRUM_VERSION}.tar.gz 20 | 21 | RUN mkdir -p ${ELECTRUM_HOME}/.electrum-dash/ /data && \ 22 | ln -sf ${ELECTRUM_HOME}/.electrum-dash/ /data && \ 23 | chown ${ELECTRUM_USER} ${ELECTRUM_HOME}/.electrum-dash /data 24 | 25 | # Install Kaigara 26 | ARG KAIGARA_VERSION=0.1.24 27 | RUN wget -O /usr/bin/kaigara https://github.com/openware/kaigara/releases/download/${KAIGARA_VERSION}/kaigara \ 28 | && chmod +x /usr/bin/kaigara 29 | 30 | USER $ELECTRUM_USER 31 | WORKDIR $ELECTRUM_HOME 32 | VOLUME /data 33 | EXPOSE 7000 34 | 35 | COPY start-electrum.py /usr/local/bin/ 36 | CMD ["/usr/local/bin/start-electrum.py"] 37 | -------------------------------------------------------------------------------- /electrum-dash/README.md: -------------------------------------------------------------------------------- 1 | # Electrum DASH docker container 2 | 3 | ## Quick Start 4 | 5 | ```bash 6 | WALLET_PASSPHRASE=$(pwgen -n 32 1) 7 | ELECTRUM_USER=electrum 8 | ELECTRUM_PASSWORD=$(pwgen -n 16 1) 9 | docker run -it -p 7000:7000 -e WALLET_PASSPHRASE="${WALLET_PASSPHRASE}" -e ELECTRUM_USER="${ELECTRUM_USER}" -e ELECTRUM_PASSWORD="${ELECTRUM_PASSWORD}" quay.io/openware/electrum-dash:3.3.8.7 10 | ``` 11 | 12 | 13 | 14 | ## Configuration 15 | 16 | You can configure Electrum with the following environment variables: 17 | 18 | | Variable | Example | Description | 19 | | ----------------- | -------- | ------------------------------------------------------------ | 20 | | WALLET_PASSPHRASE | | Passphrase used to encrypt the wallet | 21 | | SEGWIT | false | Enable SegWit (Segregated Witness), detailed in the BIP141 | 22 | | WALLET_SEED | | Provide the seed to restore the wallet on start | 23 | | GAP_LIMIT | 200 | The **gap limit** is the **maximum** number of consecutive unused addresses in your deterministic sequence of addresses. **Electrum** uses it in order to stop looking for addresses. The default value is 20, so the client will load all addresses until 20 unused addresses are found. | 24 | | TESTNET | true | Use testnet network instead of mainnet | 25 | | ELECTRUM_USER | electrum | Username to use to connect to RPC | 26 | | ELECTRUM_PASSWORD | | Password to use to connect to RPC | 27 | 28 | 29 | 30 | ## Example of RPC commands 31 | 32 | ### List all available commands 33 | 34 | ```bash 35 | curl --data-binary '{"id":"curltext","method":"help","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 36 | ``` 37 | 38 | ### Get the wallet balance 39 | 40 | ```bash 41 | curl --data-binary '{"id":"curltext","method":"getbalance","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 42 | ``` 43 | 44 | ### Get the wallet transactions history 45 | 46 | ```bash 47 | curl --data-binary '{"id":"curltext","method":"history","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 48 | ``` 49 | 50 | ### Create a new wallet 51 | 52 | ```bash 53 | curl --data-binary '{"id":"curltext","method":"create","params":[null,"YourSecurePassphrase",true]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 54 | ``` 55 | 56 | ### Create a new deposit address 57 | 58 | ```bash 59 | curl --data-binary '{"id":"curltext","method":"createnewaddress","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 60 | ``` 61 | 62 | -------------------------------------------------------------------------------- /electrum-dash/VERSION: -------------------------------------------------------------------------------- 1 | 3.3.8.7 -------------------------------------------------------------------------------- /electrum-dash/checksum.sha256: -------------------------------------------------------------------------------- 1 | b5c2ad070864041b194da9dbbb0d112fa2296d2386abafd2672546d68e9d13d0 Dash-Electrum-3.3.8.7.tar.gz 2 | -------------------------------------------------------------------------------- /electrum-dash/start-electrum.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | import warnings 5 | import aiohttp 6 | import asyncio 7 | from aiohttp import web, client_exceptions 8 | from electrum_dash.simple_config import SimpleConfig 9 | from electrum_dash import constants 10 | from electrum_dash import daemon 11 | from electrum_dash import logging 12 | from electrum_dash.logging import configure_logging 13 | from electrum_dash.util import create_and_start_event_loop 14 | from electrum_dash.network import filter_version, Network 15 | from electrum_dash.util import create_and_start_event_loop, log_exceptions 16 | from electrum_dash.wallet import create_new_wallet, restore_wallet_from_text 17 | from electrum_dash.logging import get_logger 18 | 19 | def init_plugins(config, gui_name): 20 | from electrum_dash.plugin import Plugins 21 | return Plugins(config, gui_name) 22 | 23 | cmdline_options = { 24 | "testnet": os.getenv("TESTNET", "true") == "true", 25 | "rpcuser": os.getenv("ELECTRUM_USER", "electrum"), 26 | "rpcpassword": os.getenv("ELECTRUM_PASSWORD", "changeme"), 27 | "rpcport": 7000, 28 | "rpchost": "0.0.0.0", 29 | "cwd": os.getcwd(), 30 | "verbosity": 3, 31 | # "oneserver": True, 32 | "noonion": True, 33 | } 34 | 35 | _logger = get_logger(__name__) 36 | 37 | if __name__ == '__main__': 38 | passphrase = os.getenv("WALLET_PASSPHRASE") 39 | seed = os.getenv("WALLET_SEED") 40 | gap_limit = int(os.getenv("GAP_LIMIT", "20")) 41 | 42 | if passphrase is None: 43 | raise Exception("WALLET_PASSPHRASE unset") 44 | 45 | if cmdline_options["testnet"]: 46 | constants.set_testnet() 47 | 48 | config = SimpleConfig(cmdline_options) 49 | logging.configure_logging(config) 50 | fd, server = daemon.get_fd_or_server(config) 51 | 52 | if fd is not None: 53 | init_plugins(config, 'cmdline') 54 | d = daemon.Daemon(config, fd) 55 | path = config.get_wallet_path() 56 | if os.path.exists(path) is False: 57 | _logger.warn("Wallet doesn't exist, creating") 58 | if seed is not None: 59 | restore_wallet_from_text(seed, 60 | path=path, 61 | password=passphrase, 62 | encrypt_file=True) 63 | else: 64 | create_new_wallet(path=path, 65 | password=passphrase, 66 | encrypt_file=True) 67 | wallet = d.load_wallet(path, passphrase) 68 | if wallet is None: 69 | raise Exception("Failed to load wallet") 70 | d.cmd_runner.wallet = wallet 71 | wallet.change_gap_limit( gap_limit ) 72 | daemon.run_hook('load_wallet', wallet, None) 73 | d.server.register_function(lambda: wallet.get_local_height(), 'get_local_height') 74 | d.join() 75 | sys.exit(0) 76 | else: 77 | result = server.daemon(config) 78 | -------------------------------------------------------------------------------- /electrum-ltc/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.7-alpine 2 | 3 | ARG VERSION 4 | 5 | WORKDIR /root 6 | 7 | COPY checksum.sha256 . 8 | 9 | ENV ELECTRUM_VERSION $VERSION 10 | ENV ELECTRUM_USER electrum 11 | ENV ELECTRUM_HOME /home/$ELECTRUM_USER 12 | 13 | RUN set -x && apk --update-cache add --virtual build-dependencies gcc musl-dev openssl-dev && \ 14 | adduser -D $ELECTRUM_USER && \ 15 | wget -q https://github.com/pooler/electrum-ltc/archive/${ELECTRUM_VERSION}.tar.gz && \ 16 | cat checksum.sha256 | grep ${VERSION} | sha256sum -c && \ 17 | pip3 install scrypt && \ 18 | pip3 install ${ELECTRUM_VERSION}.tar.gz && \ 19 | apk del build-dependencies 20 | 21 | RUN mkdir -p ${ELECTRUM_HOME}/.electrum-ltc/ /data && \ 22 | ln -sf ${ELECTRUM_HOME}/.electrum-ltc/ /data && \ 23 | chown ${ELECTRUM_USER} ${ELECTRUM_HOME}/.electrum-ltc /data 24 | 25 | # Install Kaigara 26 | ARG KAIGARA_VERSION=0.1.24 27 | RUN wget -O /usr/bin/kaigara https://github.com/openware/kaigara/releases/download/${KAIGARA_VERSION}/kaigara \ 28 | && chmod +x /usr/bin/kaigara 29 | 30 | USER $ELECTRUM_USER 31 | WORKDIR $ELECTRUM_HOME 32 | VOLUME /data 33 | EXPOSE 7000 34 | 35 | COPY start-electrum.py /usr/local/bin/ 36 | CMD ["/usr/local/bin/start-electrum.py"] 37 | -------------------------------------------------------------------------------- /electrum-ltc/README.md: -------------------------------------------------------------------------------- 1 | # Electrum LTC server docker container 2 | 3 | ## Quick Start 4 | 5 | ```bash 6 | WALLET_PASSPHRASE=$(pwgen -n 32 1) 7 | ELECTRUM_USER=electrum 8 | ELECTRUM_PASSWORD=$(pwgen -n 16 1) 9 | docker run -it -p 7000:7000 -e WALLET_PASSPHRASE="${WALLET_PASSPHRASE}" -e ELECTRUM_USER="${ELECTRUM_USER}" -e ELECTRUM_PASSWORD="${ELECTRUM_PASSWORD}" quay.io/openware/electrum-ltc:3.3.8.1 10 | ``` 11 | 12 | 13 | 14 | ## Configuration 15 | 16 | You can configure Electrum with the following environment variables: 17 | 18 | | Variable | Example | Description | 19 | | ----------------- | -------- | ------------------------------------------------------------ | 20 | | WALLET_PASSPHRASE | | Passphrase used to encrypt the wallet | 21 | | SEGWIT | false | Enable SegWit (Segregated Witness), detailed in the BIP141 | 22 | | WALLET_SEED | | Provide the seed to restore the wallet on start | 23 | | GAP_LIMIT | 200 | The **gap limit** is the **maximum** number of consecutive unused addresses in your deterministic sequence of addresses. **Electrum** uses it in order to stop looking for addresses. The default value is 20, so the client will load all addresses until 20 unused addresses are found. | 24 | | TESTNET | true | Use testnet network instead of mainnet | 25 | | ELECTRUM_USER | electrum | Username to use to connect to RPC | 26 | | ELECTRUM_PASSWORD | | Password to use to connect to RPC | 27 | 28 | 29 | 30 | ## Example of RPC commands 31 | 32 | ### List all available commands 33 | 34 | ```bash 35 | curl --data-binary '{"id":"curltext","method":"help","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 36 | ``` 37 | 38 | ### Get the wallet balance 39 | 40 | ```bash 41 | curl --data-binary '{"id":"curltext","method":"getbalance","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 42 | ``` 43 | 44 | ### Get the wallet transactions history 45 | 46 | ```bash 47 | curl --data-binary '{"id":"curltext","method":"history","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 48 | ``` 49 | 50 | ### Create a new wallet 51 | 52 | ```bash 53 | curl --data-binary '{"id":"curltext","method":"create","params":[null,"YourSecurePassphrase",true]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 54 | ``` 55 | 56 | ### Create a new deposit address 57 | 58 | ```bash 59 | curl --data-binary '{"id":"curltext","method":"createnewaddress","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 60 | ``` 61 | 62 | -------------------------------------------------------------------------------- /electrum-ltc/VERSION: -------------------------------------------------------------------------------- 1 | 3.3.8.1 -------------------------------------------------------------------------------- /electrum-ltc/checksum.sha256: -------------------------------------------------------------------------------- 1 | 6f4049abacfdb125b968e841ec9bc01e386e475f3fac8534103ffea1257b0f0f 3.3.8.1.tar.gz 2 | -------------------------------------------------------------------------------- /electrum-ltc/start-electrum.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | import warnings 5 | import aiohttp 6 | import asyncio 7 | from aiohttp import web, client_exceptions 8 | from electrum_ltc.simple_config import SimpleConfig 9 | from electrum_ltc import constants 10 | from electrum_ltc import daemon 11 | from electrum_ltc import logging 12 | from electrum_ltc.logging import configure_logging 13 | from electrum_ltc.util import create_and_start_event_loop 14 | from electrum_ltc.network import filter_version, Network 15 | from electrum_ltc.util import create_and_start_event_loop, log_exceptions 16 | from electrum_ltc.wallet import create_new_wallet, restore_wallet_from_text 17 | from electrum_ltc.logging import get_logger 18 | 19 | def init_plugins(config, gui_name): 20 | from electrum_ltc.plugin import Plugins 21 | return Plugins(config, gui_name) 22 | 23 | cmdline_options = { 24 | "testnet": os.getenv("TESTNET", "true") == "true", 25 | "rpcuser": os.getenv("ELECTRUM_USER", "electrum"), 26 | "rpcpassword": os.getenv("ELECTRUM_PASSWORD", "changeme"), 27 | "rpcport": 7000, 28 | "rpchost": "0.0.0.0", 29 | "cwd": os.getcwd(), 30 | "verbosity": 3, 31 | # "oneserver": True, 32 | "noonion": True, 33 | } 34 | 35 | _logger = get_logger(__name__) 36 | 37 | if __name__ == '__main__': 38 | passphrase = os.getenv("WALLET_PASSPHRASE") 39 | segwit = os.getenv("SEGWIT") == "true" 40 | seed = os.getenv("WALLET_SEED") 41 | gap_limit = int(os.getenv("GAP_LIMIT", "20")) 42 | 43 | if passphrase is None: 44 | raise Exception("WALLET_PASSPHRASE unset") 45 | 46 | if cmdline_options["testnet"]: 47 | constants.set_testnet() 48 | 49 | config = SimpleConfig(cmdline_options) 50 | logging.configure_logging(config) 51 | fd, server = daemon.get_fd_or_server(config) 52 | 53 | if fd is not None: 54 | init_plugins(config, 'cmdline') 55 | d = daemon.Daemon(config, fd) 56 | path = config.get_wallet_path() 57 | if os.path.exists(path) is False: 58 | _logger.warn("Wallet doesn't exist, creating (segwit {segwit})".format(segwit=segwit)) 59 | if seed is not None: 60 | restore_wallet_from_text(seed, 61 | path=path, 62 | password=passphrase, 63 | encrypt_file=True) 64 | else: 65 | create_new_wallet(path=path, 66 | password=passphrase, 67 | encrypt_file=True, 68 | segwit=segwit) 69 | wallet = d.load_wallet(path, passphrase) 70 | if wallet is None: 71 | raise Exception("Failed to load wallet") 72 | d.cmd_runner.wallet = wallet 73 | wallet.change_gap_limit( gap_limit ) 74 | daemon.run_hook('load_wallet', wallet, None) 75 | d.server.register_function(lambda: wallet.get_local_height(), 'get_local_height') 76 | d.join() 77 | sys.exit(0) 78 | else: 79 | result = server.daemon(config) 80 | -------------------------------------------------------------------------------- /electrum/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.7-alpine 2 | 3 | ARG VERSION 4 | 5 | WORKDIR /root 6 | 7 | COPY checksum.sha256 . 8 | 9 | ENV ELECTRUM_VERSION 3.3.8 10 | ENV ELECTRUM_USER electrum 11 | ENV ELECTRUM_HOME /home/$ELECTRUM_USER 12 | 13 | RUN set -x && apk --update-cache add --virtual build-dependencies gcc musl-dev && \ 14 | adduser -D $ELECTRUM_USER && \ 15 | wget -q https://download.electrum.org/${ELECTRUM_VERSION}/Electrum-${ELECTRUM_VERSION}.tar.gz && \ 16 | sha256sum -c checksum.sha256 && \ 17 | pip3 install Electrum-${ELECTRUM_VERSION}.tar.gz && \ 18 | apk del build-dependencies 19 | 20 | RUN mkdir -p ${ELECTRUM_HOME}/.electrum/ /data && \ 21 | ln -sf ${ELECTRUM_HOME}/.electrum/ /data && \ 22 | chown ${ELECTRUM_USER} ${ELECTRUM_HOME}/.electrum /data 23 | 24 | # Install Kaigara 25 | ARG KAIGARA_VERSION=0.1.24 26 | RUN wget -O /usr/bin/kaigara https://github.com/openware/kaigara/releases/download/${KAIGARA_VERSION}/kaigara \ 27 | && chmod +x /usr/bin/kaigara 28 | 29 | USER $ELECTRUM_USER 30 | WORKDIR $ELECTRUM_HOME 31 | VOLUME /data 32 | EXPOSE 7000 33 | 34 | COPY start-electrum.py /usr/local/bin/ 35 | CMD ["/usr/local/bin/start-electrum.py"] 36 | -------------------------------------------------------------------------------- /electrum/README.md: -------------------------------------------------------------------------------- 1 | # Electrum Bitcoin server docker container 2 | 3 | ## Quick Start 4 | 5 | ```bash 6 | WALLET_PASSPHRASE=$(pwgen -n 32 1) 7 | ELECTRUM_USER=electrum 8 | ELECTRUM_PASSWORD=$(pwgen -n 16 1) 9 | docker run -it -p 7000:7000 -e WALLET_PASSPHRASE="${WALLET_PASSPHRASE}" -e ELECTRUM_USER="${ELECTRUM_USER}" -e ELECTRUM_PASSWORD="${ELECTRUM_PASSWORD}" quay.io/openware/electrum:3.3.8 10 | ``` 11 | 12 | ## Configuration 13 | 14 | You can configure Electrum with the following environment variables: 15 | 16 | | Variable | Example | Description | 17 | | ----------------- | -------- | ------------------------------------------------------------ | 18 | | WALLET_PASSPHRASE | | Passphrase used to encrypt the wallet | 19 | | SEGWIT | false | Enable SegWit (Segregated Witness), detailed in the BIP141 | 20 | | WALLET_SEED | | Provide the seed to restore the wallet on start | 21 | | GAP_LIMIT | 200 | The **gap limit** is the **maximum** number of consecutive unused addresses in your deterministic sequence of addresses. **Electrum** uses it in order to stop looking for addresses. The default value is 20, so the client will load all addresses until 20 unused addresses are found. | 22 | | TESTNET | true | Use testnet network instead of mainnet | 23 | | ELECTRUM_USER | electrum | Username to use to connect to RPC | 24 | | ELECTRUM_PASSWORD | | Password to use to connect to RPC | 25 | 26 | ## Example of RPC commands 27 | 28 | ### List all available commands 29 | ```bash 30 | curl --data-binary '{"id":"curltext","method":"help","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 31 | ``` 32 | 33 | ### Get the wallet balance 34 | ```bash 35 | curl --data-binary '{"id":"curltext","method":"getbalance","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 36 | ``` 37 | 38 | ### Get the wallet transactions history 39 | ```bash 40 | curl --data-binary '{"id":"curltext","method":"history","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 41 | ``` 42 | 43 | ### Create a new wallet 44 | ```bash 45 | curl --data-binary '{"id":"curltext","method":"create","params":[null,"YourSecurePassphrase",true]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 46 | ``` 47 | 48 | ### Create a new deposit address 49 | ```bash 50 | curl --data-binary '{"id":"curltext","method":"createnewaddress","params":[]}' http://${ELECTRUM_USER}:${ELECTRUM_PASSWORD}@127.0.0.1:7000 51 | ``` 52 | 53 | ## List of available RPC methods 54 | 55 | | Method | Description | 56 | | ----------------- | ------------------------------------------------------ | 57 | | addrequest | Create a payment request, using the first unused address of the wallet | 58 | | addtransaction | Add a transaction to the wallet history | 59 | | broadcast | Broadcast a transaction to the network | 60 | | clearrequests | Remove all payment requests | 61 | | commands | List of commands | 62 | | convert_xkey | Convert xtype of a master key | 63 | | create | Create a new wallet | 64 | | createmultisig | Create multisig address | 65 | | createnewaddress | Create a new receiving address, beyond the gap limit of the wallet | 66 | | decrypt | Decrypt a message encrypted with a public key | 67 | | deserialize | Deserialize a serialized transaction | 68 | | dumpprivkeys | Deprecated | 69 | | encrypt | Encrypt a message with a public key | 70 | | freeze | Freeze address | 71 | | get | Return item from wallet storage | 72 | | get_tx_status | Returns some information regarding the tx | 73 | | getaddressbalance | Return the balance of any address | 74 | | getaddresshistory | Return the transaction history of any address | 75 | | getaddressunspent | Returns the UTXO list of any address | 76 | | getalias | Retrieve alias | 77 | | getbalance | Return the balance of your wallet | 78 | | getconfig | Return a configuration variable | 79 | | getfeerate | Return current suggested fee rate (in sat/kvByte), according to config settings or supplied parameters | 80 | | getmasterprivate | Get master private key | 81 | | getmerkle | Get Merkle branch of a transaction included in a block | 82 | | getmpk | Get master public key | 83 | | getprivatekeys | Get private keys of addresses | 84 | | getpubkeys | Return the public keys for a wallet address | 85 | | getrequest | Return a payment request | 86 | | getseed | Get seed phrase | 87 | | getservers | Return the list of available servers | 88 | | gettransaction | Retrieve a transaction | 89 | | getunusedaddress | Returns the first unused address of the wallet, or None if all addresses are used | 90 | | help | List all available methods | 91 | | history | Wallet history | 92 | | importprivkey | Import a private key | 93 | | is_synchronized | return wallet synchronization status | 94 | | ismine | Check if address is in wallet | 95 | | listaddresses | List wallet addresses | 96 | | listcontacts | Show your list of contacts | 97 | | listrequests | List the payment requests you made | 98 | | listunspent | List unspent outputs | 99 | | make_seed | Create a seed | 100 | | notify | Watch an address | 101 | | password | Change wallet password | 102 | | payto | Create a transaction | 103 | | paytomany | Create a multi-output transaction | 104 | | removelocaltx | Remove a 'local' transaction from the wallet, and its dependent transactions | 105 | | restore | Restore a wallet from text | 106 | | rmrequest | Remove a payment request | 107 | | searchcontacts | Search through contacts, return matching entries | 108 | | serialize | Create a transaction from json inputs | 109 | | setconfig | Set a configuration variable | 110 | | setlabel | Assign a label to an item | 111 | | signmessage | Sign a message with a key | 112 | | signrequest | Sign payment request with an OpenAlias | 113 | | signtransaction | Sign a transaction | 114 | | sweep | Sweep private keys | 115 | | unfreeze | Unfreeze address | 116 | | validateaddress | Check that an address is valid | 117 | | verifymessage | Verify a signature | 118 | | version | Return the version of Electrum | 119 | -------------------------------------------------------------------------------- /electrum/VERSION: -------------------------------------------------------------------------------- 1 | 3.3.8-1 2 | -------------------------------------------------------------------------------- /electrum/checksum.sha256: -------------------------------------------------------------------------------- 1 | e2adf191847609d5bd850320f647db6347952b170364a463276db27a836400bc Electrum-3.3.8.tar.gz 2 | -------------------------------------------------------------------------------- /electrum/start-electrum.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import os 3 | import sys 4 | import warnings 5 | import aiohttp 6 | import asyncio 7 | from aiohttp import web, client_exceptions 8 | from electrum.simple_config import SimpleConfig 9 | from electrum import constants 10 | from electrum import daemon 11 | from electrum import logging 12 | from electrum.logging import configure_logging 13 | from electrum.util import create_and_start_event_loop 14 | from electrum.network import filter_version, Network 15 | from electrum.util import create_and_start_event_loop, log_exceptions 16 | from electrum.wallet import create_new_wallet, restore_wallet_from_text 17 | from electrum.logging import get_logger 18 | 19 | def init_plugins(config, gui_name): 20 | from electrum.plugin import Plugins 21 | return Plugins(config, gui_name) 22 | 23 | cmdline_options = { 24 | "testnet": os.getenv("TESTNET", "true") == "true", 25 | "rpcuser": os.getenv("ELECTRUM_USER", "electrum"), 26 | "rpcpassword": os.getenv("ELECTRUM_PASSWORD", "changeme"), 27 | "rpcport": 7000, 28 | "rpchost": "0.0.0.0", 29 | "cwd": os.getcwd(), 30 | "verbosity": 3, 31 | # "oneserver": True, 32 | "noonion": True, 33 | } 34 | 35 | _logger = get_logger(__name__) 36 | 37 | if __name__ == '__main__': 38 | passphrase = os.getenv("WALLET_PASSPHRASE") 39 | segwit = os.getenv("SEGWIT") == "true" 40 | seed = os.getenv("WALLET_SEED") 41 | gap_limit = int(os.getenv("GAP_LIMIT", "20")) 42 | 43 | if passphrase is None: 44 | raise Exception("WALLET_PASSPHRASE unset") 45 | 46 | if cmdline_options["testnet"]: 47 | constants.set_testnet() 48 | 49 | config = SimpleConfig(cmdline_options) 50 | logging.configure_logging(config) 51 | fd, server = daemon.get_fd_or_server(config) 52 | 53 | if fd is not None: 54 | init_plugins(config, 'cmdline') 55 | d = daemon.Daemon(config, fd) 56 | path = config.get_wallet_path() 57 | if os.path.exists(path) is False: 58 | _logger.warn("Wallet doesn't exist, creating (segwit {segwit})".format(segwit=segwit)) 59 | if seed is not None: 60 | restore_wallet_from_text(seed, 61 | path=path, 62 | password=passphrase, 63 | encrypt_file=True) 64 | else: 65 | create_new_wallet(path=path, 66 | password=passphrase, 67 | encrypt_file=True, 68 | segwit=segwit) 69 | wallet = d.load_wallet(path, passphrase) 70 | if wallet is None: 71 | raise Exception("Failed to load wallet") 72 | d.cmd_runner.wallet = wallet 73 | wallet.change_gap_limit( gap_limit ) 74 | daemon.run_hook('load_wallet', wallet, None) 75 | d.server.register_function(lambda: wallet.get_local_height(), 'get_local_height') 76 | d.join() 77 | sys.exit(0) 78 | else: 79 | result = server.daemon(config) 80 | -------------------------------------------------------------------------------- /fluentd/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM fluent/fluentd:v1.11-debian 2 | 3 | USER root 4 | WORKDIR /home/fluent 5 | ENV PATH /fluentd/vendor/bundle/ruby/2.6.0/bin:$PATH 6 | ENV GEM_PATH /fluentd/vendor/bundle/ruby/2.6.0 7 | ENV GEM_HOME /fluentd/vendor/bundle/ruby/2.6.0 8 | # skip runtime bundler installation 9 | ENV FLUENTD_DISABLE_BUNDLER_INJECTION 1 10 | 11 | COPY Gemfile* /fluentd/ 12 | RUN buildDeps="sudo make gcc g++ libc-dev libffi-dev" \ 13 | runtimeDeps="" \ 14 | && apt-get update \ 15 | && apt-get upgrade -y \ 16 | && apt-get install \ 17 | -y --no-install-recommends \ 18 | $buildDeps $runtimeDeps net-tools \ 19 | && gem install bundler --version 2.1.4 \ 20 | && bundle config silence_root_warning true \ 21 | && bundle install --gemfile=/fluentd/Gemfile --path=/fluentd/vendor/bundle \ 22 | && SUDO_FORCE_REMOVE=yes \ 23 | apt-get purge -y --auto-remove \ 24 | -o APT::AutoRemove::RecommendsImportant=false \ 25 | $buildDeps \ 26 | && rm -rf /var/lib/apt/lists/* \ 27 | && gem sources --clear-all \ 28 | && rm -rf /tmp/* /var/tmp/* /usr/lib/ruby/gems/*/cache/*.gem 29 | 30 | # Copy configuration files 31 | COPY ./conf/fluent.conf /fluentd/etc/ 32 | COPY ./conf/systemd.conf /fluentd/etc/ 33 | COPY ./conf/kubernetes.conf /fluentd/etc/ 34 | COPY ./conf/prometheus.conf /fluentd/etc/ 35 | RUN touch /fluentd/etc/disable.conf 36 | 37 | # Copy plugins 38 | COPY plugins /fluentd/plugins/ 39 | COPY entrypoint.sh /fluentd/entrypoint.sh 40 | 41 | # Environment variables 42 | ENV FLUENTD_OPT="" 43 | ENV FLUENTD_CONF="fluent.conf" 44 | 45 | # Overwrite ENTRYPOINT to run fluentd as root for /var/log / /var/lib 46 | ENTRYPOINT ["tini", "--", "/fluentd/entrypoint.sh"] 47 | -------------------------------------------------------------------------------- /fluentd/Gemfile: -------------------------------------------------------------------------------- 1 | # frozen_string_literal: true 2 | 3 | source 'https://rubygems.org' 4 | 5 | gem 'elasticsearch', '~> 7.0' 6 | gem 'elasticsearch-xpack', '~> 7.4.0' 7 | gem 'ffi' 8 | gem 'fluent-plugin-concat', '~> 2.4.0' 9 | gem 'fluent-plugin-dedot_filter', '~> 1.0' 10 | gem 'fluent-plugin-detect-exceptions', '~> 0.0.12' 11 | gem 'fluent-plugin-elasticsearch', '~> 4.0.3' 12 | gem 'fluent-plugin-filter-logs', '~> 1.0' 13 | gem 'fluent-plugin-grok-parser', '~> 2.6.0' 14 | gem 'fluent-plugin-json-in-json-2', '>= 1.0.2' 15 | gem 'fluent-plugin-kubernetes_metadata_filter', '~> 2.4.0' 16 | gem 'fluent-plugin-multi-format-parser', '~> 1.0.0' 17 | gem 'fluent-plugin-prometheus', '~> 1.6.1' 18 | gem 'fluent-plugin-record-modifier', '~> 2.0.0' 19 | gem 'fluent-plugin-rewrite-tag-filter', '~> 2.2.0' 20 | gem 'fluent-plugin-systemd', '~> 1.0.1' 21 | gem 'fluentd', '1.9.3' 22 | gem 'oj', '3.8.1' 23 | -------------------------------------------------------------------------------- /fluentd/Gemfile.lock: -------------------------------------------------------------------------------- 1 | GEM 2 | remote: https://rubygems.org/ 3 | specs: 4 | addressable (2.7.0) 5 | public_suffix (>= 2.0.2, < 5.0) 6 | concurrent-ruby (1.1.6) 7 | cool.io (1.6.0) 8 | domain_name (0.5.20190701) 9 | unf (>= 0.0.5, < 1.0.0) 10 | elasticsearch (7.7.0) 11 | elasticsearch-api (= 7.7.0) 12 | elasticsearch-transport (= 7.7.0) 13 | elasticsearch-api (7.7.0) 14 | multi_json 15 | elasticsearch-transport (7.7.0) 16 | faraday (~> 1) 17 | multi_json 18 | elasticsearch-xpack (7.4.0) 19 | elasticsearch-api (>= 6) 20 | excon (0.74.0) 21 | faraday (1.0.1) 22 | multipart-post (>= 1.2, < 3) 23 | ffi (1.13.1) 24 | ffi-compiler (1.0.1) 25 | ffi (>= 1.0.0) 26 | rake 27 | fluent-config-regexp-type (1.0.0) 28 | fluentd (> 1.0.0, < 2) 29 | fluent-plugin-concat (2.4.0) 30 | fluentd (>= 0.14.0, < 2) 31 | fluent-plugin-dedot_filter (1.0.0) 32 | fluentd (>= 0.14.0, < 2) 33 | fluent-plugin-detect-exceptions (0.0.13) 34 | fluentd (>= 0.10) 35 | fluent-plugin-elasticsearch (4.0.9) 36 | elasticsearch 37 | excon 38 | fluentd (>= 0.14.22) 39 | fluent-plugin-filter-logs (1.1.0) 40 | fluentd (>= 0.14.10, < 2) 41 | logfmt (~> 0.0.9) 42 | fluent-plugin-grok-parser (2.6.1) 43 | fluentd (>= 0.14.6, < 2) 44 | fluent-plugin-json-in-json-2 (1.0.2) 45 | fluentd (>= 0.14.0, < 2) 46 | yajl-ruby (~> 1.0) 47 | fluent-plugin-kubernetes_metadata_filter (2.4.6) 48 | fluentd (>= 0.14.0, < 1.10) 49 | kubeclient (< 5) 50 | lru_redux 51 | fluent-plugin-multi-format-parser (1.0.0) 52 | fluentd (>= 0.14.0, < 2) 53 | fluent-plugin-prometheus (1.6.1) 54 | fluentd (>= 0.14.20, < 2) 55 | prometheus-client (< 0.10) 56 | fluent-plugin-record-modifier (2.0.1) 57 | fluentd (>= 1.0, < 2) 58 | fluent-plugin-rewrite-tag-filter (2.2.0) 59 | fluent-config-regexp-type 60 | fluentd (>= 0.14.2, < 2) 61 | fluent-plugin-systemd (1.0.2) 62 | fluentd (>= 0.14.11, < 2) 63 | systemd-journal (~> 1.3.2) 64 | fluentd (1.9.3) 65 | cool.io (>= 1.4.5, < 2.0.0) 66 | http_parser.rb (>= 0.5.1, < 0.7.0) 67 | msgpack (>= 1.3.1, < 2.0.0) 68 | serverengine (>= 2.0.4, < 3.0.0) 69 | sigdump (~> 0.2.2) 70 | strptime (>= 0.2.2, < 1.0.0) 71 | tzinfo (>= 1.0, < 3.0) 72 | tzinfo-data (~> 1.0) 73 | yajl-ruby (~> 1.0) 74 | http (4.4.1) 75 | addressable (~> 2.3) 76 | http-cookie (~> 1.0) 77 | http-form_data (~> 2.2) 78 | http-parser (~> 1.2.0) 79 | http-accept (1.7.0) 80 | http-cookie (1.0.3) 81 | domain_name (~> 0.5) 82 | http-form_data (2.3.0) 83 | http-parser (1.2.1) 84 | ffi-compiler (>= 1.0, < 2.0) 85 | http_parser.rb (0.6.0) 86 | kubeclient (4.7.0) 87 | http (>= 3.0, < 5.0) 88 | recursive-open-struct (~> 1.1, >= 1.1.1) 89 | rest-client (~> 2.0) 90 | logfmt (0.0.9) 91 | lru_redux (1.1.0) 92 | mime-types (3.3.1) 93 | mime-types-data (~> 3.2015) 94 | mime-types-data (3.2020.0512) 95 | msgpack (1.3.3) 96 | multi_json (1.14.1) 97 | multipart-post (2.1.1) 98 | netrc (0.11.0) 99 | oj (3.8.1) 100 | prometheus-client (0.9.0) 101 | quantile (~> 0.2.1) 102 | public_suffix (4.0.5) 103 | quantile (0.2.1) 104 | rake (13.0.1) 105 | recursive-open-struct (1.1.1) 106 | rest-client (2.1.0) 107 | http-accept (>= 1.7.0, < 2.0) 108 | http-cookie (>= 1.0.2, < 2.0) 109 | mime-types (>= 1.16, < 4.0) 110 | netrc (~> 0.8) 111 | serverengine (2.2.1) 112 | sigdump (~> 0.2.2) 113 | sigdump (0.2.4) 114 | strptime (0.2.4) 115 | systemd-journal (1.3.3) 116 | ffi (~> 1.9) 117 | tzinfo (2.0.2) 118 | concurrent-ruby (~> 1.0) 119 | tzinfo-data (1.2020.1) 120 | tzinfo (>= 1.0.0) 121 | unf (0.1.4) 122 | unf_ext 123 | unf_ext (0.0.7.7) 124 | yajl-ruby (1.4.1) 125 | 126 | PLATFORMS 127 | ruby 128 | 129 | DEPENDENCIES 130 | elasticsearch (~> 7.0) 131 | elasticsearch-xpack (~> 7.4.0) 132 | ffi 133 | fluent-plugin-concat (~> 2.4.0) 134 | fluent-plugin-dedot_filter (~> 1.0) 135 | fluent-plugin-detect-exceptions (~> 0.0.12) 136 | fluent-plugin-elasticsearch (~> 4.0.3) 137 | fluent-plugin-filter-logs (~> 1.0) 138 | fluent-plugin-grok-parser (~> 2.6.0) 139 | fluent-plugin-json-in-json-2 (>= 1.0.2) 140 | fluent-plugin-kubernetes_metadata_filter (~> 2.4.0) 141 | fluent-plugin-multi-format-parser (~> 1.0.0) 142 | fluent-plugin-prometheus (~> 1.6.1) 143 | fluent-plugin-record-modifier (~> 2.0.0) 144 | fluent-plugin-rewrite-tag-filter (~> 2.2.0) 145 | fluent-plugin-systemd (~> 1.0.1) 146 | fluentd (= 1.9.3) 147 | oj (= 3.8.1) 148 | 149 | BUNDLED WITH 150 | 1.17.3 151 | -------------------------------------------------------------------------------- /fluentd/VERSION: -------------------------------------------------------------------------------- 1 | 1.11.0-1 2 | -------------------------------------------------------------------------------- /fluentd/conf/fluent.conf: -------------------------------------------------------------------------------- 1 | 2 | @include "#{ENV['FLUENTD_SYSTEMD_CONF'] || 'systemd'}.conf" 3 | @include "#{ENV['FLUENTD_PROMETHEUS_CONF'] || 'prometheus'}.conf" 4 | @include kubernetes.conf 5 | @include conf.d/*.conf 6 | 7 | 8 | @type logs 9 | 10 | 11 | 12 | @type grep 13 | 14 | 15 | key level 16 | pattern /^(DEBUG)$/ 17 | 18 | 19 | 20 | 21 | @type elasticsearch 22 | @id out_es 23 | @log_level info 24 | include_tag_key true 25 | host "#{ENV['FLUENT_ELASTICSEARCH_HOST']}" 26 | port "#{ENV['FLUENT_ELASTICSEARCH_PORT']}" 27 | path "#{ENV['FLUENT_ELASTICSEARCH_PATH']}" 28 | scheme "#{ENV['FLUENT_ELASTICSEARCH_SCHEME'] || 'http'}" 29 | ssl_verify "#{ENV['FLUENT_ELASTICSEARCH_SSL_VERIFY'] || 'true'}" 30 | ssl_version "#{ENV['FLUENT_ELASTICSEARCH_SSL_VERSION'] || 'TLSv1_2'}" 31 | user "#{ENV['FLUENT_ELASTICSEARCH_USER'] || use_default}" 32 | password "#{ENV['FLUENT_ELASTICSEARCH_PASSWORD'] || use_default}" 33 | reload_connections "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_CONNECTIONS'] || 'false'}" 34 | reconnect_on_error "#{ENV['FLUENT_ELASTICSEARCH_RECONNECT_ON_ERROR'] || 'true'}" 35 | reload_on_failure "#{ENV['FLUENT_ELASTICSEARCH_RELOAD_ON_FAILURE'] || 'true'}" 36 | log_es_400_reason "#{ENV['FLUENT_ELASTICSEARCH_LOG_ES_400_REASON'] || 'false'}" 37 | logstash_prefix "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_PREFIX'] || 'logstash'}" 38 | logstash_dateformat "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_DATEFORMAT'] || '%Y.%m.%d'}" 39 | logstash_format "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_FORMAT'] || 'true'}" 40 | index_name "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_INDEX_NAME'] || 'logstash'}" 41 | type_name "#{ENV['FLUENT_ELASTICSEARCH_LOGSTASH_TYPE_NAME'] || 'fluentd'}" 42 | include_timestamp "#{ENV['FLUENT_ELASTICSEARCH_INCLUDE_TIMESTAMP'] || 'false'}" 43 | template_name "#{ENV['FLUENT_ELASTICSEARCH_TEMPLATE_NAME'] || use_nil}" 44 | template_file "#{ENV['FLUENT_ELASTICSEARCH_TEMPLATE_FILE'] || use_nil}" 45 | template_overwrite "#{ENV['FLUENT_ELASTICSEARCH_TEMPLATE_OVERWRITE'] || use_default}" 46 | sniffer_class_name "#{ENV['FLUENT_SNIFFER_CLASS_NAME'] || 'Fluent::Plugin::ElasticsearchSimpleSniffer'}" 47 | request_timeout "#{ENV['FLUENT_ELASTICSEARCH_REQUEST_TIMEOUT'] || '5s'}" 48 | 49 | flush_thread_count "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_FLUSH_THREAD_COUNT'] || '8'}" 50 | flush_interval "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_FLUSH_INTERVAL'] || '5s'}" 51 | chunk_limit_size "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_CHUNK_LIMIT_SIZE'] || '2M'}" 52 | queue_limit_length "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_QUEUE_LIMIT_LENGTH'] || '32'}" 53 | retry_max_interval "#{ENV['FLUENT_ELASTICSEARCH_BUFFER_RETRY_MAX_INTERVAL'] || '30'}" 54 | retry_forever true 55 | 56 | 57 | -------------------------------------------------------------------------------- /fluentd/conf/kubernetes.conf: -------------------------------------------------------------------------------- 1 | 2 | @type null 3 | 4 | 5 | 6 | @type tail 7 | @id in_tail_container_logs 8 | path /var/log/containers/*.log 9 | pos_file /var/log/fluentd-containers.log.pos 10 | tag "#{ENV['FLUENT_CONTAINER_TAIL_TAG'] || 'kubernetes.*'}" 11 | exclude_path "#{ENV['FLUENT_CONTAINER_TAIL_EXCLUDE_PATH'] || use_default}" 12 | read_from_head true 13 | 14 | @type "#{ENV['FLUENT_CONTAINER_TAIL_PARSER_TYPE'] || 'json'}" 15 | time_format %Y-%m-%dT%H:%M:%S.%NZ 16 | 17 | 18 | 19 | 20 | @type tail 21 | @id in_tail_minion 22 | path /var/log/salt/minion 23 | pos_file /var/log/fluentd-salt.pos 24 | tag salt 25 | 26 | @type regexp 27 | expression /^(? 30 | 31 | 32 | 33 | @type tail 34 | @id in_tail_startupscript 35 | path /var/log/startupscript.log 36 | pos_file /var/log/fluentd-startupscript.log.pos 37 | tag startupscript 38 | 39 | @type syslog 40 | 41 | 42 | 43 | 44 | @type tail 45 | @id in_tail_docker 46 | path /var/log/docker.log 47 | pos_file /var/log/fluentd-docker.log.pos 48 | tag docker 49 | 50 | @type regexp 51 | expression /^time="(? 53 | 54 | 55 | 56 | @type tail 57 | @id in_tail_etcd 58 | path /var/log/etcd.log 59 | pos_file /var/log/fluentd-etcd.log.pos 60 | tag etcd 61 | 62 | @type none 63 | 64 | 65 | 66 | 67 | @type tail 68 | @id in_tail_kubelet 69 | multiline_flush_interval 5s 70 | path /var/log/kubelet.log 71 | pos_file /var/log/fluentd-kubelet.log.pos 72 | tag kubelet 73 | 74 | @type kubernetes 75 | 76 | 77 | 78 | 79 | @type tail 80 | @id in_tail_kube_proxy 81 | multiline_flush_interval 5s 82 | path /var/log/kube-proxy.log 83 | pos_file /var/log/fluentd-kube-proxy.log.pos 84 | tag kube-proxy 85 | 86 | @type kubernetes 87 | 88 | 89 | 90 | 91 | @type tail 92 | @id in_tail_kube_apiserver 93 | multiline_flush_interval 5s 94 | path /var/log/kube-apiserver.log 95 | pos_file /var/log/fluentd-kube-apiserver.log.pos 96 | tag kube-apiserver 97 | 98 | @type kubernetes 99 | 100 | 101 | 102 | 103 | @type tail 104 | @id in_tail_kube_controller_manager 105 | multiline_flush_interval 5s 106 | path /var/log/kube-controller-manager.log 107 | pos_file /var/log/fluentd-kube-controller-manager.log.pos 108 | tag kube-controller-manager 109 | 110 | @type kubernetes 111 | 112 | 113 | 114 | 115 | @type tail 116 | @id in_tail_kube_scheduler 117 | multiline_flush_interval 5s 118 | path /var/log/kube-scheduler.log 119 | pos_file /var/log/fluentd-kube-scheduler.log.pos 120 | tag kube-scheduler 121 | 122 | @type kubernetes 123 | 124 | 125 | 126 | 127 | @type tail 128 | @id in_tail_rescheduler 129 | multiline_flush_interval 5s 130 | path /var/log/rescheduler.log 131 | pos_file /var/log/fluentd-rescheduler.log.pos 132 | tag rescheduler 133 | 134 | @type kubernetes 135 | 136 | 137 | 138 | 139 | @type tail 140 | @id in_tail_glbc 141 | multiline_flush_interval 5s 142 | path /var/log/glbc.log 143 | pos_file /var/log/fluentd-glbc.log.pos 144 | tag glbc 145 | 146 | @type kubernetes 147 | 148 | 149 | 150 | 151 | @type tail 152 | @id in_tail_cluster_autoscaler 153 | multiline_flush_interval 5s 154 | path /var/log/cluster-autoscaler.log 155 | pos_file /var/log/fluentd-cluster-autoscaler.log.pos 156 | tag cluster-autoscaler 157 | 158 | @type kubernetes 159 | 160 | 161 | 162 | # Example: 163 | # 2017-02-09T00:15:57.992775796Z AUDIT: id="90c73c7c-97d6-4b65-9461-f94606ff825f" ip="104.132.1.72" method="GET" user="kubecfg" as="" asgroups="" namespace="default" uri="/api/v1/namespaces/default/pods" 164 | # 2017-02-09T00:15:57.993528822Z AUDIT: id="90c73c7c-97d6-4b65-9461-f94606ff825f" response="200" 165 | 166 | @type tail 167 | @id in_tail_kube_apiserver_audit 168 | multiline_flush_interval 5s 169 | path /var/log/kubernetes/kube-apiserver-audit.log 170 | pos_file /var/log/kube-apiserver-audit.log.pos 171 | tag kube-apiserver-audit 172 | 173 | @type multiline 174 | format_firstline /^\S+\s+AUDIT:/ 175 | # Fields must be explicitly captured by name to be parsed into the record. 176 | # Fields may not always be present, and order may change, so this just looks 177 | # for a list of key="\"quoted\" value" pairs separated by spaces. 178 | # Unknown fields are ignored. 179 | # Note: We can't separate query/response lines as format1/format2 because 180 | # they don't always come one after the other for a given query. 181 | format1 /^(? 184 | 185 | 186 | 187 | @type kubernetes_metadata 188 | @id filter_kube_metadata 189 | kubernetes_url "#{ENV['FLUENT_FILTER_KUBERNETES_URL'] || 'https://' + ENV.fetch('KUBERNETES_SERVICE_HOST') + ':' + ENV.fetch('KUBERNETES_SERVICE_PORT') + '/api'}" 190 | verify_ssl "#{ENV['KUBERNETES_VERIFY_SSL'] || true}" 191 | ca_file "#{ENV['KUBERNETES_CA_FILE']}" 192 | 193 | 194 | -------------------------------------------------------------------------------- /fluentd/conf/prometheus.conf: -------------------------------------------------------------------------------- 1 | # Prometheus metric exposed on 0.0.0.0:24231/metrics 2 | 3 | @type prometheus 4 | bind "#{ENV['FLUENTD_PROMETHEUS_BIND'] || '0.0.0.0'}" 5 | port "#{ENV['FLUENTD_PROMETHEUS_PORT'] || '24231'}" 6 | metrics_path "#{ENV['FLUENTD_PROMETHEUS_PATH'] || '/metrics'}" 7 | 8 | 9 | 10 | @type prometheus_output_monitor 11 | 12 | -------------------------------------------------------------------------------- /fluentd/conf/systemd.conf: -------------------------------------------------------------------------------- 1 | 2 | # Logs from systemd-journal for interesting services. 3 | 4 | @type systemd 5 | @id in_systemd_kubelet 6 | matches [{ "_SYSTEMD_UNIT": "kubelet.service" }] 7 | 8 | @type local 9 | persistent true 10 | path /var/log/fluentd-journald-kubelet-cursor.json 11 | 12 | 13 | fields_strip_underscores true 14 | 15 | read_from_head true 16 | tag kubelet 17 | 18 | 19 | # Logs from docker-systemd 20 | 21 | @type systemd 22 | @id in_systemd_docker 23 | matches [{ "_SYSTEMD_UNIT": "docker.service" }] 24 | 25 | @type local 26 | persistent true 27 | path /var/log/fluentd-journald-docker-cursor.json 28 | 29 | 30 | fields_strip_underscores true 31 | 32 | read_from_head true 33 | tag docker.systemd 34 | 35 | 36 | # Logs from systemd-journal for interesting services. 37 | 38 | @type systemd 39 | @id in_systemd_bootkube 40 | matches [{ "_SYSTEMD_UNIT": "bootkube.service" }] 41 | 42 | @type local 43 | persistent true 44 | path /var/log/fluentd-journald-bootkube-cursor.json 45 | 46 | 47 | fields_strip_underscores true 48 | 49 | read_from_head true 50 | tag bootkube 51 | 52 | 53 | -------------------------------------------------------------------------------- /fluentd/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | SIMPLE_SNIFFER=$( gem contents fluent-plugin-elasticsearch | grep elasticsearch_simple_sniffer.rb ) 6 | 7 | if [ -n "$SIMPLE_SNIFFER" -a -f "$SIMPLE_SNIFFER" ] ; then 8 | FLUENTD_OPT="$FLUENTD_OPT -r $SIMPLE_SNIFFER" 9 | fi 10 | 11 | exec fluentd -c /fluentd/etc/${FLUENTD_CONF} -p /fluentd/plugins --gemfile /fluentd/Gemfile ${FLUENTD_OPT} 12 | -------------------------------------------------------------------------------- /fluentd/plugins/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/openware/images/3dd03c51c1640054241a5854945d04c30f2f6b4c/fluentd/plugins/.gitkeep -------------------------------------------------------------------------------- /fluentd/plugins/parser_kubernetes.rb: -------------------------------------------------------------------------------- 1 | # 2 | # Fluentd 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # 16 | 17 | # The following Fluentd parser plugin, aims to simplify the parsing of multiline 18 | # logs found in Kubernetes nodes. Since many log files shared the same format and 19 | # in order to simplify the configuration, this plugin provides a 'kubernetes' format 20 | # parser (built on top of MultilineParser). 21 | # 22 | # When tailing files, this 'kubernetes' format should be applied to the following 23 | # log file sources: 24 | # 25 | # - /var/log/kubelet.log 26 | # - /var/log/kube-proxy.log 27 | # - /var/log/kube-apiserver.log 28 | # - /var/log/kube-controller-manager.log 29 | # - /var/log/kube-scheduler.log 30 | # - /var/log/rescheduler.log 31 | # - /var/log/glbc.log 32 | # - /var/log/cluster-autoscaler.log 33 | # 34 | # Usage: 35 | # 36 | # ---- fluentd.conf ---- 37 | # 38 | # 39 | # @type tail 40 | # path ./kubelet.log 41 | # read_from_head yes 42 | # tag kubelet 43 | # 44 | # @type kubernetes 45 | # 46 | # 47 | # 48 | # ---- EOF --- 49 | 50 | require 'fluent/plugin/parser_regexp' 51 | 52 | module Fluent 53 | module Plugin 54 | class KubernetesParser < RegexpParser 55 | Fluent::Plugin.register_parser("kubernetes", self) 56 | 57 | CONF_FORMAT_FIRSTLINE = %q{/^\w\d{4}/} 58 | CONF_FORMAT1 = %q{/^(?\w)(?