Skip to content

Commit

Permalink
Merge pull request #179 from lidofinance/feat/move-to-private-relays
Browse files Browse the repository at this point in the history
Feat/move to private relays
  • Loading branch information
F4ever authored Oct 12, 2023
2 parents 4d69820 + 6693ae7 commit b4f8021
Show file tree
Hide file tree
Showing 51 changed files with 9,688 additions and 5,741 deletions.
7 changes: 6 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
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
Expand Down Expand Up @@ -29,4 +30,8 @@ CREATE_TRANSACTIONS=true
# Mainnet: "https://relay.flashbots.net",
# Görli: "https://relay-goerli.flashbots.net",
FLASHBOTS_RPC=https://relay-goerli.flashbots.net
FLASHBOT_SIGNATURE=0xbb0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ffaa
# 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
15 changes: 10 additions & 5 deletions .github/workflows/tests_and_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,18 @@ jobs:
run: |
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: Set up node
uses: actions/[email protected]
with:
node-version: '18.17.1'
cache: 'yarn'

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

- name: Run hardhat
- name: Run chronix
run: |
npx hardhat node --fork ${{ secrets.WEB3_RPC_ENDPOINT }} &
yarn chronix start &
- name: Integration Tests with pytest
run: |
Expand Down
41 changes: 21 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ This deposit is executed using the depositBufferedEther function within the "Dep
- Set WEB3_RPC_ENDPOINTS
- Set WALLET_PRIVATE_KEY
- Set CREATE_TRANSACTIONS to true
- Set TRANSPORTS to rabbit
- Set MESSAGE_TRANSPORTS to rabbit
- Set RABBIT_MQ_URL, RABBIT_MQ_USERNAME and RABBIT_MQ_PASSWORD
3. ```docker-compose up```
4. Send metrics and logs to grafana
Expand All @@ -40,25 +40,26 @@ This deposit is executed using the depositBufferedEther function within the "Dep

### Required variables

| Variable | Default | Description |
|-----------------------------------------|--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| WEB3_RPC_ENDPOINTS | - | List of rpc endpoints that will be used to send requests comma separated (`,`) |
| WALLET_PRIVATE_KEY | - | Account private key |
| CREATE_TRANSACTIONS | false | If true then tx will be send to blockchain |
| LIDO_LOCATOR | 0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb | Lido Locator address. Mainnet by default. Other networks could be found [here](https://docs.lido.fi/deployed-contracts/) |
| DEPOSIT_CONTRACT | 0x00000000219ab540356cBB839Cbe05303d7705Fa | Ethereum deposit contract address |
| -------------------------------------- | -------------------------------------- | ----------------------------------------- |
| TRANSPORTS | - | Transports used in bot. One of/or both: rabbit/kafka |
| RABBIT_MQ_URL | - | RabbitMQ url |
| RABBIT_MQ_USERNAME | - | RabbitMQ username for virtualhost |
| RABBIT_MQ_PASSWORD | - | RabbitMQ password for virtualhost |
| -------------------------------------- | --- _kafka is not used at the moment_ --- | ----------------------------------------- |
| KAFKA_BROKER_ADDRESS_1 | - | Kafka servers url and port |
| KAFKA_USERNAME | - | Kafka username |
| KAFKA_PASSWORD | - | Kafka password |
| KAFKA_NETWORK | - | Network type (mainnet or goerli) |
| KAFKA_TOPIC | - | Kafka topic name (for msg receiving) |
| KAFKA_GROUP_PREFIX | - | Just for staging (staging-) |
| Variable | Default | Description |
|---------------------------|--------------------------------------------|--------------------------------------------------------------------------------------------------------------------------|
| WEB3_RPC_ENDPOINTS | - | List of rpc endpoints that will be used to send requests comma separated (`,`) |
| WALLET_PRIVATE_KEY | - | Account private key |
| CREATE_TRANSACTIONS | false | If true then tx will be send to blockchain |
| LIDO_LOCATOR | 0xC1d0b3DE6792Bf6b4b37EccdcC24e45978Cfd2Eb | Lido Locator address. Mainnet by default. Other networks could be found [here](https://docs.lido.fi/deployed-contracts/) |
| DEPOSIT_CONTRACT | 0x00000000219ab540356cBB839Cbe05303d7705Fa | Ethereum deposit contract address |
| DEPOSIT_MODULES_WHITELIST | 1 | List of staking module's ids in which the depositor bot will make deposits |
| --- | --- | --- |
| MESSAGE_TRANSPORTS | - | Transports used in bot. One of/or both: rabbit/kafka |
| RABBIT_MQ_URL | - | RabbitMQ url |
| RABBIT_MQ_USERNAME | - | RabbitMQ username for virtualhost |
| RABBIT_MQ_PASSWORD | - | RabbitMQ password for virtualhost |
| --- | --- _kafka is not used at the moment_ --- | --- |
| KAFKA_BROKER_ADDRESS_1 | - | Kafka servers url and port |
| KAFKA_USERNAME | - | Kafka username |
| KAFKA_PASSWORD | - | Password for kafka |
| KAFKA_NETWORK | - | Network type (mainnet or goerli) |
| KAFKA_TOPIC | - | Kafka topic name (for msg receiving) |
| KAFKA_GROUP_PREFIX | - | Just for staging (staging-) |

### Additional variables

Expand Down
9 changes: 9 additions & 0 deletions chronix.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
module.exports = {
engine: {
port: 8080,
},
commands: {
test: 'poetry run pytest tests -m integration',
},
plugins: ['simple-dvt-v1'],
};
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,13 @@ services:
- WEB3_RPC_ENDPOINTS=${WEB3_RPC_ENDPOINTS}
- WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY}
- CREATE_TRANSACTIONS=${CREATE_TRANSACTIONS}
- TRANSPORTS=${TRANSPORTS}
- MESSAGE_TRANSPORTS=${MESSAGE_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}
- DEPOSIT_MODULES_WHITELIST=${DEPOSIT_MODULES_WHITELIST}
command: src/depositor.py

lido-pause-bot:
Expand All @@ -30,7 +31,7 @@ services:
- WEB3_RPC_ENDPOINTS=${WEB3_RPC_ENDPOINTS}
- WALLET_PRIVATE_KEY=${WALLET_PRIVATE_KEY}
- CREATE_TRANSACTIONS=${CREATE_TRANSACTIONS}
- TRANSPORTS=${TRANSPORTS}
- MESSAGE_TRANSPORTS=${MESSAGE_TRANSPORTS}
- RABBIT_MQ_URL=${RABBIT_MQ_URL}
- RABBIT_MQ_USERNAME=${RABBIT_MQ_USERNAME}
- RABBIT_MQ_PASSWORD=${RABBIT_MQ_PASSWORD}
Expand Down
15 changes: 0 additions & 15 deletions hardhat.config.js

This file was deleted.

Loading

0 comments on commit b4f8021

Please sign in to comment.