"dfx canister --network ic call" on another computer

I can request the “greet” function using the command in terminal “dfx canister --network ic call hello greet everyone” if canister was created my friend on another computer?

I have a backend from which I want to make some requests directly in the Canister function

If the canister was created by someone else, you need to ask your friend for the principal (canister id) of the canister and use that in the command line in place of hello.


He writes to me that you need to run in the project directory with a dfx.json file!.

What should be in the dfx.json file so that I can call the method of the canister that is online?

An empty dfx.json file should do. It’s just a dfx requirement at the moment.

echo {} > dfx.json

1 Like

It doesn’t matter if this container was assembled in another country or on another computer?

can i get to the canister like this?

Maybe double check you’re using the correct canister id and your friend’s canister is actually deployed on the IC network, they can find the canister id in a file called canister_ids.json at their project root directory.