diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 000000000..bd0f8fe1d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,318 @@ +FROM nikolaik/python-nodejs:python3.10-nodejs18 +USER root +ARG TARGETARCH + + +# install common prerequisites +RUN corepack prepare yarn@1.22 --activate +RUN poetry self update 1.8.2 + + +# if running on arm64 - build solc +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # install cmake + apt update; \ + apt install cmake -y; \ + fi + +WORKDIR /root/ + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # install boost + wget http://downloads.sourceforge.net/project/boost/boost/1.73.0/boost_1_73_0.tar.gz; \ + tar -zxvf boost_1_73_0.tar.gz; \ + cd boost_1_73_0; \ + ./bootstrap.sh; \ + ./b2 --with=all -j 4 install; \ + # Download solc repo + cd /root/; \ + git clone --recursive https://github.com/ethereum/solidity.git; \ + mkdir /root/.solcx; \ + fi + +WORKDIR /root/solidity/ + + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.4.24 + git checkout v0.4.24; \ + grep -rl 'createJsonValue("tag", i.location().start, i.location().end, string(i.data())));' ./libevmasm/Assembly.cpp | xargs sed -i 's/createJsonValue("tag", i.location().start, i.location().end, string(i.data())));/createJsonValue("tag", i.location().start, i.location().end, dev::toString(h256(i.data()))));/g'; \ + grep -rl 'createJsonValue("PUSH \[tag\]", i.location().start, i.location().end, string(i.data())));' ./libevmasm/Assembly.cpp | xargs sed -i 's/createJsonValue("PUSH \[tag\]", i.location().start, i.location().end, string(i.data())));/createJsonValue("PUSH \[tag\]", i.location().start, i.location().end, dev::toString(h256(i.data()))));/g'; \ + grep -F -rl 'case sp::utree_type::string_type: _out << "\"" << _this.get, sp::utree_type::string_type>>() << "\""; break;' ./liblll/Parser.cpp | xargs sed -i 's/case sp::utree_type::string_type: _out << "\\"" << _this.get, sp::utree_type::string_type>>() << "\\""; break;/case sp::utree_type::string_type: { auto sr = _this.get, sp::utree_type::string_type>>(); _out << "\\"" << string(sr.begin(), sr.end()) << "\\""; } break;/g'; \ + grep -F -rl 'case sp::utree_type::symbol_type: _out << _this.get, sp::utree_type::symbol_type>>(); break;' ./liblll/Parser.cpp | xargs sed -i 's/case sp::utree_type::symbol_type: _out << _this.get, sp::utree_type::symbol_type>>(); break;/case sp::utree_type::symbol_type: { auto sr = _this.get, sp::utree_type::symbol_type>>(); _out << string(sr.begin(), sr.end()); } break;/g'; \ + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + grep -rl '#include ' ./test/Options.h | xargs sed -i 's/#include /#include \n#include /g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.4.24; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + # build solc-v0.5.14 + git checkout v0.5.14; \ + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.5.14; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + # build solc-v0.5.12 + git checkout v0.5.12; \ + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + grep -rl '#include ' ./libyul/backends/wasm/EWasmAST.h | xargs sed -i 's/#include /#include \n#include /g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.5.12; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.6.12 + git checkout v0.6.12; \ + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + grep -rl '#include ' ./liblangutil/SourceLocation.h | xargs sed -i 's/#include /#include \n#include /g'; \ + grep -rl 'size_t' ./tools/yulPhaser/PairSelections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + grep -rl 'size_t' ./tools/yulPhaser/Selections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.6.12; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.8.28 + git checkout v0.8.28; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.28; \ + git checkout .; \git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + # build solc-v0.8.10 + git checkout v0.8.10; \ + # the compiler throws warnings when compiling this version, and the warnings are treated as errors. + # we disable treating the warnings as errors, unless the build doesn't succeed + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.10; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + # build solc-v0.8.9 + git checkout v0.8.9; \ + # the compiler throws warnings when compiling this version, and the warnings are treated as errors. + # we disable treating the warnings as errors, unless the build doesn't succeed + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.9; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + # build solc-v0.8.4 + git checkout v0.8.4; \ + # the compiler throws warnings when compiling this version, and the warnings are treated as errors. + # we disable treating the warnings as errors, unless the build doesn't succeed + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # there is a missed header in this version - we add it so that the code compiles + grep -rl '#include ' ./liblangutil/SourceLocation.h | xargs sed -i 's/#include /#include \n#include /g'; \ + # there is a missed namespace in this version - we add it so that the code compiles + grep -rl 'size_t' ./tools/yulPhaser/PairSelections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + # there is a missed namespace in this version - we add it so that the code compiles + grep -rl 'size_t' ./tools/yulPhaser/Selections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.4; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + # build solc-v0.8.6 + git checkout v0.8.6; \ + # the compiler throws warnings when compiling this version, and the warnings are treated as errors. + # we disable treating the warnings as errors, unless the build doesn't succeed + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # there is a missed header in this version - we add it so that the code compiles + grep -rl '#include ' ./liblangutil/SourceLocation.h | xargs sed -i 's/#include /#include \n#include /g'; \ + # there is a missed namespace in this version - we add it so that the code compiles + grep -rl 'size_t' ./tools/yulPhaser/PairSelections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + # there is a missed namespace in this version - we add it so that the code compiles + grep -rl 'size_t' ./tools/yulPhaser/Selections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.6; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.8.15 + git checkout v0.8.15; \ + # the compiler throws warnings when compiling this version, and the warnings are treated as errors. + # we disable treating the warnings as errors, unless the build doesn't succeed + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.15; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.7.6 + git checkout v0.7.6; \ + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + grep -rl '#include ' ./liblangutil/SourceLocation.h | xargs sed -i 's/#include /#include \n#include /g'; \ + grep -rl 'size_t' ./tools/yulPhaser/PairSelections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + grep -rl 'size_t' ./tools/yulPhaser/Selections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.7.6; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.8.24 + git checkout v0.8.24; \ + # the compiler throws warnings when compiling this version, and the warnings are treated as errors. + # we disable treating the warnings as errors, unless the build doesn't succeed + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.24; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.6.11 + git checkout v0.6.11; \ + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + grep -rl '#include ' ./liblangutil/SourceLocation.h | xargs sed -i 's/#include /#include \n#include /g'; \ + grep -rl 'size_t' ./tools/yulPhaser/PairSelections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + grep -rl 'size_t' ./tools/yulPhaser/Selections.h | xargs sed -i 's/size_t/std::size_t/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.6.11; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # build solc-v0.8.19 + git checkout v0.8.19; \ + # the compiler throws warnings when compiling this version, and the warnings are treated as errors. + # we disable treating the warnings as errors, unless the build doesn't succeed + grep -rl '\-Werror' ./cmake/EthCompilerSettings.cmake | xargs sed -i 's/\-Werror/\-Wno\-error/g'; \ + # there is no sudo in the container, but we are under root so we do not need it + grep -rl 'sudo make install' ./scripts/build.sh | xargs sed -i 's/sudo make install/make install/g'; \ + # build solc faster + grep -rl 'make -j2' ./scripts/build.sh | xargs sed -i 's/make -j2/make -j4/g'; \ + ./scripts/build.sh; \ + mv /usr/local/bin/solc /root/.solcx/solc-v0.8.19; \ + git checkout .; \ + git checkout develop; \ + git clean -d -x -f; \ + fi + +RUN if [ "$TARGETARCH" = "arm64" ]; then \ + # manually install vyper + mkdir /root/.vvm; \ + pip install vyper==0.3.7; \ + ln -s /usr/local/bin/vyper /root/.vvm/vyper-0.3.7; \ + fi +# compilers for amd64 will be downloaded by brownie later in this Dockerfile + + +# init script that runs when the container is started for the very first time +# it will install poetry, yarn libs and init brownie networks +WORKDIR /root/scripts +RUN touch /root/init.sh +RUN echo "if [ ! -e /root/inited ]; then \n touch /root/inited \n poetry install \n yarn \n poetry run brownie networks import network-config.yaml True \n fi" > /root/init.sh +RUN chmod +x /root/init.sh + + +# install & configure sshd +ENV DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && \ + apt-get install -y openssh-server && \ + mkdir /var/run/sshd + +RUN sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config && \ + sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/' /etc/ssh/sshd_config +RUN echo 'PermitUserEnvironment yes' >> /etc/ssh/sshd_config + +# set default working dir for ssh clients +RUN echo "cd /root/scripts" >> /root/.bashrc + + +# verify prerequisites versions +RUN python --version | grep 'Python 3.10.15' || (echo "Incorrect python version" && exit 1) +RUN pip --version | grep 'pip 24.2' || (echo "Incorrect pip version" && exit 1) +RUN node --version | grep 'v18.20.4' || (echo "Incorrect node version" && exit 1) +RUN npm --version | grep '10.7.0' || (echo "Incorrect npm version" && exit 1) +RUN poetry --version | grep 'Poetry (version 1.8.2)' || (echo "Incorrect poetry version" && exit 1) +RUN yarn --version | grep '1.22.22' || (echo "Incorrect yarn version" && exit 1) +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.4.24 --version | grep 'Version: 0.4.24+commit.e67f0147' || (echo "Incorrect solc-v0.4.24 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.5.14 --version | grep 'Version: 0.5.14+commit.01f1aaa4' || (echo "Incorrect solc-v0.5.14 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.5.12 --version | grep 'Version: 0.5.12+commit.7709ece9' || (echo "Incorrect solc-v0.5.12 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.6.12 --version | grep 'Version: 0.6.12+commit.27d51765' || (echo "Incorrect solc-v0.6.12 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.28 --version | grep 'Version: 0.8.28+commit.7893614a' || (echo "Incorrect solc-v0.8.28 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.10 --version | grep 'Version: 0.8.10+commit.fc410830' || (echo "Incorrect solc-v0.8.10 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.9 --version | grep 'Version: 0.8.9+commit.e5eed63a' || (echo "Incorrect solc-v0.8.9 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.4 --version | grep 'Version: 0.8.4+commit.c7e474f2' || (echo "Incorrect solc-v0.8.4 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.6 --version | grep 'Version: 0.8.6+commit.11564f7e' || (echo "Incorrect solc-v0.8.6 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.7.6 --version | grep 'Version: 0.7.6+commit.7338295f' || (echo "Incorrect solc-v0.7.6 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.15 --version | grep 'Version: 0.8.15+commit.e14f2714' || (echo "Incorrect solc-v0.8.15 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.19 --version | grep 'Version: 0.8.19+commit.7dd6d404' || (echo "Incorrect solc-v0.8.19 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.8.24 --version | grep 'Version: 0.8.24+commit.e11b9ed9' || (echo "Incorrect solc-v0.8.24 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.solcx/solc-v0.6.11 --version | grep 'Version: 0.6.11+commit.5ef660b1' || (echo "Incorrect solc-v0.6.11 version" && exit 1) fi +RUN if [ "$TARGETARCH" = "arm64" ]; then /root/.vvm/vyper-0.3.7 --version | grep '0.3.7+' || (echo "Incorrect vyper-0.3.7 version" && exit 1) fi + +# open sshd port +EXPOSE 22 + + +# start sshd, run init script, set root password for incoming connections and pass all ENV VARs from the container +CMD ["/bin/bash", "-c", "env | grep -v 'no_proxy' >> /etc/environment && /root/init.sh && echo root:1234 | chpasswd && exec /usr/sbin/sshd -D"] diff --git a/README.md b/README.md index 7d8a12108..a67ba203e 100644 --- a/README.md +++ b/README.md @@ -14,12 +14,55 @@ Lido DAO Aragon omnibus voting scripts. -## 🏁 Getting started - - This project uses Brownie development framework. Learn more about [Brownie](https://eth-brownie.readthedocs.io/en/stable/index.html). - [Poetry](https://python-poetry.org/) dependency and packaging manager is used to bootstrap environment and keep the repo sane. +
+ +## 🐳 Docker: quick and easy environment setup +**The no-brainer workflow for setting up a Docker container to run scripts & tests** + +#### Step 1. Clone the fresh repo and build an image: +```shell +git clone git@github.com:lidofinance/scripts.git +cd scripts +docker build -t scenv . +``` +Note: *If you are running on an arm64 processor (including Apple Silicon) - you will have to wait up to 4 hours while the Solidity compilers compile.* + +#### Step 2. Set up the ENV VARs, for example: +- `WEB3_INFURA_PROJECT_ID` - **mandatory** for the execution of tests + +#### Step 3. Run the container +Run the container in the `scripts` directory and specify any ENV VARs: +```shell +docker run --name scripts -v "$(pwd)":/root/scripts -e WEB3_INFURA_PROJECT_ID -d -p 2222:22 scenv +``` +Note: *It may take up to 1 minute for the container to initialize properly the first time.* +#### Step 4. Now connect to the running container using SSH: +```shell +ssh root@localhost -p 2222 # password: 1234 +``` +> [!NOTE] +> If you see a 'REMOTE HOST IDENTIFICATION HAS CHANGED' error - `ssh-keygen -R [localhost]:2222` +> +> If you are asked 'Are you sure you want to continue connecting' - type `yes` and hit `` + +
+ +You now have a fully functional environment to run scripts & tests in, which is linked to your local scripts repo, for example: +```shell +poetry run brownie test tests/acceptance/test_accounting_oracle.py -s +``` +If your container has been stopped (for example, by a system reboot), start it: +```shell +docker start scripts +``` + +
+ +## 🏁 Manual installation ### Prerequisites @@ -28,6 +71,8 @@ Lido DAO Aragon omnibus voting scripts. - Node >= 16.0 - yarn >= 1.22 +
+ #### Step 1. Install Poetry Use the following command to install poetry: @@ -75,6 +120,8 @@ need it. poetry shell ``` +
+ ## ⚗️ Workflow ### Network setup @@ -106,6 +153,7 @@ it also could be useful to go with `holesky` and `holesky-fork` testnets first. > **Sepolia is partially supported.** > At the moment not all parameters are set in `configs/config_sepolia.py` and acceptance/regression/snapshot tests are not operational. +
### Environment variables setup @@ -170,6 +218,8 @@ To make default report for acceptance and regression tests after voting executio export REPORT_AFTER_VOTE=1 ``` +
+ ## Tests structure ### `tests/acceptance` @@ -188,6 +238,8 @@ Directory contains snapshot-scenario tests. This tests run only if there are any Tests for current voting +
+ ### Test run To run all the test on `mainnet-fork` execute @@ -214,6 +266,8 @@ See [here](tests/README.md) to learn more about tests - To re-use multiple created votes list the ids comma-separated (e.g. `OMNIBUS_VOTE_IDS=104,105`) - To force the large CI runner usage, please name your branch with the `large-vote_` prefix. +
+ ## Code style Please, use the shared pre-commit hooks to maintain code style: @@ -222,16 +276,22 @@ Please, use the shared pre-commit hooks to maintain code style: poetry run pre-commit install ``` +
+ ## Repository housekeeping Please move your outdated scripts into `archive/scripts` and outdated tests into `archive/tests` directories. +
+ ## Use cases and scripts examples - [Node operators management](usecase/node_operators_management.md) - [Reward manager tokens recovery](usecase/reward_manager_tokens_recovery.md) +
+ ## Troubleshooting ### Invalid hashes (step 2)