Code Monkey home page Code Monkey logo

diode_go_client's Introduction

Diode go client

Build Status CI Go Report Card

This is Go client for connecting device through the diodechain mesh network. You can bridge your local resource to the internet with diodechain mesh network. The whole data will be encrypted with ecdh (secp256k1). You can find more details about how diode and its client works in our previous presentations https://github.com/diodechain/presentations and on https://diode.io

Conceptual diagram

Conceptual diagram for diode

Usage

Command line options

Name
  diode - Diode network command line interface

SYNOPSYS
  diode [-allowlists=] [-api=false] [-apiaddr=localho...]
        [-bind=] [-blocklists=] [-configpath=] [-cpuprofile=]
        [-dbpath=/Users/...] [-debug=false] [-diodeaddrs=] [-fleet=]
        [-keepalive=true] [-keepalivecount=4] [-keepaliveidle=30] [-keepaliveinterval=5]
        [-logfilepath=] [-memprofile=] [-metrics=false] [-retrytimes=3]
        [-retrywait=1] [-rlimit_nofile=0] [-timeout=5] COMMAND <args>

COMMANDS
  bns          Register/Update name service on diode blockchain.
  config       Manage variables in the local config store.
  httpd        Enable a public http server as is used by the "diode.link" website
  publish      Publish ports of the local device to the Diode Network.
  reset        Initialize a new account and a new fleet contract in the network. WARNING deletes current credentials!
  socksd       Enable a socks proxy for use with browsers and other apps.
  time         Lookup the current time from the blockchain consensus.

Run 'diode COMMAND --help' for more information on a command.

Tunnel ssh using your diode socks proxy

On the client:

$ diode socksd
$ ssh pi@<ADDRESS>.diode -o 'ProxyCommand=nc -X 5 -x localhost:1080 %h %p'

On the destination:

$ diode publish -public 22:22

Enable Proxy Server in Browser

  1. Start the socks server
$ diode socksd
  1. Configure Firefox

    1. Open Preferences in menu or type about:preferences in search bar.
    2. Goto Network Settings and click Settings button.
    3. Setup Automatic proxy configuration URL to the porxy.pac, eg: file:///Users/Guest/diode_go_client/proxy.pac
    4. Click reload then you can proxy request from *.diode *diode.ws to the go client.
  2. Type the website URL and see. You can try http://pi-taipei.diode or http://0xc206e1255cbace8ba904daa259d7a5b7f90e2d50.diode and more general:

http://(<MODE>-)<DIODE ADDRESS>.diode<:PORT>

MODES:

  • "r" read-only
  • "w" write-only
  • "rw" read-write (default)
  • "rs" read-only shared
  • "ws" write-only shared
  • "rws" read-write shared

Development

Prerequisite

Setup go environment

Mac

Before install golang, please ensure your device meets the requirements (https://golang.org/doc/install#requirements).

You can download the latest binary distribution https://golang.org/dl/ or install from the source code https://golang.org/doc/install/source. Here we are going to install golang with Homebrew.

Install Homebrew

$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install Go

$ brew install golang

Then you can check go version meets the requirement (>=1.14).

$ go version

Install dependencies

$ go mod download

Run test

$ make test

Build

$ make build

diode_go_client's People

Contributors

dominicletz avatar sc0vu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.