From ca104e74dc687e4224324dbfa813e66ee46a7dc2 Mon Sep 17 00:00:00 2001 From: Joseph Henry Date: Fri, 9 Dec 2016 09:45:57 -0800 Subject: [PATCH] updated walkthrough doc --- docs/walkthrough.md | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/docs/walkthrough.md b/docs/walkthrough.md index 1625a13..b9fbfa9 100644 --- a/docs/walkthrough.md +++ b/docs/walkthrough.md @@ -1,38 +1,54 @@ Walkthrough ====== -In this document we'll run through a simple example which should demonstrate the concept of the ZeroTierSDK. For this tutorial you'll need two devices (or at least the ability to run a VM or something like Docker). +In this document we'll run through a simple example which should demonstrate the concept of the ZeroTier SDK. For this tutorial you'll need two devices (or at least the ability to run a VM or something like [Docker](https://www.docker.com/)). We will demonstrate a simple TCP server application intercepted on linux. This is only one of *many* ways the SDK can be used, but it'll at least convey the core concept how how the intercept works. -### Create your virtual network - - Download ZeroTier at (zerotier.com)[https://www.zerotier.com/] +### On your first device: + - Download ZeroTier at [zerotier.com](https://www.zerotier.com/product-one.shtml) - Install it on a device/computer - - Create an account and new virtual network at (my.zerotier.com)[https://my.zerotier.com/] + - Create an account and new virtual network at [my.zerotier.com](https://my.zerotier.com/) - Join your device to the network and assign it an address `zerotier-cli join ` - Use `zerotier-cli listnetworks` to verify that you've joined the network. +*** -### On your second device, Build the SDK - - On Linux: `make linux SDK_PICOTCP=1 SDK_IPV4=1 SDK_DEBUG=1; make -s check; ls -lG build` -### Build test apps + +### On your second device: + +#### Build the SDK +``` +make linux SDK_PICOTCP=1 SDK_IPV4=1 SDK_DEBUG=1; make -s check; ls -lG build +``` + +#### Build test apps ``` make tests ``` -### Start the SDK service +#### Start the SDK service in the background ``` -./zerotier-cli -U -p8000 /network/homepath & +./zerotier-cli -U -p8000 /netpath & ``` -### Set environment variables +#### Set environment variables ``` -export ZT_NC_NETWORK=/network/homepath/nc_XXXXXXXXXXXXXXXX +export ZT_NC_NETWORK=/netpath/nc_XXXXXXXXXXXXXXXX export LD_PRELOAD=./libztintercept.so ``` -### Start your app +Where `netpath` can be any path you'd like the client's keys and configuration to be stored and `XXXXXXXXXXXXXXXX` is the 16-digit network ID. + +#### Start your app ``` ./build/tests/linux.tcpserver4.out 8001 ``` -*Now, you'll note that your new TCP server is automatically intercepted and available at on port 80001* +Now, on your first device, `./build/tests/linux.tcpclient4.out 8001` + +Now, you'll note that your new TCP server is automatically intercepted and available at on port 8001. +*** + + +You've just uplifted your app onto your private ZeroTier network. +