├── .bash_profile ├── Docker ├── Dockerfile ├── builder │ └── Dockerfile ├── docker-compose.yml └── nodeosd.sh ├── config.ini └── genesis.json /.bash_profile: -------------------------------------------------------------------------------- 1 | alias cleos="sudo docker exec docker_nodeosd_1 /usr/local/bin/cleos" 2 | alias eosiocpp="sudo docker exec --workdir /opt/eosio/bin/data-dir/contracts/ docker_nodeosd_1 /usr/local/bin/eosiocpp" 3 | -------------------------------------------------------------------------------- /Docker/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM eosio/builder as builder 2 | 3 | RUN git clone https://github.com/EOSIO/eos --recursive \ 4 | && cd eos \ 5 | && git checkout dawn-v4.0.0 \ 6 | && git submodule update --recursive \ 7 | && cmake -H. -B"/tmp/build" -GNinja -DCMAKE_BUILD_TYPE=Release -DWASM_ROOT=/opt/wasm -DCMAKE_CXX_COMPILER=clang++ \ 8 | -DCMAKE_C_COMPILER=clang -DCMAKE_INSTALL_PREFIX=/usr/local -DSecp256k1_ROOT_DIR=/usr/local -DBUILD_MONGO_DB_PLUGIN=true \ 9 | && cmake --build /tmp/build --target install 10 | 11 | RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get -y install openssl && rm -rf /var/lib/apt/lists/* 12 | 13 | COPY nodeosd.sh /usr/local/bin/nodeosd.sh 14 | RUN chmod +x /usr/local/bin/nodeosd.sh 15 | RUN cp -r /tmp/build/contracts /contracts 16 | -------------------------------------------------------------------------------- /Docker/builder/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:16.04 2 | 3 | LABEL author="xiaobo " maintainer="Xiaobo Huang-Ming Huang " version="0.1.1" \ 4 | description="This is a base image for building eosio/eos" 5 | 6 | RUN echo 'APT::Install-Recommends 0;' >> /etc/apt/apt.conf.d/01norecommends \ 7 | && echo 'APT::Install-Suggests 0;' >> /etc/apt/apt.conf.d/01norecommends \ 8 | && apt-get update \ 9 | && DEBIAN_FRONTEND=noninteractive apt-get install -y sudo wget curl net-tools ca-certificates unzip 10 | 11 | RUN echo "deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-4.0 main" >> /etc/apt/sources.list.d/llvm.list \ 12 | && wget -O - http://apt.llvm.org/llvm-snapshot.gpg.key|sudo apt-key add - \ 13 | && apt-get update \ 14 | && DEBIAN_FRONTEND=noninteractive apt-get install -y git-core automake autoconf libtool build-essential pkg-config libtool \ 15 | mpi-default-dev libicu-dev python-dev python3-dev libbz2-dev zlib1g-dev libssl-dev libgmp-dev \ 16 | clang-4.0 lldb-4.0 lld-4.0 llvm-4.0-dev libclang-4.0-dev ninja-build \ 17 | && rm -rf /var/lib/apt/lists/* 18 | 19 | RUN update-alternatives --install /usr/bin/clang clang /usr/lib/llvm-4.0/bin/clang 400 \ 20 | && update-alternatives --install /usr/bin/clang++ clang++ /usr/lib/llvm-4.0/bin/clang++ 400 21 | 22 | RUN wget --no-check-certificate https://cmake.org/files/v3.9/cmake-3.9.6-Linux-x86_64.sh \ 23 | && bash cmake-3.9.6-Linux-x86_64.sh --prefix=/usr/local --exclude-subdir --skip-license \ 24 | && rm cmake-3.9.6-Linux-x86_64.sh 25 | 26 | ENV CC clang 27 | ENV CXX clang++ 28 | 29 | RUN wget https://dl.bintray.com/boostorg/release/1.66.0/source/boost_1_66_0.tar.bz2 -O - | tar -xj \ 30 | && cd boost_1_66_0 \ 31 | && ./bootstrap.sh --prefix=/usr/local \ 32 | && echo 'using clang : 4.0 : clang++-4.0 ;' >> project-config.jam \ 33 | && ./b2 -d0 -j$(nproc) --with-thread --with-date_time --with-system --with-filesystem --with-program_options \ 34 | --with-signals --with-serialization --with-chrono --with-test --with-context --with-locale --with-coroutine --with-iostreams toolset=clang link=static install \ 35 | && cd .. && rm -rf boost_1_66_0 36 | 37 | RUN wget https://github.com/mongodb/mongo-c-driver/releases/download/1.9.3/mongo-c-driver-1.9.3.tar.gz -O - | tar -xz \ 38 | && cd mongo-c-driver-1.9.3 \ 39 | && ./configure --enable-static --with-libbson=bundled --enable-ssl=openssl --disable-automatic-init-and-cleanup --prefix=/usr/local \ 40 | && make -j$(nproc) install \ 41 | && cd .. && rm -rf mongo-c-driver-1.9.3 42 | 43 | RUN git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/llvm.git \ 44 | && git clone --depth 1 --single-branch --branch release_40 https://github.com/llvm-mirror/clang.git llvm/tools/clang \ 45 | && cd llvm \ 46 | && cmake -H. -Bbuild -GNinja -DCMAKE_INSTALL_PREFIX=/opt/wasm -DLLVM_TARGETS_TO_BUILD= -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly -DCMAKE_BUILD_TYPE=Release \ 47 | && cmake --build build --target install \ 48 | && cd .. && rm -rf llvm 49 | 50 | RUN wget https://github.com/WebAssembly/binaryen/archive/1.37.21.tar.gz -O - | tar -xz \ 51 | && cd binaryen-1.37.21 \ 52 | && cmake -H. -Bbuild -GNinja -DCMAKE_BUILD_TYPE=Release \ 53 | && cmake --build build --target install \ 54 | && cd .. && rm -rf binaryen-1.37.21 55 | 56 | RUN git clone --depth 1 git://github.com/cryptonomex/secp256k1-zkp \ 57 | && cd secp256k1-zkp \ 58 | && ./autogen.sh \ 59 | && ./configure --prefix=/usr/local \ 60 | && make -j$(nproc) install \ 61 | && cd .. && rm -rf secp256k1-zkp 62 | 63 | RUN git clone --depth 1 -b releases/stable git://github.com/mongodb/mongo-cxx-driver \ 64 | && cd mongo-cxx-driver \ 65 | && cmake -H. -Bbuild -G Ninja -DBUILD_SHARED_LIBS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local\ 66 | && cmake --build build --target install \ 67 | && cd .. && rm -rf mongo-cxx-driver 68 | 69 | RUN git clone --depth 1 --single-branch --branch master https://github.com/ucb-bar/berkeley-softfloat-3.git \ 70 | && cd berkeley-softfloat-3/build/Linux-x86_64-GCC \ 71 | && make -j${nproc} SPECIALIZE_TYPE="8086-SSE" SOFTFLOAT_OPS="-DSOFTFLOAT_ROUND_EVEN -DINLINE_LEVEL=5 -DSOFTFLOAT_FAST_DIV32TO16 -DSOFTFLOAT_FAST_DIV64TO32" \ 72 | && mkdir -p /opt/berkeley-softfloat-3 && cp softfloat.a /opt/berkeley-softfloat-3/libsoftfloat.a \ 73 | && mv ../../source/include /opt/berkeley-softfloat-3/include && cd - && rm -rf berkeley-softfloat-3 74 | 75 | ENV SOFTFLOAT_ROOT /opt/berkeley-softfloat-3 76 | -------------------------------------------------------------------------------- /Docker/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | nodeosd: 5 | build: 6 | context: . 7 | image: johnnyzhao/eos-dawn-4.0 8 | command: /usr/local/bin/nodeosd.sh --data-dir /opt/eosio/bin/data-dir 9 | hostname: nodeosd 10 | ports: 11 | - 80:8888 12 | - 9876:9876 13 | expose: 14 | - "9876" 15 | volumes: 16 | - /data/nodeosd:/opt/eosio/bin/data-dir 17 | 18 | keosd: 19 | image: johnnyzhao/eos-dawn-4.0 20 | command: /usr/local/bin/keosd --wallet-dir /opt/eosio/bin/data-dir 21 | hostname: keosd 22 | links: 23 | - nodeosd 24 | volumes: 25 | - /data/keosd:/opt/eosio/bin/data-dir 26 | -------------------------------------------------------------------------------- /Docker/nodeosd.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | cd /usr/local/bin 3 | 4 | if [ -f '/opt/eosio/bin/data-dir/config.ini' ]; then 5 | echo 6 | else 7 | cp /config.ini /opt/eosio/bin/data-dir 8 | fi 9 | 10 | if [ -f '/opt/eosio/bin/data-dir/genesis.json' ]; then 11 | echo 12 | else 13 | cp /genesis.json /opt/eosio/bin/data-dir 14 | fi 15 | 16 | if [ -d '/opt/eosio/bin/data-dir/contracts' ]; then 17 | echo 18 | else 19 | cp -r /contracts /opt/eosio/bin/data-dir 20 | fi 21 | 22 | while :; do 23 | case $1 in 24 | --config-dir=?*) 25 | CONFIG_DIR=${1#*=} 26 | ;; 27 | *) 28 | break 29 | esac 30 | shift 31 | done 32 | 33 | if [ ! "$CONFIG_DIR" ]; then 34 | CONFIG_DIR="--config-dir=/opt/eosio/bin/data-dir" 35 | else 36 | CONFIG_DIR="" 37 | fi 38 | 39 | exec /usr/local/bin/nodeos $CONFIG_DIR $@ 40 | -------------------------------------------------------------------------------- /config.ini: -------------------------------------------------------------------------------- 1 | # Load the testnet genesis state, which creates some initial block producers with the default key 2 | genesis-json = /opt/eosio/bin/data-dir/genesis.json 3 | # Enable production on a stale chain, since a single-node test chain is pretty much always stale 4 | enable-stale-production = true 5 | # Enable block production with the testnet producers 6 | producer-name = eosio 7 | # Load the block producer plugin, so you can produce blocks 8 | plugin = eosio::producer_plugin 9 | # Wallet plugin 10 | plugin = eosio::wallet_api_plugin 11 | # As well as API and HTTP plugins 12 | plugin = eosio::chain_api_plugin 13 | plugin = eosio::http_plugin 14 | # This will be used by the validation step below, to view account history 15 | plugin = eosio::account_history_api_plugin 16 | 17 | http-server-address = 0.0.0.0:8888 18 | p2p-listen-endpoint = 0.0.0.0:9876 19 | p2p-server-address = :9876 20 | -------------------------------------------------------------------------------- /genesis.json: -------------------------------------------------------------------------------- 1 | { 2 | "initial_timestamp": "2018-03-01T12:00:00.000", 3 | "initial_key": "EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV", 4 | "initial_configuration": { 5 | "base_per_transaction_net_usage": 100, 6 | "base_per_transaction_cpu_usage": 500, 7 | "base_per_action_cpu_usage": 1000, 8 | "base_setcode_cpu_usage": 2097152, 9 | "per_signature_cpu_usage": 100000, 10 | "per_lock_net_usage": 32, 11 | "context_free_discount_cpu_usage_num": 20, 12 | "context_free_discount_cpu_usage_den": 100, 13 | "max_transaction_cpu_usage": 10485760, 14 | "max_transaction_net_usage": 104857, 15 | "max_block_cpu_usage": 104857600, 16 | "target_block_cpu_usage_pct": 1000, 17 | "max_block_net_usage": 1048576, 18 | "target_block_net_usage_pct": 1000, 19 | "max_transaction_lifetime": 3600, 20 | "max_transaction_exec_time": 0, 21 | "max_authority_depth": 6, 22 | "max_inline_depth": 4, 23 | "max_inline_action_size": 4096, 24 | "max_generated_transaction_count": 16, 25 | "max_transaction_delay": 3888000 26 | }, 27 | "initial_chain_id": "0000000000000000000000000000000000000000000000000000000000000000" 28 | } 29 | --------------------------------------------------------------------------------