flow-cli
flow-cli copied to clipboard
Running query against archive node does not replace addresses correctly
Instructions
I am trying to run a script against an archive node but it fails because the address is not replaced in properly. It is using the emulator version of the dependency not the mainnet one
Problem
❌ Command Error: failed to submit executable script: client: rpc error: code = Unknown desc = could not execute script: script execution encountered error: [Error Code: 1101] error caused by: [Error Code: 1101] cadence runtime error: Execution failed:
error: get program failed: cannot check account freeze status: [Error Code: 1201] account not found for address 179b6b1cb6755e31
--> 179b6b1cb6755e31.FIND
error: cannot find variable in this scope: `FIND`
--> 800713a70e2e84b89a4ef71470528f1a77dea2b7301f806e0bc4863c903d27e3:5:8
|
5 | return FIND.resolve(name)
| ^^^^ not found in this scope```
### Steps to Reproduce
run a script that has a import without address against a host without specifying the network flag.
You cannot specify both network flag and host flag.
### Acceptance Criteria
It is possible to specify network flag to resolve but host will override host.
Running with latest flow cli
@bjartek that's interesting case. What if you define that network host in the flow.json? Or it doesn't make sense since you are using the archive only for scripts?
well you dont want to have to specify the alias for this network in all places since they are the same as mainnet in this case. I just dont want it to become that verbose. @vishalchangrani mentioned that there was some changes planned for archive nodes so maybe that will make it easier to configure this.
Basically we have x hosts for a network based on the spork really dont we? if we want a unified format for specifing how to get things for old sporks.
@bjartek yes, good points. Just want to learn more about the issue that's all.
I think it would be very nice if we can move this into flow.json personally. Or have a way to derive the url to an access node from the height and network or something. Having to know the url to the spork specific archive node when asking for data is not ideal at all.
I guess it is different if you want to ask to run a script at a given block id, but for me that is not that usefull.
Archive nodes will "soon" be able to contain al the sporks so it will no longer be required to provide different ones for sporks. But I understand what is the current issue. Actually I believe there are two, one is related to being able to resolve imports, which is not possible unless you change flow.json network host everytime, so have the ability to choose the network but still provide host, the other is have multiple per-spork hosts.