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 for diode
Name
diode - Diode network command line interface
SYNOPSYS
diode [-allowlists=] [-api=false] [-apiaddr=localho...]
[-bind=] [-blocklists=] [-blockprofile=] [-blockprofilerate=1]
[-resolvecachetime=10m0s] [-configpath=] [-cpuprofile=] [-dbpath=/home/t...]
[-debug=false] [-diodeaddrs=] [-e2etimeout=15s] [-fleet=]
[-logdatetime=false] [-logfilepath=] [-memprofile=] [-metrics=false]
[-mutexprofile=] [-mutexprofilerate=1] [-pprofport=0] [-retrytimes=3]
[-retrywait=1s] [-rlimit_nofile=0] [-timeout=5s] [-update=true] COMMAND <args>
COMMANDS
bns Register/Update name service on diode blockchain.
config Manage variables in the local config store.
gateway Enable a public gateway 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.
token Transfer DIODEs to the given address on diode blockchain.
update Force updating the diode client version.
version Print the diode client version.
Run 'diode COMMAND --help' for more information on a command.
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
Publish a Local Webserver Article link
Diode is the Swiss army knife of Web3 capabilities! One of the neat things it allows you to do is to publish a local website / webserver to the Internet where anyone can view it. A common reason for doing this is to allow others to see a website that is under development - the development is done locally and can be viewed by collaborators remotely without setting up a staging server and without any IT tools / configuration.
Develop LINE chatbots Article link
Diode is the best tool in connecting LINE’s webhook - it allows you to connect LINE’s message API through Diode’s peer-to-peer network and establish your LINE’s webhook within minutes of time. We're giving everyone a better, more secure, fully decentralized option when developing LINE chatbots.
- Start the socks server
$ diode socksd
-
Configure Firefox
- Open Preferences in menu or type
about:preferences
in search bar. - Goto Network Settings and click
Settings
button. - Setup
Automatic proxy configuration URL
to the porxy.pac, eg:file:///Users/Guest/diode_client/proxy.pac
- Click
reload
then you can proxy request from*.diode
*diode.ws
to the go client.
- Open Preferences in menu or type
-
Type the website URL and see. You can try
http://betahaus-berlin.diode
orhttp://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
- go <= 1.22
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.
$ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew install golang
Then you can check go version meets the requirement (>=1.14).
$ go version
$ go mod download
$ make test
$ make
To enable pprof on port 6060 run with diode -pprofport 6060