Set up the @platform virtual environment

Create and run your own @platform virtual environment on your machine

4 minute read

Why is there a virtual environment to set up, and what does it do? Jumping directly into the deep end and creating projects on top of the @platform can be overwhelming, so we have made a simple way for you to run the @platform from your machine.

First, why is there a virtual environment to set up, and what does it do?

The virtual environment has two main benefits: you can monitor the status of your test secondary servers (by visiting localhost:9001), and you can bypass the traditional onboarding process completely.

Jumping directly into the deep-end and creating projects on top of the @platform can be overwhelming for some. To combat this overwhelming feeling, we have created a simple way to have you run the @protocol from your very own machine!

This will allow you to run both a root server and secondary servers of testable @signs. We have created demo apps that go over specific verbs and methods to help you get oriented.

Setup Virtual Environment

Windows

Your machine’s BIOS may already have virtualization enabled. You can check here.

Loopback adapter

Install the Microsoft loopback adapter and configure it. Here’s a video showing how:

Start up the at_virtual_environment

Run cmd and enter the following commands. You can run cmd by using the Windows key and the r key then typing cmd.

mkdir ve
cd ve
curl -L atsign.dev/curl/virtualenv-compose-vip.yaml -o docker-compose.yaml

Now you are ready to spin up the docker containers:

docker-compose up -d

Okay, you’re up. Now you can check the http://localhost:9001/.

Not sure what to do now? Try here!

MacOS

Configure Network Adapter

Open the Terminal window and enter this command. This permanently puts the Virtual IP address in place. You only need to run this once!

sudo curl -L atsign.dev/curl/atloop.plist -o /Library/LaunchDaemons/atloop.plist && \

Once you enter the above command, an arrow “>” should show up to enter the next line:

sudo launchctl load /Library/LaunchDaemons/atloop.plist

The command line may ask you to enter your password. Go ahead and fill it in if this happens.

Start up the Virtual Environment

Make a new directory called “ve” and run the curl command inside of it:

mkdir ve
cd ve
curl -L atsign.dev/curl/virtualenv-compose-vip.yaml -o docker-compose.yaml

Now you are ready to spin up the docker containers:

docker-compose up -d

Not sure what to do now? Try here!

Linux

Configure Network Adapter

Open the Terminal window and enter this command. This permanently puts the Virtual IP address in place. You only need to run this once!

curl -L atsign.dev/curl/rc.local -o setvip.sh
sudo ip addr add 10.64.64.64/32 dev lo
sudo nano /etc/rc.local

If the file “/etc/rc.local” is empty, then add the contents of the file “setvip.sh” to /etc/rc.local”. If rc.local already has content, then add the line “ip addr add 10.64.64.64/32 dev lo” above any lines that say “exit 0”. This will ensure that the virtual IP is in place even after a reboot. Ensure the permissions are correct with the following command:

sudo chmod 744 /etc/rc.local

Start up the Virtual Environment

Make a new directory called “ve” and run the curl command inside of it:

cd ~
mkdir ve
cd ve
curl -L atsign.dev/curl/virtualenv-compose-vip.yaml -o docker-compose.yaml

Now you are ready to spin up the docker containers:

docker-compose up -d

Okay, you’re up. Now you can check the http://localhost:9001/.

Not sure what to do now? Try here!

To Pull Latest Virtual Environment Version

docker-compose down
docker-compose pull
docker-compose up -d

Congratulations! You’ve set up your virtual environment and can now experiment with the hello_world app. Now you can start building your very own privacy-conscious apps.

When writing code, the only change needed to run in the virtual environment is changing the ROOT_DOMAIN to point to vip.ve.atsign.zone. The production value is root.atsign.org.

To Authenticate with Demo QR Codes

You will need the PKAM and CRAM Key QR codes in order to properly authenticate your testable atsigns.

You will find the group of these keys on our GitHub here

Where should I go next?

Give your users next steps from the Overview. For example:

  • Sample Apps: See apps that show off the power of the @platform on your own machine!