Assets canisters in local network

How to use the assets files, like images in deveploment network

1 Like

you need to define the “assets” canister in dfx.json file. For example :

“icevent_assets”: {
“dependencies”: [
“frontend”: {
“entrypoint”: “src/icevent_assets/src/index.html”
“source”: [
“type”: “assets”

in the source folder, you can put any assets as normal webapps

1 Like

Thanks for answer, but i don’t know was how to use the images in assets canister.
In IC network, set the img src to " https://<CANISTER_ID>",
What i should do in Local network

1 Like

You need to install icx-proxy from the agent-rs repo.

Then, run something like this:

icx-proxy --address --replica http://localhost:$(cat ~/<your home dir>/.dfx/replica-configuration/replica-1.port) --dns-alias -v -v

Make sure you run dfx replica as well.

Then, replace the IP address, canister ID, and with your own, and call<asset name>.


Thanks, i will give it a try