loambuild / loam

build, deploy, and maintain ambitious smart contracts. monorepo for Loam SDK, CLI, and shared tools.
https://loam.build
2 stars 7 forks source link

Investigate: contract not rebinding when quickstart container already has contracts deployed #145

Closed elizabethengelman closed 2 months ago

elizabethengelman commented 3 months ago

I have noticed the following scenario, and I think that it's worth looking into:

BlaineHeffron commented 3 months ago

When you notice it doesn't rebind, do you see if it gets to the stellar contract bindings typescript call? Maybe its erroring out before that? Or is it the bindings call thats failing?

elizabethengelman commented 3 months ago

Good question - I'm not seeing errors per se, but here are the repro steps. I'm also wondering if this is an edge case that we shouldn't be too concerned about. 🤷‍♀ī¸

Repro steps:

added 29 packages, and audited 31 packages in 3s

5 packages are looking for funding run npm fund for details

found 0 vulnerabilities

example_core@0.0.0 build tsc

đŸŊī¸ importing "example_core" contract 📲 installing "example_status_message" wasm bytecode on-chain... â†ŗ hash: 195a674c9770ce3bfcd5c7db42910e23779b8d177c5980b08bf97d04fec341b3 🔄 Updating contract "example_status_message" đŸĒž instantiating "example_status_message" smart contract â†ŗ contract_id: CB7KYIO3MU6RDENQHIN4XIXNOLWYQWD5F3SJFCFDFYVAAPLLFBVB6YQW 🎭 binding "example_status_message" contract

added 1 package, and audited 33 packages in 1s

5 packages are looking for funding run npm fund for details

found 0 vulnerabilities

example_status_message@0.0.0 build tsc

đŸŊī¸ importing "example_status_message" contract Watching for changes. Press Ctrl+C to stop.

#### another-new-project
- init another new project: `loam init another-new-project`
- build new project: `cd another-new-project && loam dev --build-clients`
- since the example contracts are both already deployed to the chain, the process finds the contract hashes and does not re-build the ts clients:

🌐 using network at http://localhost:8000/rpc ℹī¸ account "me" already exists, skipping key creation 📲 installing "example_core" wasm bytecode on-chain... â†ŗ hash: f491c824a15c7ee3548a5de2b20c987a4a3e6d73aed5082187e5b1de466091e8 ✅ Contract "example_core" is up to date 📲 installing "example_status_message" wasm bytecode on-chain... â†ŗ hash: 195a674c9770ce3bfcd5c7db42910e23779b8d177c5980b08bf97d04fec341b3 ✅ Contract "example_status_message" is up to date Watching for changes. Press Ctrl+C to stop.

BlaineHeffron commented 3 months ago

Interesting, it looks like its finding the alias even though the working directory is different. It appears its always saving the alias to ~/.soroban even if I pass the workspace_dir to config::locator::Args.config_dir.