This repository has been archived by the owner on Aug 2, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 463
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #939 from EOSIO/release/22.0.x
Merging release/22.0.x into master
- Loading branch information
Showing
36 changed files
with
4,293 additions
and
897 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,89 +1,51 @@ | ||
FROM ubuntu:18.04 | ||
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--verbose-http-errors", "--max-transaction-time=100"] | ||
### Test: | ||
#### docker build --tag eosjs-ci:test ./.github/eosjs-ci | ||
#### docker run --publish 8888:8888 eosjs-ci:test | ||
|
||
ARG EOSBRANCH=develop | ||
ARG CDTBRANCH=develop | ||
FROM eosio/eosio.cdt:${CDTBRANCH} as contracts | ||
WORKDIR /root | ||
### base | ||
RUN yes | unminimize \ | ||
&& apt-get update \ | ||
&& apt-get install -yq \ | ||
binutils-gold \ | ||
build-essential \ | ||
clang-tools-8 \ | ||
curl \ | ||
g++-8 \ | ||
git \ | ||
libcurl4-gnutls-dev \ | ||
libgflags-dev \ | ||
libgmp3-dev \ | ||
libssl-dev \ | ||
libusb-1.0-0-dev \ | ||
lld-8 \ | ||
llvm-7 \ | ||
llvm-7-dev \ | ||
locales \ | ||
ninja-build \ | ||
pkg-config \ | ||
python \ | ||
software-properties-common \ | ||
wget \ | ||
xz-utils \ | ||
zlib1g-dev \ | ||
&& update-alternatives --remove-all cc \ | ||
&& update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-8 100 \ | ||
&& update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 100 \ | ||
&& update-alternatives --remove-all c++ \ | ||
&& update-alternatives --install /usr/bin/c++ c++ /usr/bin/g++-8 100 \ | ||
&& update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-8 100 \ | ||
&& update-alternatives --install /usr/bin/clangd clangd /usr/bin/clangd-8 100 \ | ||
&& locale-gen en_US.UTF-8 \ | ||
&& curl -sL https://deb.nodesource.com/setup_10.x | bash - | ||
RUN apt-get update \ | ||
&& apt-get install -yq curl git | ||
|
||
ENV LANG=en_US.UTF-8 | ||
RUN git clone https://github.com/EOSIO/eos \ | ||
&& cd eos \ | ||
&& git checkout develop | ||
|
||
### cmake | ||
WORKDIR /root | ||
RUN curl -LO https://cmake.org/files/v3.13/cmake-3.13.2.tar.gz \ | ||
&& tar -xzf cmake-3.13.2.tar.gz \ | ||
&& cd cmake-3.13.2 \ | ||
&& ./bootstrap --prefix=/usr/local --parallel=8 \ | ||
&& make -j8 \ | ||
&& make install \ | ||
&& cd /root \ | ||
&& rm -rf cmake-3.13.2.tar.gz cmake-3.13.2 | ||
RUN git clone https://github.com/EOSIO/eosio.contracts \ | ||
&& cd eosio.contracts \ | ||
&& git checkout develop \ | ||
&& mkdir build && cd build && mkdir eosio.token && cd .. \ | ||
&& eosio-cpp -abigen ./contracts/eosio.token/src/eosio.token.cpp -o ./build/eosio.token/eosio.token.wasm -R ./contracts/eosio.token/ricardian/ -I ./contracts/eosio.token/include/ | ||
|
||
### boost | ||
RUN curl -LO https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.tar.bz2 \ | ||
&& tar -xjf boost_1_72_0.tar.bz2 \ | ||
&& cd boost_1_72_0 \ | ||
&& ./bootstrap.sh --prefix=/usr/local \ | ||
&& ./b2 --with-iostreams --with-date_time --with-filesystem --with-system --with-program_options --with-chrono --with-test -j$(nproc) install \ | ||
&& cd /root \ | ||
&& rm -rf boost_1_72_0.tar.bz2 boost_1_72_0 | ||
RUN git clone https://github.com/EOSIO/key-value-example-app.git \ | ||
&& cd key-value-example-app \ | ||
&& eosio-cpp -abigen ./contracts/kv_todo/src/kv_todo.cpp -o ./contracts/kv_todo/build/kv_todo.wasm -R ./contracts/kv_todo/ricardian/ -I ./contracts/kv_todo/include/ | ||
|
||
### eosio.cdt | ||
RUN git clone https://github.com/EOSIO/eosio.cdt.git \ | ||
&& cd eosio.cdt \ | ||
&& git checkout eosio-cdt-2.1-staging-c \ | ||
&& git submodule update --init --recursive \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& cmake -GNinja .. \ | ||
&& ninja -j8 | ||
RUN git clone https://github.com/EOSIO/return-values-example-app.git \ | ||
&& cd return-values-example-app \ | ||
&& eosio-cpp -abigen ./contracts/action_return_value/src/action_return_value.cpp -o ./contracts/action_return_value/build/action_return_value.wasm -R ./contracts/action_return_value/ricardian/ | ||
|
||
### eos | ||
RUN git clone https://github.com/EOSIO/eos.git \ | ||
&& cd eos \ | ||
&& git checkout develop \ | ||
&& git submodule update --init --recursive \ | ||
RUN mkdir cfhello | ||
COPY ./contracts/cfhello.cpp /root/cfhello | ||
RUN cd cfhello \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& CC=clang-8 CXX=clang++-8 cmake -GNinja -DCMAKE_BUILD_TYPE=Release -DCMAKE_AR=/usr/bin/llvm-ar-8 -DCMAKE_RANLIB=/usr/bin/llvm-ranlib-8 -DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld .. \ | ||
&& CC=clang-8 CXX=clang++-8 ninja -j8 | ||
&& eosio-cpp -abigen ./cfhello.cpp -o ./build/cfhello.wasm | ||
|
||
ENV PATH="/root/eos/build/bin/:/root/eosio.cdt/build/bin/:${PATH}" | ||
|
||
FROM eosio/eosio:${EOSBRANCH} | ||
ENTRYPOINT ["nodeos", "--data-dir", "/root/.local/share", "-e", "-p", "eosio", "--replay-blockchain", "--plugin", "eosio::producer_plugin", "--plugin", "eosio::chain_api_plugin", "--plugin", "eosio::trace_api_plugin", "--trace-no-abis", "--plugin", "eosio::db_size_api_plugin", "--plugin", "eosio::http_plugin", "--http-server-address=0.0.0.0:8888", "--access-control-allow-origin=*", "--contracts-console", "--http-validate-host=false", "--enable-account-queries=true", "--verbose-http-errors", "--max-transaction-time=100"] | ||
WORKDIR /root | ||
RUN mkdir -p "/opt/eosio/bin/contracts" | ||
|
||
COPY ./ /opt/eosio/bin | ||
COPY --from=contracts /root/eos/contracts/contracts/eosio.bios/bin/* /opt/eosio/bin/contracts/eosio.bios/ | ||
COPY --from=contracts /root/eos/contracts/contracts/eosio.boot/bin/* /opt/eosio/bin/contracts/eosio.boot/ | ||
COPY --from=contracts /root/eosio.contracts/build/ /opt/eosio/bin/contracts | ||
COPY --from=contracts /root/key-value-example-app/contracts/kv_todo/build/* /opt/eosio/bin/contracts/kv_todo/ | ||
COPY --from=contracts /root/return-values-example-app/contracts/action_return_value/build/* /opt/eosio/bin/contracts/action_return_value/ | ||
COPY --from=contracts /root/cfhello/build/* /opt/eosio/bin/contracts/cfhello/ | ||
COPY ./ /opt/eosio/bin/ | ||
|
||
RUN mkdir -p "/opt/eosio/bin/config-dir" | ||
RUN /bin/bash /opt/eosio/bin/scripts/deploy_contracts.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Import necessary libraries | ||
#include <eosio/eosio.hpp> | ||
#include <eosio/transaction.hpp> | ||
|
||
using namespace eosio; | ||
|
||
class [[eosio::contract("cfhello")]] cfhello : public contract { | ||
public: | ||
using contract::contract; | ||
|
||
[[eosio::action]] | ||
void contextfree() { | ||
int cfd_index = 0; | ||
while(true) { | ||
int read_size = get_context_free_data( cfd_index, nullptr, 0 ); | ||
if (read_size == -1) { | ||
if (cfd_index == 0) { | ||
print("No context free data found"); | ||
} | ||
break; | ||
} | ||
|
||
char* context_free_data = new char[read_size]; | ||
get_context_free_data( cfd_index, context_free_data, read_size ); | ||
|
||
print("CFD ", std::to_string(cfd_index), ":", context_free_data, "\n"); | ||
cfd_index++; | ||
} | ||
} | ||
|
||
[[eosio::action]] | ||
void normal( name user ) { | ||
print( "Hi, ", user); | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.