Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Depositor rework #164

Merged
merged 22 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
WEB3_RPC_ENDPOINTS=https://goerli.infura.io/v3/<key>

# Account private key
infloop marked this conversation as resolved.
Show resolved Hide resolved
# Publicity known private key. Generated with `test test ... test` mnemonic.
WALLET_PRIVATE_KEY=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80
infloop marked this conversation as resolved.
Show resolved Hide resolved

# 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
FLASHBOT_SIGNATURE=0xbb0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ffaa
Comment on lines +32 to +33
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20 changes: 18 additions & 2 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,25 @@ jobs:
run: |
poetry install

- name: Test with pytest
- name: Unit Tests with pytest
run: |
poetry run pytest tests
poetry run pytest tests -m unit

- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
- run: npm install --save-dev hardhat

- name: Run hardhat
run: |
npx hardhat node --fork ${{ secrets.WEB3_RPC_ENDPOINT }} &
infloop marked this conversation as resolved.
Show resolved Hide resolved

- name: Integration Tests with pytest
run: |
poetry run pytest tests -m integration
env:
WEB3_RPC_ENDPOINTS: http://127.0.0.1:8545
DEPOSIT_CONTRACT: "0xff50ed3d0ec03aC01D4C79aAd74928BFF48a7b2b"
LIDO_LOCATOR: "0x1eDf09b5023DC86737b59dE68a8130De878984f5"

security:
uses: lidofinance/linters/.github/workflows/security.yml@master
Expand Down
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/
197 changes: 133 additions & 64 deletions README.md

Large diffs are not rendered by default.

24 changes: 14 additions & 10 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,15 @@ services:
ports:
- 127.0.0.1:9000:9000
environment:
- NETWORK=${NETWORK}
- WEB3_RPC_ENDPOINTS=${WEB3_RPC_ENDPOINTS}
- WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY}
- KAFKA_BROKER_ADDRESS_1=${KAFKA_BROKER_ADDRESS_1}
- KAFKA_USERNAME=${KAFKA_USERNAME}
- KAFKA_PASSWORD=${KAFKA_PASSWORD}
- KAFKA_TOPIC=${KAFKA_TOPIC}
- CREATE_TRANSACTIONS=${CREATE_TRANSACTIONS}
- TRANSPORTS=${TRANSPORTS}
- RABBIT_MQ_URL=${RABBIT_MQ_URL}
- RABBIT_MQ_USERNAME=${RABBIT_MQ_USERNAME}
- RABBIT_MQ_PASSWORD=${RABBIT_MQ_PASSWORD}
- FLASHBOTS_RPC=${FLASHBOTS_RPC}
- FLASHBOT_SIGNATURE=${FLASHBOT_SIGNATURE}
command: src/depositor.py

lido-pause-bot:
Expand All @@ -24,10 +27,11 @@ services:
ports:
- 127.0.0.1:9001:9000
environment:
- NETWORK=${NETWORK}
- WEB3_RPC_ENDPOINTS=${WEB3_RPC_ENDPOINTS}
- WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY}
- KAFKA_BROKER_ADDRESS_1=${KAFKA_BROKER_ADDRESS_1}
- KAFKA_USERNAME=${KAFKA_USERNAME}
- KAFKA_PASSWORD=${KAFKA_PASSWORD}
- KAFKA_TOPIC=${KAFKA_TOPIC}
- CREATE_TRANSACTIONS=${CREATE_TRANSACTIONS}
- TRANSPORTS=${TRANSPORTS}
- RABBIT_MQ_URL=${RABBIT_MQ_URL}
- RABBIT_MQ_USERNAME=${RABBIT_MQ_USERNAME}
- RABBIT_MQ_PASSWORD=${RABBIT_MQ_PASSWORD}
command: src/pauser.py
15 changes: 15 additions & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/** @type import('hardhat/config').HardhatUserConfig */
module.exports = {
solidity: "0.8.19",
networks: {
hardhat: {
mining: {
auto: true,
interval: 12000
}
}
},
localhost: {
timeout: 100_000
},
};
Loading