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

Migrations on Devnet #1576

Open
cipherzzz opened this issue Oct 4, 2024 · 1 comment
Open

Migrations on Devnet #1576

cipherzzz opened this issue Oct 4, 2024 · 1 comment
Assignees

Comments

@cipherzzz
Copy link

Summary

I'd like to be able to have granular migrations similar to most tooling so that I can test out my migrations and have a well known migration path.

Setup

# create new project
clarinet new devnet-feature && cd devnet-feature && npm i

# create contracts
clarinet contract new contract-v1
clarinet contract new contract-v2

# generate deployments
clarinet deployment generate --devnet
 mv deployments/default.devnet-plan.yaml  ./deployments/initial.deploy.
yaml
# remove `contract-v2`  from the deployment file above

clarinet deployment generate --devnet
 mv deployments/default.devnet-plan.yaml  ./deployments/upgrade.deploy.
yaml
# remove `contract-v1`  from the deployment file above

# Run initial deployment
clarinet integrate --deployment-plan-path=./deployments/initial.deploy.yaml

Fails with

cipherz@cipherz-razer:~/projects/mechanism/devnet-feature$ clarinet integrate --deployment-plan-path=./deployments/initial.deploy.yaml
warn: This command is deprecated. Use 'clarinet devnet start' instead
Computing deployment plan
unexpected error: receiving on a closed channel
terminating devnet network: logs and chainstate available at location /home/cipherz/projects/mechanism/devnet-feature/./.cache/stacks-devnet-1728066203
error: unable to start bitcoind container: network devnet-feature.devnet is ambiguous (2 matches found on name)

I tried

docker network prune

It fails with the same error
What I'd like to be able to do is start the devnet with the specified file and then run

clarinet deployment apply --deployment-plan-path=./deployments/upgrade.deploy.yaml

@hugocaillard
Copy link
Collaborator

Hey @cipherzzz
Looks like deployment plans are not the issue here, it fails right from the beginning.

I'm able to make it work following your steps to reproduce (thanks for this beautifully written issue btw 🙏 ).
Including:

clarinet deployment apply --deployment-plan-path ./deployments/upgrade.deploy.yaml

error: unable to start bitcoind container: network devnet-feature.devnet is ambiguous (2 matches found on name)

That's the real issue. You could have an container or a volume that still use an volume. Or it could be something else.
If you don't want to spend too much time finding what's wrong docker system prune --all will prune all your docker and leave it ready to be used (but that's only if you're ok to loose all of your images, volumes, etc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: 🆕 New
Development

No branches or pull requests

2 participants