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

Dockerize the development environment #576

Closed
wants to merge 3 commits into from

Conversation

theref
Copy link
Member

@theref theref commented Jul 19, 2023

No description provided.

@theref theref added the ☁️ infrastructure CI, Infrastructure, Workflows label Jul 19, 2023
@theref theref marked this pull request as draft July 19, 2023 16:47
@theref
Copy link
Member Author

theref commented Jul 20, 2023

Next issue :D finishing up for the day though, so will take a look tomorrow Screenshot 2023-07-20 at 15 57 18

@r-czajkowski
Copy link
Collaborator

Next issue :D finishing up for the day though, so will take a look tomorrow Screenshot 2023-07-20 at 15 57 18

You need to install correct dependencies and set env variables. It depends on the network- eg if you want to run the dapp on goerli test network you need to use goerli tag for dependencies and set the env variables as below:

package.json

"@keep-network/coverage-pools": "goerli",
    "@keep-network/ecdsa": "goerli",
    "@keep-network/keep-core": "1.8.1-goerli.0",
    "@keep-network/keep-ecdsa": "goerli",
    "@keep-network/random-beacon": "goerli",
    "@keep-network/tbtc": "goerli",
    "@keep-network/tbtc-v2": "goerli",
    "@keep-network/tbtc-v2.ts": "development",
    "@threshold-network/components": "development",
    "@threshold-network/solidity-contracts": "goerli",

.env

REACT_APP_SUPPORTED_CHAIN_ID=5
REACT_APP_ETH_HOSTNAME_HTTP=https://goerli.infura.io/v3/<your API key here>
REACT_APP_ETH_HOSTNAME_WS=wss://goerli.infura.io/v3/<your API key here>
REACT_APP_MULTICALL_ADDRESS=$MULTICALL_ADDRESS

REACT_APP_FEATURE_FLAG_TBTC_V2=true
REACT_APP_FEATURE_FLAG_TBTC_V2_REDEMPTION=true
REACT_APP_FEATURE_FLAG_MULTI_APP_STAKING=true
REACT_APP_FEATURE_FLAG_FEEDBACK_MODULE=false
REACT_APP_FEATURE_FLAG_POSTHOG=false
REACT_APP_FEATURE_FLAG_SENTRY=$SENTRY_SUPPORT
REACT_APP_SENTRY_DSN=$SENTRY_DSN

REACT_APP_ELECTRUM_PROTOCOL=wss
REACT_APP_ELECTRUM_HOST=electrumx-server.test.tbtc.network
REACT_APP_ELECTRUM_PORT=8443
REACT_APP_MOCK_BITCOIN_CLIENT=false

REACT_APP_WALLET_CONNECT_PROJECT_ID=$WALLET_CONNECT_PROJECT_ID

If you want to run the dapp against your local chain it's more complicated because you have to deploy all contracts to your local chain and link dependencies. I believe @beaurancourt is working on setting up all environments(deploying necessary contracts, setting up nodes, setting up bitcoin server, running dapp) locally.

@theref
Copy link
Member Author

theref commented Jul 21, 2023

thanks @r-czajkowski !! @beaurancourt is there a branch somewhere? I'm more than happy to just contribute to your stuff instead of duplicating effort :)

@beaurancourt
Copy link

Here's the base layer: keep-network/local-setup#156

There's also https://github.com/keep-network/local-setup/tree/build-keep-core which is my WIP branch for getting keep-core to work. The main thorn right now is that in order for the light relay to do it's job, we need to use bitcoin signet instead of bitcoin regtest, and getting that to work has been a lot of yak shaving.

I hit the same UI bug you did above; so the UI stuff I did isn't valuable yet.

My goal here is to have the UI and keep-core both plugged into local bitcoin signet and local geth with all of the relevant contracts deployed!

@theref
Copy link
Member Author

theref commented Aug 24, 2023

Ok, after making the changes to .env and package.json above I've got the dashboard working in a local docker env.
I sometimes get this:
Screenshot 2023-08-24 at 11 33 53
When the app doesn't see my wallet properly (using Frame). However, that's intermittent, and the error can be closed and the app will load.

I've also updated the README. I think this is now ready for review - it's certainly suitable to be used for basic front end dev. Not all functionality can be tested though because it doesn't hook into the Keep Local Setup that @beaurancourt mentioned.

@cygnusv Would appreciate you checking this branch out and making sure that it works for you too.

@theref theref marked this pull request as ready for review August 24, 2023 09:38
@theref theref changed the title WIP: Dockerize the development environment Dockerize the development environment Aug 24, 2023
@theref theref requested a review from KPrasch August 24, 2023 09:57
@michalsmiarowski
Copy link
Contributor

michalsmiarowski commented Aug 24, 2023

Ok, after making the changes to .env and package.json above I've got the dashboard working in a local docker env. I sometimes get this: Screenshot 2023-08-24 at 11 33 53 When the app doesn't see my wallet properly (using Frame). However, that's intermittent, and the error can be closed and the app will load.

I've also updated the README. I think this is now ready for review - it's certainly suitable to be used for basic front end dev. Not all functionality can be tested though because it doesn't hook into the Keep Local Setup that @beaurancourt mentioned.

@cygnusv Would appreciate you checking this branch out and making sure that it works for you too.

@theref I believe this error is happening because you didn't put your infura api key inside the .env file. I've got the same error when running it locally when i don't put it there.

.env

REACT_APP_SUPPORTED_CHAIN_ID=5
REACT_APP_ETH_HOSTNAME_HTTP=https://goerli.infura.io/v3/<your API key here>
REACT_APP_ETH_HOSTNAME_WS=wss://goerli.infura.io/v3/<your API key here>
(...)

You have to put it in a place of <your API key here>.

EDIT: we might want to put tha in the README file too

@theref
Copy link
Member Author

theref commented Aug 24, 2023

I changed the env variables when running locally, just didn't commit them because then my infura api key would be public. As I said, it's intermittent, and seems to be to do with the wallet that I use (Frame is dodgy, metamask seems fine)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
☁️ infrastructure CI, Infrastructure, Workflows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants