Calling Main net from local development environment (via agents?)

My biggest frustration moving from developing apps on NodeJS to the Internet Computer (Rust) is not being able to call ‘live’ canisters/ api from a development environment. This makes it a lot more challenging to write scripts/ programs which interact with 3rd party canisters (especially if they aren’t open sourced).

I’m finding myself deploying test canisters to create ‘dummy’ versions of main net canisters and then having to add some state to these to replicate something which already exists. It’s a waste of time IMHO.

I know root keys etc will pose an issue in connecting local development to main net… but could canister calls be marked as main-net and then sent through an agent behind the scenes?

Just some Sunday ramblings… would be interested in what the mega-brains think!

1 Like

I like the idea, but I can already see dozens of really hard to solve problems in corner cases. What may help you is a feature we’re currently developing called dfx deps where you can simply point at a canister ID on mainnet and if you type one command (don’t quite remember what) you’ll get that canister installed locally without any extra work. The first canisters should be ready to be pulled pretty soon!

2 Likes

Thats sounds really cool! I take it that is just pulls the wasm and not the state?

Yes, unless the dev wants to supply some (in this case probably hard-coded) initial state

1 Like

That would help in a lot of cases. Just a bit of manual work to pull data from the live canister, store it locally and then input into the dev canister.

Of course I can still dream about calls to main net. Maybe one day :face_holding_back_tears: