dydxprotocol / v4-chain

dydx v4 protocol
Other
205 stars 89 forks source link

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

Open SheldonHolmgren opened 2 months ago

SheldonHolmgren commented 2 months ago

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.

linear[bot] commented 2 months ago

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