Skip to content

Commit

Permalink
Fix upload keypairs (#427)
Browse files Browse the repository at this point in the history
* Fix upload-keypairs

* Add items to gitignore
  • Loading branch information
evgeny-stakewise authored Nov 12, 2024
1 parent f0690d7 commit f618743
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,6 @@ build
database
*.db
.DS_Store
.vscode
.coverage
.python-version
8 changes: 7 additions & 1 deletion src/remote_db/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from click import Context
from eth_typing import ChecksumAddress, HexAddress

from src.common.clients import setup_clients
from src.common.utils import greenify, log_verbose
from src.common.validators import validate_db_uri, validate_eth_address
from src.common.vault_config import VaultConfig
Expand Down Expand Up @@ -167,12 +168,17 @@ def upload_keypairs(
pool_size=pool_size,
)
try:
asyncio.run(tasks.upload_keypairs(ctx.obj['db_url'], encrypt_key))
asyncio.run(_setup_clients_and_upload_keypairs(ctx.obj['db_url'], encrypt_key))
click.echo(f'Successfully uploaded keypairs for the {greenify(settings.vault)} vault.')
except Exception as e:
log_verbose(e)


async def _setup_clients_and_upload_keypairs(db_url: str, encrypt_key: str) -> None:
await setup_clients()
await tasks.upload_keypairs(db_url, encrypt_key)


@remote_db_group.command(help='Retrieves web3signer private keys from the database.')
@click.option(
'--encrypt-key',
Expand Down

0 comments on commit f618743

Please sign in to comment.