Skip to content

Commit

Permalink
Revert "Revert "Merge pull request #164 from lidofinance/feat/deposit…
Browse files Browse the repository at this point in the history
…or-rework""

This reverts commit 0e52d3f.
  • Loading branch information
F4ever committed Sep 11, 2023
1 parent 9ef0c94 commit 46abb8b
Show file tree
Hide file tree
Showing 87 changed files with 6,773 additions and 1,993 deletions.
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
# 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
FLASHBOT_SIGNATURE=0xbb0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ffaa
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 }} &
- 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

0 comments on commit 46abb8b

Please sign in to comment.