# **Getting Started with Diode** ### How to Do Live Video Streaming with Raspberry Pi using Diode's Peer-to-Peer Network Diode demo video on YouTube: https://youtu.be/Zibg-6CClc4 Script: Written and recorded by Yahsin Huang (https://yahsin.me/about/) Hey everybody! I’m Yahsin, I'm part of the team at Diode. So, we’re going to do a video on Diode. I’m going to teach you how to get your Raspberry Pi connected to Diode’s peer-to-peer network. We will be using a Mac computer here. So, let’s go ahead and let’s take a look at this. You’re going to go to Diode’s Github page. I’ll put all the links in the description. It’s github dot com slash diodechain slash diode_go_client. https://github.com/diodechain/diode_go_client This is going to install the Diode Go client. You need to have the Go programming language installed on your computer. Go to diode dot io slash testnet https://diode.io/testnet/#/. This is our testnet website. Go to Fleet Registration. Go ahead and register your fleet contract. Let's check the Go version very quickly here. So, the version we are using in this video is 1.13. It would be best to use the newer versions of Go. Our engineer Peter is doing all the work for us in this video. So, to run the diode_go_client, use the command: make build. Go ahead and execute the go client program. Copy the fleet contract address. Then, enter dash fleet. -fleet. What it does is it assigns the fleet contract address. Here we got the client address 0x5ce997663a57… and so on.. So, copy this client address and paste it here. What we are trying to do is to add our device to the Whitelist. So, click Whitelist here. Confirm the Metamask transaction. It takes about 15 seconds. It says "true" when it is done. This little spinner here. We have to wait for a little bit, about 40 seconds for our new block to be added to the Diode Chain. What goes behind is the Blockquick algorithm doing its work. So, for now, it takes about 40 seconds for Blockquick to finalize a block. How do we know if the device has been added to the Whitelist? One way to check is to notice whether you have any error messages. If you still see messages like "Device was not whitelisted," it means it has not been properly set up yet. If you stop seeing these kind of error messages, it means you're all set. There it says start socks server "Start socks server 127.0.0.1:1080" (one two seven point zero point zero point one, port ten eighty.) Now that we have the client successfully connected to the Diode network, we can see our fleet contract 0xb86cb…… is now connected to asia dot testnet dot diode dot io... asia.testnet.diode.io:4103. You can type "help" to get a list of all the environment variables. You can choose your own node. Or, if you leave this off, then your default node will be used one out of the 3 full nodes (the U.S., Europe, and Asia) based on your geographic location. Since Peter and I are currently located in Taipei, it will by default choose the full node operating in Asia. Here comes an important step to follow. So, what we want to do is we want to set up our Firefox proxy settings under the about preferences. Type about colon preferences. "about:preferences". Scroll down to the bottom of the page. Go to Network Settings. Go to Settings, configure proxy access to the Internet, Automatic proxy configuration URL. There's a proxy.pac file from our project's GitHub repository; it is used to set up Firefox proxy. It allows you to redirect the matching URLs to a local proxy server. For Peter, his proxy.pac file path is this file:///Users/peterlai/diode_go_client/proxy.pac So let's go ahead and update this information in this field. Then click Reload. Then Ok. Back to our Terminal. So, ssh pi. Now we want to find out the current local IP of our Raspberry Pi. How do we do that? So, one way to do it is we can use the Terminal command ifconfig. This command is used for displaying current network configuration information. So, at the Terminal Prompt, type ifconfig, | pipe, grep 172, and press Enter. Now that we know the local server IP, let's go back to our browser to see what our Raspberry Pi's website looks like. We're trying to get the Pi address. So, search client address. 0x780980bfc0aa56ceb… that's the Pi address. So, now that we've set up everything, we want to use proxy server to connect to the Pi address. Go back to our Firefox browser. Enter rw dash 0x780980… Pi address. Paste the client address here, then dot diode. Let's take a look at the video streaming. So, type 0x78098.....the Pi address, then Port thirty thirty 3030, then Start. That's the view from our office window. Now we can also use "diode.link" here. So, instead of connecting through local server, we can connect through a remote server that's been set up in Europe. So, type https colon double slash rw dash 0 x and so on.....diode dot link... https://rw-0x........diode.link here. Peter is waving his hands. He's trying to show that it's a real live streaming, not some random image. In this video we talked about how to use Diode's Go client do a live video streaming. Go check out our Github repository, try it out, and let us know how it goes! Share this video with your friends, tell people all about it. We look forward to seeing issues and pull requests. Another thing that's very exciting for us - we will be doing a workshop for the first time! This year at EthCC Paris, one of the biggest Ethereum conferences in Europe, CTO Dominic Letz will be doing a hands-on workshop on how to bring our machines and Raspberry Pis online as well as explore how their communications would look like in the world of Web 3.0. Come say hi to us if you're around!