How to deploy Ledger/Cycle canister with initialization parameters


dfx --version
dfx 0.7.0

sudo dfx start --clean


sudo dfx canister --no-wallet install 3ledger --argument "record {minting_account=\"f7964dd75c4705c00043641367f9a2b66465cba94bd9057033f8dd711449f552\"; initial_values=vec {record{\"432cfd7d1776c9b5c603590b9ab778abfb4456556d9aecc1fc20aaee0df039b5\";record{e8s=100000000000000:nat64;}}}; max_message_size_bytes=null;transaction_window=opt record {secs=300:nat64;nanos=0:nat32};archive_options=null;send_whitelist=vec{record {principal \"rkp4c-7iaaa-aaaaa-aaaca-cai\"}};}"

Creating UI canister on the local network.
The UI canister on the "local" network is "qjdve-lqaaa-aaaaa-aaaeq-cai"
Installing code for canister 3ledger, with canister_id ryjl3-tyaaa-aaaaa-aaaba-cai
The Replica returned an error: code 5, message: "Canister ryjl3-tyaaa-aaaaa-aaaba-cai trapped explicitly: Panicked at 'Deserialization Failed: "Deserialize error: bytes only takes principal or vec nat8"', /home/peter/ic/rs/rust_canisters/dfn_core/src/"

The problem lies in setting the principal parameter of the whitelist: send_whitelist=vec{record {principal \"rkp4c-7iaaa-aaaaa-aaaca-cai\"}}. If setting send_whitelist=vec{}, everything is ok, but cycle-minting canister can’t test top up cycles, for its canister id is not in whitelist.

If there is more documentation about Ledger, I am also looking forward to it