Skip to content

Commit

Permalink
Refactor remote db setup
Browse files Browse the repository at this point in the history
  • Loading branch information
tsudmi committed Oct 15, 2023
1 parent 1c226fd commit d6bca53
Show file tree
Hide file tree
Showing 29 changed files with 1,244 additions and 921 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ operator will submit a signature update transaction to the Vault.

The oracles periodically submit consensus rewards of all the vaults to the Keeper contract.
By default, every vault pulls these updates on the user interaction with the vault (deposit, withdraw, etc.), but it
also can be done by the vault operator by passing the `--harvest-vault` flag to the `start` command.
also can be done by the vault operator by passing the `--harvest-vault` flag to the `start` command. Harvesting vault
rewards simplifies calls to the vault contracts, e.g., you don't need to sync rewards before calling deposit.

## Usage

Expand Down
4 changes: 2 additions & 2 deletions src/commands/create_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def create_keys(
_export_keystores(
credentials=credentials,
keystores_dir=keystores_dir,
password_file=str(password_file),
password_file=password_file,
per_keystore_password=per_keystore_password,
pool_size=pool_size,
)
Expand Down Expand Up @@ -130,7 +130,7 @@ def _export_deposit_data_json(
def _export_keystores(
credentials: list[Credential],
keystores_dir: Path,
password_file: str,
password_file: Path,
per_keystore_password: bool,
pool_size: int | None = None,
) -> None:
Expand Down
6 changes: 3 additions & 3 deletions src/commands/create_wallet.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,19 +40,19 @@ def create_wallet(mnemonic: str, vault: HexAddress, data_dir: str) -> None:
wallet_dir = vault_config.vault_dir / 'wallet'

wallet_dir.mkdir(parents=True, exist_ok=True)
address = _generate_encrypted_wallet(mnemonic, str(wallet_dir))
address = _generate_encrypted_wallet(mnemonic, wallet_dir)
click.echo(
f'Done. '
f'The wallet and password saved to {greenify(wallet_dir)} directory. '
f'The wallet address is: {greenify(address)}'
)


def _generate_encrypted_wallet(mnemonic: str, wallet_dir: str) -> ChecksumAddress:
def _generate_encrypted_wallet(mnemonic: str, wallet_dir: Path) -> ChecksumAddress:
Account.enable_unaudited_hdwallet_features()

account = Account().from_mnemonic(mnemonic=mnemonic)
password = get_or_create_password_file(path.join(wallet_dir, 'password.txt'))
password = get_or_create_password_file(wallet_dir / 'password.txt')
encrypted_data = Account.encrypt(account.key, password=password)

wallet_name = 'wallet.json'
Expand Down
2 changes: 1 addition & 1 deletion src/commands/init.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
@click.option(
'--vault',
prompt='Enter your vault address',
help='Vault address',
help='The vault address.',
type=str,
callback=validate_eth_address,
)
Expand Down
2 changes: 1 addition & 1 deletion src/commands/recover.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ async def _generate_keystores(
password = (
generate_password()
if per_keystore_password
else get_or_create_password_file(str(password_file))
else get_or_create_password_file(password_file)
)
credential.save_signing_keystore(password, str(keystores_dir), per_keystore_password)
click.secho(
Expand Down
2 changes: 1 addition & 1 deletion src/commands/remote_signer_setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ async def main(remove_existing_keys: bool) -> None:
)

# Import as keystores to remote signer
password = get_or_create_password_file(str(settings.keystores_password_file))
password = get_or_create_password_file(settings.keystores_password_file)
key_share_keystores = []
for credential in credentials:
key_share_keystores.append(deepcopy(credential.encrypt_signing_keystore(password=password)))
Expand Down
183 changes: 0 additions & 183 deletions src/commands/sync_validator.py

This file was deleted.

99 changes: 0 additions & 99 deletions src/commands/sync_web3signer.py

This file was deleted.

Loading

0 comments on commit d6bca53

Please sign in to comment.