-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
92 additions
and
77 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,9 @@ | ||
from eth_account import Account | ||
|
||
import variables | ||
from blockchain.executor import Executor | ||
from blockchain.web3_extentions.bundle import activate_relay | ||
from bots.depositor import DepositorBot | ||
from main import main | ||
from metrics.logging import logging | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def run_depositor(w3): | ||
if variables.AUCTION_BUNDLER_PRIVATE_KEY and variables.AUCTION_BUNDLER_URIS: | ||
logger.info({'msg': 'Add private relays.'}) | ||
activate_relay(w3, Account.from_key(variables.AUCTION_BUNDLER_PRIVATE_KEY), variables.AUCTION_BUNDLER_URIS) | ||
else: | ||
logger.info({'msg': 'No flashbots available for this network.'}) | ||
|
||
logger.info({'msg': 'Initialize Depositor bot.'}) | ||
depositor_bot = DepositorBot(w3) | ||
|
||
e = Executor( | ||
w3, | ||
depositor_bot.execute, | ||
5, | ||
variables.MAX_CYCLE_LIFETIME_IN_SECONDS, | ||
) | ||
logger.info({'msg': 'Execute depositor as daemon.'}) | ||
e.execute_as_daemon() | ||
if __name__ == '__main__': | ||
main('depositor') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,9 @@ | ||
from web3 import Web3 | ||
|
||
import variables | ||
from blockchain.executor import Executor | ||
from bots.pauser import PauserBot | ||
from main import main | ||
from metrics.logging import logging | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def run_pauser(w3: Web3): | ||
pause = PauserBot(w3) | ||
e = Executor( | ||
w3, | ||
pause.execute, | ||
1, | ||
variables.MAX_CYCLE_LIFETIME_IN_SECONDS, | ||
) | ||
logger.info({'msg': 'Execute pauser as daemon.'}) | ||
e.execute_as_daemon() | ||
if __name__ == '__main__': | ||
main('pauser') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,9 @@ | ||
import time | ||
|
||
import variables | ||
from blockchain.executor import Executor | ||
from blockchain.typings import Web3 | ||
from bots.unvetter import UnvetterBot | ||
from metrics.healthcheck_pulse import pulse | ||
from main import main | ||
from metrics.logging import logging | ||
|
||
|
||
logger = logging.getLogger(__name__) | ||
|
||
|
||
def run_unvetter(w3: Web3): | ||
unvetter = UnvetterBot(w3) | ||
e = Executor( | ||
w3, | ||
unvetter.execute, | ||
1, | ||
variables.MAX_CYCLE_LIFETIME_IN_SECONDS, | ||
) | ||
logger.info({'msg': 'Execute unvetter as daemon.'}) | ||
e.execute_as_daemon() | ||
if __name__ == '__main__': | ||
main('unvetter') |