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

Testnet-ready end-to-end test script #20

Merged
merged 11 commits into from
Aug 7, 2020
Merged

Testnet-ready end-to-end test script #20

merged 11 commits into from
Aug 7, 2020

Conversation

lukasz-zimnoch
Copy link
Member

@lukasz-zimnoch lukasz-zimnoch commented Jul 28, 2020

Refs: keep-network/tbtc#703
Depends on: keep-network/tbtc.js#58

Here we modify the e2e-test.js script to enable the interaction with Keep testnet.

Summary

  • Got rid of the direct dependency on Bitcoin RPC and stick to ElectrumX + bcoin library. This increases portability and allows us to run the script against both local-setup instances and testnet.
  • Introduced manual construction of deposit transactions instead of use RPC's sendtoaddress. This opens new customization capabilities for future (e.g. test different types of transactions)
  • Aligned local-setup scripts to keep the current functionality
  • Externalized the configuration to command line parameters
  • Introduced a Dockerfile which allows to build and run e2e-test.js independently against an arbitrary environment and avoid the installation of a local-setup instance
  • Introduced the k8s cron job config (deployments/e2e-test) to continuously execute the e2e test script against the testnet

Change the local BTC node logic and always mine
to a predictable address.
Got rid of the direct dependency on Bitcoin RPC node
and use Electrum with the offline bcoin wallet instead.
@lukasz-zimnoch lukasz-zimnoch marked this pull request as ready for review July 29, 2020 14:09
# Get an address.
address=$(btccli getnewaddress)
# Use a specific private key.
privateKey="cTj6Z9fxMr4pzfpUhiN8KssVzZjgQz9zFCfh87UrH8ZLjh3hGZKF"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it expected that this is the same value as stored in kube's secret e2e-test-secret/bitcoin-depositor-pk?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not necessary but it can be if there is such intention. bitcoin/bitcoind/entrypoint.sh is the local BTC node script and here we use an explicit private key in order to send the coinbase to a predictable address and use it as input for deposit transactions in the e2e test script executed against the local environment.

@nkuba nkuba merged commit 0bb27c3 into master Aug 7, 2020
@lukasz-zimnoch lukasz-zimnoch deleted the testnet-readiness branch August 7, 2020 10:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants