SNS local testing environment

What you did above is copying the official files from dfinity/sns-testing into your dapp’s directory. You need to do the copy outside docker from your local checkout of dfinity/sns-testing into your dapp’s directory.

Ok so I’ve been trying to update the file that i’ll move from outside docker to the container dapp folder but I get permission errors:

Likewise if I create a second file and call that from the bash instance

chmod +x deploy_test_canister.sh

should do the job

Yeah I tried that:

But I still can’t save changes to the deploy script:

In that case, it’s likely that you need to change ownership of that file: using ls -l deploy_test_canister.sh you can see the current owner and group and using sudo chown <new-owner>:<new-group> deploy_test_canister.sh you can update the owner and group to match the other files in that directory.

Ok so root was the user:

so I updated it but still can’t change permissions or save the file:

You should update the ownership to your user (it shouldn’t actually be root who owns those files).

So I just started again with a fresh repository and was able to make changes to this file before copying into the dapp folder:

But the SNS_GOVERNANCE_CANISTER_ID isn’t set:

Have I missed a step from GitHub - dfinity/sns-testing: Testing SNS in local testing environment

But the SNS_GOVERNANCE_CANISTER_ID isn’t set:

That’s why the original script contains this:

if [ -f "./sns_canister_ids.json" ]
then
  ./deploy_dapp.sh ...
else
  ./deploy_dapp.sh ...

Do you know why the commands here:

are not the same commands as here:

I was thinking I could just try the local testing involving my actual repo in this guide

Most likely, the dfx version pinned in dfinity/sns-testing is an older dfx version that does not use dfx extensions.

Hi,

So I’m inside my testing branch, inside the docker image bash shell and I try to deploy:

And I get the following error regarding missing build defaults:

Any help appreciated.
Thanks,
James

So even though I get that error the canisters still deploy, so I tried running let nns control dapp

It is trying to update the controller of the live canister instead of the local one.

It seems that docker is missing some dependencies - it should be possible to run dfx deploy for your canisters outside docker just like you’re used to it. The main motivation for using docker is to run the sns-testing scripts, not your own scripts.

I see --network local in the debug output. Are you sure the deployment targets the mainnet?

I don’t want to target the mainnet, I want local…

I have committed the current branch I am working on:

I’ve copied let_nns_control_dapp.sh, constants.sh and settings.sh into the branch.

1 Like