Skip to content

Commit

Permalink
Merge pull request #170 from lidofinance/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
F4ever authored Dec 11, 2023
2 parents a83d1ec + d4960e4 commit 9ac87be
Show file tree
Hide file tree
Showing 109 changed files with 12,621 additions and 3,793 deletions.
37 changes: 37 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
WEB3_RPC_ENDPOINTS=https://goerli.infura.io/v3/<key>

# Account private key
# Publicity known private key. Generated with `test test ... test` mnemonic.
WALLET_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

# App specific
# LIDO_LOCATOR ADDRESS
# Mainnet: 0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb
# Görli: 0x1eDf09b5023DC86737b59dE68a8130De878984f5
LIDO_LOCATOR=0x1eDf09b5023DC86737b59dE68a8130De878984f5

# DEPOSIT_CONTRACT ADDRESS
# Mainnet: 0x00000000219ab540356cBB839Cbe05303d7705Fa
# Görli: 0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b
DEPOSIT_CONTRACT=0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b

# rabbit / kafka / rabbit,kafka
MESSAGE_TRANSPORTS=rabbit

# rabbit secrets
RABBIT_MQ_URL=ws://127.0.0.1:15674/ws
RABBIT_MQ_USERNAME=guest
RABBIT_MQ_PASSWORD=guest

# Transactions settings
CREATE_TRANSACTIONS=true

# FLASHBOTS_RPC URL
# Mainnet: "https://relay.flashbots.net",
# Görli: "https://relay-goerli.flashbots.net",
FLASHBOTS_RPC=https://relay-goerli.flashbots.net
# Must be different from WALLET_PRIVATE_KEY
FLASHBOT_SIGNATURE=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80

# List of staking module's ids in which the depositor bot will make deposits
DEPOSIT_MODULES_WHITELIST=1
14 changes: 14 additions & 0 deletions .github/workflows/checks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Tests and Checks

on: push

jobs:
security:
uses: lidofinance/linters/.github/workflows/security.yml@master
permissions:
security-events: write
contents: read
docker:
uses: lidofinance/linters/.github/workflows/docker.yml@master
actions:
uses: lidofinance/linters/.github/workflows/actions.yml@master
3 changes: 0 additions & 3 deletions .github/workflows/ci-dev-goerli.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ on:
permissions: {}

jobs:
# test:
# ...

deploy:
runs-on: ubuntu-latest
# needs: test
Expand Down
28 changes: 3 additions & 25 deletions .github/workflows/ci-prod.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
name: CI Build prod image

on:
workflow_call:
inputs:
tag:
description: "tag to deploy from"
default: ""
required: false
type: string
release:
types: [released]

permissions:
contents: read
permissions: {}

jobs:
# test:
Expand All @@ -21,22 +15,6 @@ jobs:
# needs: test
name: Build and deploy
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false

- name: Tag name
id: tag_name
run: |
if [ '${{ inputs.tag }}' = '' ]; then
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
else
echo "TAG=$TAG" >> $GITHUB_OUTPUT
fi
env:
TAG: ${{ inputs.tag }}

- name: Build prod image
uses: lidofinance/dispatch-workflow@v1
env:
Expand Down
46 changes: 0 additions & 46 deletions .github/workflows/create-tag-and-trigger-deploy.yml

This file was deleted.

14 changes: 14 additions & 0 deletions .github/workflows/prepare-release-draft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: Prepare release draft
on:
push:
branches:
- main

permissions:
contents: write

jobs:
prepare-release-draft:
uses: lidofinance/actions/.github/workflows/prepare-release-draft.yml@main
with:
target: main
46 changes: 0 additions & 46 deletions .github/workflows/prepare-release.yml

This file was deleted.

32 changes: 21 additions & 11 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,28 @@ jobs:
run: |
poetry install
- name: Test with pytest
- name: Unit Tests with pytest
run: |
poetry run pytest tests
poetry run pytest tests -m unit
security:
uses: lidofinance/linters/.github/workflows/security.yml@master
permissions:
security-events: write
contents: read
- name: Set up node
uses: actions/setup-node@v3.0.0
with:
node-version: '18.17.1'
cache: 'yarn'

- name: Install dependencies
run: yarn install --immutable

docker:
uses: lidofinance/linters/.github/workflows/docker.yml@master
- name: Run chronix
run: |
yarn chronix start &
- name: Integration tests with pytest
run: |
poetry run pytest tests -m integration
env:

actions:
uses: lidofinance/linters/.github/workflows/actions.yml@master
WEB3_RPC_ENDPOINTS: ${{ secrets.WEB3_RPC_ENDPOINT }}
DEPOSIT_CONTRACT: "0x00000000219ab540356cBB839Cbe05303d7705Fa"
LIDO_LOCATOR: "0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,5 @@ debug.log

#cache
deposit_contract_cache/

node_modules/
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
## [4.2.1](https://github.com/lidofinance/depositor-bot/compare/4.2.0...4.2.1) (2023-05-15)

# This file is no longer used by semantic-release
For the latest release notes, please see the [GitHub releases page](https://github.com/lidofinance/depositor-bot/releases).

## [4.2.1](https://github.com/lidofinance/depositor-bot/compare/4.2.0...4.2.1) (2023-05-15)

# [4.2.0](https://github.com/lidofinance/depositor-bot/compare/v3.3.1...4.2.0) (2023-04-21)


### Bug Fixes

* _do_classic_deposit ([4d6d379](https://github.com/lidofinance/depositor-bot/commit/4d6d379d8bc6283ac02c68361c9fe1aeac705e39))
Expand Down
32 changes: 22 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,35 @@
FROM python:3.10.6-slim-bullseye as base
FROM python:3.10.6-slim as base

RUN apt-get update && apt-get install -y --no-install-recommends -qq gcc=4:10.2.1-1 libffi-dev=3.3-6 g++=4:10.2.1-1 curl=7.74.0-1.3+deb11u7 \
RUN apt-get update && apt-get install -y --no-install-recommends -qq \
gcc=4:10.2.1-1 \
libffi-dev=3.3-6 \
g++=4:10.2.1-1 \
curl=7.74.0-1.3+deb11u10 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONUNBUFFERED 1
ENV PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1 \
PIP_NO_CACHE_DIR=off \
PIP_DISABLE_PIP_VERSION_CHECK=on \
PIP_DEFAULT_TIMEOUT=100 \
VENV_PATH="/.venv"

WORKDIR /app

FROM base as builder

ENV POETRY_VERSION=1.4.2
ENV POETRY_HOME=/opt/poetry
ENV POETRY_VIRTUALENVS_IN_PROJECT=true
ENV PATH="$POETRY_HOME/bin:$PATH"
ENV POETRY_VERSION=1.4.2 \
POETRY_VIRTUALENVS_IN_PROJECT=true \
POETRY_NO_INTERACTION=1 \
POETRY_HOME=/opt/poetry \
PATH="/opt/poetry/bin:$PATH"

WORKDIR /app
RUN pip install --no-cache-dir poetry==$POETRY_VERSION
# Set the SHELL option -o pipefail before RUN with a pipe in
SHELL ["/bin/bash", "-o", "pipefail", "-c"]

# install poetry - respects $POETRY_VERSION & $POETRY_HOME
RUN curl -sSL https://install.python-poetry.org | python -

COPY pyproject.toml poetry.lock ./
RUN poetry install
Expand Down
Loading

0 comments on commit 9ac87be

Please # to comment.