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

protocol/README: incorrect instructions for testing with a local cosmos-sdk or cometbft fork #1429

Open
SheldonHolmgren opened this issue Apr 27, 2024 · 1 comment
Labels

Comments

@SheldonHolmgren
Copy link

protocol/README.md suggests inserting the following replace directive in go.mod

	github.com/cosmos/cosmos-sdk v0.47.0-alpha2 => /Users/bryce/projects/cosmos-sdk

in order to test with a local fork of cosmos-sdk. However, that won't work because the docker container cannot access that path.

My workaround has been the following:

  1. Create a new subdirectory protocol/my_forks
  2. Clone dydx's forks of cosmos-sdk, cometbft and iavl into that subdirectory
  3. Add the new subdirectory to .gitignore
  4. Mount the new subdirectory in the Dockerfile:
diff --git a/protocol/Dockerfile b/protocol/Dockerfile
index e7246444..868c820b 100644
--- a/protocol/Dockerfile
+++ b/protocol/Dockerfile
@@ -20,6 +20,7 @@ WORKDIR /dydxprotocol
 COPY go.* ./
 RUN --mount=type=cache,target=/root/.cache/go-build \
     --mount=type=cache,target=/root/go/pkg/mod \
+    --mount=type=bind,source=my_forks,dst=/dydxprotocol/my_forks,ro \
     go mod download

If that sounds like the right approach, I will create a PR that updates the README. I'm not doing that yet because I'm a newcomer to both the dydx and docker and there might be a smarter way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

1 participant