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

Refactor core, ecdsa, tbtc and tbtc-dapp Installation Into Their Own Script #60

Merged
merged 4 commits into from
Feb 10, 2021

Conversation

beaurancourt
Copy link

When we restart geth, we need to re-deploy all of our contracts.
Unfortunately, running install.sh is going to try to refetch master
which may not be what we want (we might be making changes) and also
takes time.

Instead, we refactor the installation of core, ecdsa, tbtc and tbtc-dapp
into their own install-applications-with-contracts.sh script which is
invoked from install.sh. This allows us to simply run
install-applications-with-contracts.sh if geth was restarted at some
point.

tagging @dimpar for review since we spit-balled it a bit

Beau Shinkle added 2 commits February 3, 2021 17:16
When we restart `geth`, we need to re-deploy all of our contracts.
Unfortunately, running `install.sh` is going to try to refetch master
which may not be what we want (we might be making changes) and also
takes time.

Instead, we refactor the installation of core, ecdsa, tbtc and tbtc-dapp
into their own `install-applications-with-contracts.sh` script which is
invoked from `install.sh`. This allows us to simply run
`install-applications-with-contracts.sh` if `geth` was restarted at some
point.
@beaurancourt
Copy link
Author

Verified that everything is working - gave this a test drive today when I re-installed and ran everything from complete scratch.

I was also able to shut down geth and bitcoind, start them back up, and then run install-applications-with-contracts.sh and have it work 🎉

install.sh Outdated
# Install tBTC dApp.
./install-tbtc-dapp.sh
# Install applications and their contracts
./install-applications-with-contracts.sh

# Do not install keep dashboard dApp for e2e nightly test
if [[ $E2E_TEST != true ]]
Copy link
Contributor

Choose a reason for hiding this comment

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

What do you think about moving this 'if' statement along with ./install-keep-dashboard.sh to install-applications-with-contracts.sh as well? This way, Keep Dashboard dApp installation script will be in the same place as tBTC dApp. One can pass env var E2E_TEST=true ./install.sh when working only in tBTC world and doesn't need Keep Dashboard.

Also, I'm wondering if it makes sense to rename $E2E_TEST -> $INCLUDE_KEEP_DASHBOARD, ie:

# Install keep dashboard dApp when it is needed. In most cases we do not need
# Keep Dashboard when working on e2e tests or working on tBTC.
if [[ $INCLUDE_KEEP_DASHBOARD == true ]]
then
    # Install Keep Dashboard.
    ./install-keep-dashboard.sh
fi

Copy link
Author

Choose a reason for hiding this comment

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

What do you think about moving this 'if' statement along with ./install-keep-dashboard.sh to install-applications-with-contracts.sh as well?

💯

I'm wondering if it makes sense to rename $E2E_TEST -> $INCLUDE_KEEP_DASHBOARD

My only hesitation there would be the case where $E2E_TEST is being used in our testing scripts or build tool scripts or something

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes, you're right! We have one reference in here and I think this is all. I've introduced E2E_TEST here. Most likely that's the only change, cause I just wanted to speed up the local-setup setup.

Copy link
Author

Choose a reason for hiding this comment

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

Gotcha - In that case I think it would be better if we scoped this PR to just the script changes and leave refactoring $E2E_TEST for another PR. That okay with you?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, changes around scripts look good to me!

Copy link
Contributor

Choose a reason for hiding this comment

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

Created issue to rename $E2E_TEST #63

Beau Shinkle added 2 commits February 9, 2021 14:36
…s.sh

This prepares us to include ./install-keep-dashboard.sh as a part of
install-applications.sh
@dimpar dimpar mentioned this pull request Feb 10, 2021
@dimpar dimpar merged commit f33e28a into master Feb 10, 2021
@dimpar dimpar deleted the refactor-contract-scripts branch February 10, 2021 09:31
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