SNS local testing environment

We are excited to announce that we have published a solution for locally testing SNS decentralization. Please refer to the instructions for setting up a local testing environment in its repository’s README. We provide a Docker image for x86-compatible platforms (please refer to the special instructions for Apple M1/M2).

If you are an SNS enthusiast, then you can locally go through the entire SNS decentralization process with a testing dapp provided in the repository and get familiar with all the technical details of an SNS lifecycle.

If you then want to decentralize your own dapp via SNS, you’ll be able to test the SNS lifecycle for your dapp before you launch an SNS on mainnet.

Have fun testing and a successful SNS launch afterwards!

14 Likes

Hi,

I am trying to do the pre testflight testing by running the local SNS testing project defined in this post however I fail at the first hurdle:

It just says awaiting local replica, I tried with and without dfx running in the background and I get the same issue.

Any help appreciated.
Thanks,
James

1 Like

Could you please share the content of docker logs $SNS_TESTING_INSTANCE? Most likely, the replica could not start for some reason.

1 Like

I guess I need to install docker with wsl?

Not something I really use.

1 Like

Indeed, the SNS local testing environment is currently based on docker.

2 Likes

So I’m still not getting the expected output:

and when I run the log it’s just blank:

1 Like

It looks like there’s already a replica listening on port 8080 on your system. Could you please make sure to run dfx stop and also kill all docker containers for sns-testing that might be running (you can list them by docker ps)?

1 Like

Ok I stopped dfx, killed all containers:

Same issue and no logs.

1 Like

Now that you stopped dfx and killed all containers, you need to follow the README and actually start a single new container.

2 Likes

Ah yeah I was missing that top line above the statement that is echo’d out…

Thanks

2 Likes

So I was able to get to this point and load the bash shell:

I then went and had my dinner, killing docker as described in part 6.

I’ve come back and I am assuming and I’ve tried to run the local replica again:

but I can’t start the container as before, if you could let me know what I’m not understanding that would be great.

It looks like the docker daemon is not running. I’m not sure why it stopped, but it should start again if you reboot your machine or you could follow these instructions.

So I installed docker desktop, now it seems to run many containers

But when I try to run the starting command:

If I stop all the containers and run the commands it looks like this

Also, whenever I do figure out how to get this up and running it says I will need a deployment script:

Is there somewhere I can prepare this before hand?

Thanks,
James

You can take a look at the deployment script for the test canister here.

Hey,

I was able to do the first bit of the setup

But then it gets stuck running the basic scenario:

I have cargo installed too

What do you mean by “gets stuck”: I suppose it could take quite some time to update the crates.io index (depending on your internet bandwidth and machine). You could also try running the corresponding command cargo build ... from the second-to-last line just above “Updating crates.io index” separately and take it from there.

By “gets stuck” I mean just sits on the first message last line:

But I ran the cargo build command on the second to last line as suggested and I get the following errors:

Thanks,
James

Could you please make sure to run

rustup target add wasm32-unknown-unknown
1 Like

Ok I ran this, it worked this time but it took me 5 minutes for the updating crates.io index to move on so patience required too.

Thanks for your help.

So I now run deploy test canister with this kind of setup:

which would then pickup my generic function execution and validation functions. This is the wasm that has them:

1 Like