Skip to content

Latest commit

 

History

History

hll

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

HLL

Hidden Lake Loader

hll_logo.png

The Hidden Lake Loader is a small service of the Hidden Lake network applications. It is used to redirect traffic from HLT producers (storages) to HLT consumers. Previously, it was used as a component of HLM, and then HLS applications.

Installation

$ go install github.com/number571/hidden-lake/cmd/hll@latest

How it works

HLL uses the HLT service interface to download and upload messages. This property is necessary to redirect multiple messages to HLT once, and then to HLS services.

hll_arch.png

Figure 1. Architecture of HLL.

Supported platforms

  • Windows (x86_64, arm64)
  • Linux (x86_64, arm64)
  • MacOS (x86_64, arm64)

Build and run

Default build and run

$ go run ./cmd/hll

> [INFO] 2023/12/03 02:12:51 HLL is running...
> ...

Open ports 9561 (HTTP). Creates ./hll.yml file.

Default config hll.yml

settings:
  messages_capacity: 2048
logging:
- info
- warn
- erro
address:
  http: 127.0.0.1:9561

Running options

$ hll -path=/root -network=xxx
# path    = path to config and database files
# network = use network configuration from networks.yml

Example

In the example, two HLT services are created, where one is a message producer, the other a consumer. First, messages are entered into the manufacturer, then the HLL (message transportation) function is turned on, and at the end, the delivery of all previously entered messages is checked, but already on the consumer's side.

hll_logger.png

Figure 2. Example of running HLL service.

Build and run HLT services

$ cd examples/traffic_actions/loader
$ make

Run transfer

$ cd examples/traffic_actions/loader/client_hll
$ go run ./main.go

Get valid response

messages have been successfully transported

Config structure

"logging"    Enable loggins in/out actions in the network
"address"    API addresses for HLT functions
"consumers"  A list of the HLT consumers
"producers"  A list of the HLTs producers
settings:
  messages_capacity: 2048
  work_size_bits: 22
  network_key: hlt-network-key
logging:
  - info
  - warn
  - erro
address:
  http: 127.0.0.1:9561
producers:
  - localhost:8582
consumers:
  - localhost:7582

Response structure from HLL API

"result" is string
"return" is int; 1 = success
{
	"result":"hidden-lake-loader",
	"return":1
}

HLL API

1. POST/DELETE /api/network/transfer
2. GET         /api/config/settings

1. /api/network/transfer

1.1. POST Request

curl -i -X POST -H 'Accept: application/json' http://localhost:9561/api/network/transfer

1.1. POST Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Mon, 07 Aug 2023 02:59:42 GMT
Content-Length: 68

success: run transfer

1.2. DELETE Request

curl -i -X DELETE -H 'Accept: application/json' http://localhost:9561/api/network/transfer

1.2. DELETE Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Mon, 07 Aug 2023 02:59:42 GMT
Content-Length: 68

success: stop transfer

2. /api/config/settings

2.1. GET Request

curl -i -X GET -H 'Accept: application/json' http://localhost:9561/api/config/settings

2.1. GET Response

HTTP/1.1 200 OK
Content-Type: application/json
Date: Sat, 23 Dec 2023 17:09:53 GMT
Content-Length: 46
{"messages_capacity":2048,"work_size_bits":22}