Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print Electrum URL in the logs #3596

Merged
merged 5 commits into from
Jun 5, 2023
Merged

Print Electrum URL in the logs #3596

merged 5 commits into from
Jun 5, 2023

Conversation

pdyraga
Copy link
Member

@pdyraga pdyraga commented May 31, 2023

Unless specified in the config, mainnet client binary selects the Electrum server from one of the preconfigured nodes. It is nice to know which server was selected, even for debugging purposes. Additionally, we should log both Bitcoin and Ethereum networks used by the client. Electrum server URL is printed to the logs only if it has been auto-selected. This approach is consistent with not logging Ethereum server URL at all given we expect it is passed in the configuration.

I snaked one more change in this PR: fixed the number of accounts requirement in scripts/install.sh. Given the recent changes in tbtc-v2 project, at least 11 accounts are required in the local Ethereum client keystore to deploy and initialize contracts.

The v1Redeemer set in tbtc-v2 hardhat.config.ts uses index 10 and indexes start from 0.

Example:

2023-06-05T08:54:24.185+0200    INFO    keep-config     config/config.go:95     using [mainnet] Ethereum network and [mainnet] Bitcoin network
2023-06-05T08:54:24.187+0200    INFO    keep-config     config/electrum.go:68   Auto-selecting Electrum server: [ssl://electrum.blockstream.info:50002]

Given the recent changes in tbtc-v2 project, at least 11 accounts are
required in the local Ethereum client keystore to deploy and initialize
contracts.

The v1Redeemer set in tbtc-v2 hardhat.config.ts uses index 10 and
indexes start from 0.
Unless specified in the config, mainnet client binary selects Electrum
server from one of the preconfigured nodes. It is nice to know which
server was selected, even for debug purposes.
@pdyraga pdyraga requested a review from nkuba May 31, 2023 19:16
@pdyraga pdyraga added this to the v2.0.0-m3 milestone May 31, 2023
We are not logging Ethereum server URL and we expect it to be set in the
configuration.

For Electrum server, we use a similar behavior now. When it is set in
the configuration, we are not logging it. When it is auto-selected from
the servers hardcoded in the binary, we print it to logs in the config
logger.

I have also moved the log informing about Ethereum network to the config
level and added there information about Bitcoin network.
tomaszslabon
tomaszslabon previously approved these changes Jun 5, 2023
config/config.go Show resolved Hide resolved
config/electrum.go Outdated Show resolved Hide resolved
@nkuba nkuba merged commit cdddee4 into main Jun 5, 2023
@nkuba nkuba deleted the print-electrum-url branch June 5, 2023 10:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants