Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

README.md

HLK-CLI

Installation

$ go install github.com/number571/hidden-lake/cmd/hlk/client/hlk-cli@latest

Running options

$ hlk-cli --kernel {{HLK-address}} --do {{function-name}} --arg {{arguments}}
# kernel = address of the HLK internal address (default localhost:9572)
# do     = function to run
# arg    = arguments of the function

You can get more detailed information using the --help option.

Examples

  1. Network
### Send message without response (example from hls-messenger) ###
$ echo '{"method":"POST","host":"hls-messenger","path":"/push","body":"aGVsbG8sIHdvcmxkIQ=="}' | hlk-cli -d send -a {{friend-name}}
### Send message and get response (example from hls-pinger) ###
$ echo '{"method":"GET","host":"hls-pinger","path":"/ping"}' | hlk-cli -d fetch -a {{friend-name}}
  1. Onlines
### Get alive connections ###
$ hlk-cli -d get-onlines
### Delete alive connection ###
$ hlk-cli -d del-online -a tcp://localhost:9999
  1. Connections
### Get all connections ###
$ hlk-cli -d get-connections
### Add connection ###
$ hlk-cli -d add-connection -a tcp://localhost:9999
### Delete connection ###
$ hlk-cli -d del-connection -a tcp://localhost:9999
  1. Friends
### Get all friends ###
$ hlk-cli -d get-friends
### Add friend ###
$ echo "PubKey{...}" | hlk-cli -d add-friend -a {{friend-name}}
### Delete friend ###
$ hlk-cli -d del-friend -a {{friend-name}}