Dfx sns testflight to mainnet error

When I try to deploy the SNS testflight on mainnet, I keep on getting an error that --network ic is not a valid argument. I’m following the guide here and am running this command

dfx sns deploy-testflight --init-config-file="sns/sns_init.yaml" --network ic 

This returns the error

error: unexpected argument 'ic' found

Usage: dfx sns deploy-testflight [OPTIONS] [init-config-file] [network]

For more information, try '--help'.

I tried placing --network ic at other places but same error.

I’m running with the defined versions in the guide (0.16.1) but also tried with 0.19.0 (0.20.0 doesn’t support sns extension yet as it seems).

Am I missing something here?

Well ok, I had to set --network=ic (including the =) and that makes it work. Can be adjusted in the guide.

I ran into a follow-up error at the step which installs the sns_index canister

Error: Failed to install wasm module to canister 'sns_index'.
Caused by: Failed to install wasm module to canister 'sns_index'.
  Failed to read ./ic-icrc1-index-ng.wasm: No such file or directory (os error 2)

I could resolve this by changing the name of the ic-icrc1-index.wasm file to ic-icrc1-index-ng.wasm. However, those are the default files which are downloaded in the step beforehand. Fixing this, let’s me run the testflight deployment until the deployment of the sns_index canister again. I then receive this error

Installing code for canister sns_governance, with canister ID jtpnb-waaaa-aaaal-ajc6q-cai
Installing code for canister sns_ledger, with canister ID j5naj-nqaaa-aaaal-ajc7q-cai
Installing code for canister sns_root, with canister ID cd3sx-wyaaa-aaaal-ajdaa-cai
Installing code for canister sns_swap, with canister ID ce2ud-3aaaa-aaaal-ajdaq-cai
dfx failed when called with args: ["canister", "--network", "ic", "install", "--argument-type=raw", "--argument", "4449444c056e016b02fcb88b840302b0ced18403046c01f1f7fcf706036e686c01f1f7fcf7066801000101010a00000000016048bf0101", "--wasm", "./ic-icrc1-index-ng.wasm", "sns_index"], error: Installing code for canister sns_index, with canister ID j2mg5-aiaaa-aaaal-ajc7a-cai
Error: Failed to install wasm module to canister 'sns_index'.
Caused by: Failed to install wasm module to canister 'sns_index'.
  Failed during wasm installation call: The replica returned a rejection error: reject code CanisterError, reject message Error from Canister j2mg5-aiaaa-aaaal-ajc7a-cai: Canister trapped explicitly: failed to decode call arguments: Custom(Fail to decode argument 0 from table0 to record { ledger_id : principal } 

Something seems to be wrong with the install arguments.

Running the deployment of the sns_index canister manually by running the command directly with my staging sns_ledger canister, works.

dfx canister install sns_index --argument '(record {ledger_id = principal "j5naj-nqaaa-aaaal-ajc7q-cai"})' --ic --wasm ./ic-icrc1-index-ng.wasm

So this is where I am now. Because I had to finish the last step manually, I’m not sure if there is something that is supposed to happen in the dfx sns deploy-testflight that would finalise the launch. The testing SNS seems to work just fine, judging from the first test proposals.