Skip to content

Commit

Permalink
Merge pull request #76 from DeckerSU/static-experimental
Browse files Browse the repository at this point in the history
 Merge branch 'static-experimental' into static-dev
  • Loading branch information
DeckerSU authored Aug 20, 2024
2 parents 88f8e8c + b0a3dd0 commit dc1d474
Show file tree
Hide file tree
Showing 243 changed files with 1,788 additions and 55,631 deletions.
11 changes: 5 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,6 @@ src/zcash-gtest
src/zcash-tx
src/test/test_bitcoin

# Zcash utilities
src/zcash/GenerateParams
src/zcash/CreateJoinSplit

*zcashTest.pk
*zcashTest.vk

Expand Down Expand Up @@ -40,6 +36,7 @@ src/config/bitcoin-config.h
src/config/bitcoin-config.h.in
src/config/stamp-h1
share/setup.nsi
src/cryptoconditions/src/cryptoconditions-config.h.in

cache/
venv-mnf/
Expand All @@ -48,7 +45,7 @@ venv-mnf/
.dirstamp
.libs
.*.swp
*.*~*
*~
*.bak
*.rej
*.orig
Expand Down Expand Up @@ -135,4 +132,6 @@ src/qt/komodo-qt

# chain files for iguana
src/qt/*_7776

src/*_7776
*_7776
releases/
120 changes: 120 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Build:
# docker build -f Dockerfile -t komodoocean .

# Prepare data directory and config file:
# mkdir -p ./komodo-data/.komodo && RANDPASS=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w16 | head -n1) && echo -e "txindex=1\nrpcuser=komodo\nrpcpassword=${RANDPASS}\nrpcallowip=127.0.0.1\nrpcbind=127.0.0.1\nserver=1" > ./komodo-data/.komodo/komodo.conf
# docker run --rm -v "$(pwd)/komodo-data:/data" ubuntu:18.04 bash -c 'chown -R nobody:nogroup /data'

# Run:
# docker run -d --rm -p 7770:7770 -v "$(pwd)/komodo-data:/data" komodoocean -printtoconsole=1

# Run AC (for example VOTE2024):
# mkdir -p ./VOTE2024/.komodo
# docker run --rm -v "$(pwd)/VOTE2024:/data" ubuntu:18.04 bash -c 'chown -R nobody:nogroup /data'
# docker run -d --rm -v "$(pwd)/VOTE2024:/data" komodoocean -printtoconsole=1 -ac_name=VOTE2024 -ac_public=1 -ac_supply=149826699 -ac_staked=10 -addnode=65.21.52.18

# Access the container after it's already running:
# docker ps --filter ancestor=komodoocean # find the id / name of container
# docker exec -it container_id_or_name /bin/bash # run bash inside the container
# docker exec -it container_id_or_name /app/komodo-cli getinfo # run RPC getinfo

# Run container with current user UID:GID:
# mkdir -p ./komodo-data/.komodo && RANDPASS=$(tr -cd '[:alnum:]' < /dev/urandom | fold -w16 | head -n1) && echo -e "txindex=1\nrpcuser=komodo\nrpcpassword=${RANDPASS}\nrpcallowip=127.0.0.1\nrpcbind=127.0.0.1\nserver=1" > ./komodo-data/.komodo/komodo.conf
# docker run --rm -d --user $(id -u):$(id -g) -e HOME=/data -v "$(pwd)/komodo-data:/data" komodoocean -no-ownership-check -printtoconsole

# Run AC with current user UID:GID:
# mkdir -p ./VOTE2024/.komodo # pay attention that existance of .komodo folder is important (!)
# docker run --rm -d --user $(id -u):$(id -g) -e HOME=/data -v "$(pwd)/VOTE2024:/data" komodoocean -no-ownership-check -printtoconsole -ac_name=VOTE2024 -ac_public=1 -ac_supply=149826699 -ac_staked=10 -addnode=65.21.52.182

## Build komodod
FROM ubuntu:20.04 as komodod-builder
LABEL maintainer="DeckerSU <deckersu@protonmail.com>"

SHELL ["/bin/bash", "-c"]

# Latest release komodo 0.8.2-beta1
ARG KOMODO_COMMITTISH=v0.8.2-beta1-sign
ARG IS_RELEASE=false
# DeckerSU <deckersu@protonmail.com> https://keys.openpgp.org/vks/v1/by-fingerprint/FD9A772C7300F4C894D1A819FE50480862E6451C
ARG KOMODOD_MAINTAINER_KEYS="FD9A772C7300F4C894D1A819FE50480862E6451C"

RUN set -euxo pipefail \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y --no-install-recommends install apt-utils \
&& apt-get -y --no-install-recommends dist-upgrade \
&& apt-get -y --no-install-recommends install autoconf automake \
bsdmainutils build-essential ca-certificates cmake curl dirmngr fakeroot \
git g++-multilib gnupg2 libc6-dev libgomp1 libtool m4 ncurses-dev \
pkg-config python3 zlib1g-dev \
&& git clone https://github.com/DeckerSU/KomodoOcean.git \
&& cd /KomodoOcean && git checkout "${KOMODO_COMMITTISH}" \
&& if [ "$IS_RELEASE" = "true" ]; then \
read -a keys <<< "$KOMODOD_MAINTAINER_KEYS" \
&& for key in "${keys[@]}"; do \
gpg2 --batch --keyserver keyserver.ubuntu.com --keyserver-options timeout=15 --recv "$key" || \
gpg2 --batch --keyserver hkps://keys.openpgp.org --keyserver-options timeout=15 --recv "$key" || \
gpg2 --batch --keyserver hkp://p80.pool.sks-keyservers.net:80 --keyserver-options timeout=15 --recv-keys "$key" || \
gpg2 --batch --keyserver hkp://ipv4.pool.sks-keyservers.net --keyserver-options timeout=15 --recv-keys "$key" || \
gpg2 --batch --keyserver hkp://pgp.mit.edu:80 --keyserver-options timeout=15 --recv-keys "$key"; \
done \
&& if git verify-tag -v "${KOMODO_COMMITTISH}"; then \
echo "Valid signed tag"; \
else \
echo "Not a valid signed tag"; \
exit 1; \
fi \
&& ( gpgconf --kill dirmngr || true ) \
&& ( gpgconf --kill gpg-agent || true ); \
fi \
&& export MAKEFLAGS="-j $(($(nproc)-1))" && ./zcutil/build-no-qt.sh $MAKEFLAGS

## Build Final Image
FROM ubuntu:20.04

LABEL maintainer="DeckerSU <deckersu@protonmail.com>"

SHELL ["/bin/bash", "-c"]

WORKDIR /app

# Copy komodod and fetch-params.sh
COPY --from=komodod-builder /KomodoOcean/src/komodod /KomodoOcean/src/komodo-cli /KomodoOcean/zcutil/fetch-params.sh /app/
# Copy entrypoint script
COPY entrypoint.sh /app

# Install runtime dependencies and set up home folder for nobody user.
# As it is best practice to not run as root even inside a container,
# we run as nobody and change the home folder to "/data".

RUN set -euxo pipefail \
&& export DEBIAN_FRONTEND=noninteractive \
&& apt-get update \
&& apt-get -y --no-install-recommends install apt-utils \
&& apt-get -y --no-install-recommends dist-upgrade \
&& apt-get -y --no-install-recommends install ca-certificates curl libgomp1 \
&& apt-get -y clean && apt-get -y autoclean \
&& rm -rf /var/{lib/apt/lists/*,cache/apt/archives/*.deb,tmp/*,log/*} /tmp/* \
&& mkdir -p /data \
&& for path in /data /app; do chown -R nobody:nogroup $path && chmod 2755 $path; done \
&& for file in /app/{fetch-params.sh,komodod,komodo-cli}; do chmod 755 $file; done \
&& sed -i 's|nobody:/nonexistent|nobody:/data|' /etc/passwd

VOLUME ["/data"]

USER nobody

ENTRYPOINT ["/app/entrypoint.sh"]

12 changes: 1 addition & 11 deletions KomodoOceanGUI.pro
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,10 @@ TEMPLATE = app
TARGET = KomodoOceanGUI
VERSION = 0.1.0.0

INCLUDEPATH += src src\qt src\libsnark src\protobuf src\secp256k1 src\secp256k1\include src\leveldb\include src\leveldb\helpers\memenv src\leveldb src\univalue\include src\libevent\include src\libevent\compat src\cryptoconditions\include src\cryptoconditions src\cryptoconditions\src\asn
INCLUDEPATH += src src\qt src\protobuf src\secp256k1 src\secp256k1\include src\leveldb\include src\leveldb\helpers\memenv src\leveldb src\univalue\include src\libevent\include src\libevent\compat src\cryptoconditions\include src\cryptoconditions src\cryptoconditions\src\asn

MINIUPNPC_INCLUDE_PATH = src\miniupnpc

windows:INCLUDEPATH += depends\libgmp_6.1.1_msvc14\include
windows:INCLUDEPATH += depends\BDB_6.2.32\include depends\db-6.2.23\build_windows
windows:INCLUDEPATH += depends\libsodium-1.0.15-msvc\include
windows:INCLUDEPATH += depends\boost_1_65_1 depends\boost_1_65_1\boost
Expand Down Expand Up @@ -329,13 +328,6 @@ SOURCES += src\protobuf\google\protobuf\any.cc \
src\libevent\signal.c \
src\libevent\strlcpy.c \
src\libevent\win32select.c \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_g1.cpp \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_g2.cpp \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_init.cpp \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_pairing.cpp \
src\libsnark\algebra\curves\alt_bn128\alt_bn128_pp.cpp \
src\libsnark\common\profiling.cpp \
src\libsnark\common\utils.cpp \
src\main.cpp \
src\merkleblock.cpp \
src\metrics.cpp \
Expand Down Expand Up @@ -643,14 +635,12 @@ LIBS += -lboost_system$$BOOST_LIB_SUFFIX -lboost_filesystem$$BOOST_LIB_SUFFIX -l
windows:LIBS += -lboost_chrono$$BOOST_LIB_SUFFIX
LIBS += -lrustzcash

Release:LIBS += -ldepends\libgmp_6.1.1_msvc14\lib\x64\gmp
Release:LIBS += -ldepends\libsodium-1.0.15-msvc\x64\Release\v140\dynamic\libsodium
Release:LIBS += -ldepends\libcurl-master\lib\dll-release-x64\libcurl
Release:LIBS += -ldepends\db-6.2.23\build_windows\x64\Release\libdb62
Release:LIBS += -llibcryptoMD -llibsslMD
Release:LIBS += -ldepends\pthreads-master\dll\x64\Release\pthreads

Debug:LIBS += -ldepends\libgmp_6.1.1_msvc14\lib\x64\gmp
Debug:LIBS += -ldepends\libsodium-1.0.15-msvc\x64\Debug\v140\dynamic\libsodium
Debug:LIBS += -ldepends\libcurl-master\lib\dll-debug-x64\libcurl_debug
Debug:LIBS += -ldepends\db-6.2.23\build_windows\x64\Debug\libdb62d
Expand Down
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,12 @@ cd komodo

*p.s.* Currently only `x86_64` arch supported for MacOS, build for `Apple M1` processors unfortunately not yet supported.

#### Docker

:whale: [deckersu/komodoocean](https://hub.docker.com/r/deckersu/komodoocean) - This Docker image provides the official KomodoOcean daemon for the Komodo blockchain platform. Komodod is the core component responsible for running a Komodo node, facilitating transaction validation, block creation, and communication within the network.

Read the description on [Docker Hub](https://hub.docker.com/r/deckersu/komodoocean) for usage examples.

## Create komodo.conf ##

Before start the wallet you should [create config file](https://github.com/DeckerSU/KomodoOcean/wiki/F.A.Q.#q-after-i-start-komodo-qt-i-receive-the-following-error-error-cannot-parse-configuration-file-missing-komodoconf-only-use-keyvalue-syntax-what-should-i-do) `komodo.conf` at one of the following locations:
Expand Down
123 changes: 0 additions & 123 deletions build-aux/m4/ax_openmp.m4

This file was deleted.

Loading

0 comments on commit dc1d474

Please sign in to comment.