Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Oct 7, 2024
1 parent e5f2ce7 commit 4d3b5fd
Show file tree
Hide file tree
Showing 35 changed files with 5,154 additions and 6,000 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Update `cmd/hidden_lake/helpers/traffic`: database now only store hashes, messages stores in memory
- Update `cmd/hidden_lake/helpers/traffic`: rename "storage_enabled" -> "database_enabled"
- Update `cmd/hidden_lake/helpers/traffic`: "messages_capacity" can be = 0
- Update `pkg/storage/cache`: cache/lru/lru.go -> cache/lru.go

<!-- ... -->

Expand Down
2 changes: 1 addition & 1 deletion cmd/hidden_lake/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ On the basis of this characteristic, methods of possible application also begin

1. Due to the property of abstracting from network communications, the anonymous Hidden Lake network can be `integrated` into any other network (including a centralized one) where group communication is possible. In such a case, the HL software implementation provides for the essence of [adapters](https://github.com/number571/go-peer/tree/master/cmd/hidden_lake/adapters) that must be able to adapt to a specific execution environment, hiding and obscuring the generated parasitic traffic,
2. Due to the `theoretically provable anonymity` and independence of nodes among themselves in choosing the period of packet generation, the network can be used in military affairs, ensuring not only the confidentiality of transmitted data, but also the confidentiality of metadata in the face of the activity of actions,
3. The Hidden Lake network can be used as a `communication platform` for applications that are heterogeneous in nature. This is made possible by the go-peer protocol, which does not define any application use. As a result, you can create your own applications at several levels: either at the go-peer library level or at the HL services level ([example](https://github.com/number571/go-peer/tree/master/cmd/secpy_chat)),
3. The Hidden Lake network can be used as a `communication platform` for applications that are heterogeneous in nature. This is made possible by the `GP/12` protocol, which does not define any application use. As a result, you can create your own applications at several levels: either at the go-peer library level or at the HL services level ([example](https://github.com/number571/go-peer/tree/master/cmd/secpy_chat)),
4. Due to problems with scaling at the level of the `QB-problem` itself, the network is difficult to deploy in a global space, which nevertheless does not indicate a local field of action. Hidden Lake can protect `local networks` in a more efficient way due to the existence of small groups of participants that do not vary greatly in number. This may be a relevant solution in the context of the existence of critical areas of a local organization.

## Possible launch modes
Expand Down
5,162 changes: 2,622 additions & 2,540 deletions cmd/hidden_lake/_test/result/coverage.out

Large diffs are not rendered by default.

100 changes: 40 additions & 60 deletions cmd/hidden_lake/_test/result/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
"github.com/number571/go-peer/pkg/logger"
net_message "github.com/number571/go-peer/pkg/network/message"
"github.com/number571/go-peer/pkg/state"
"github.com/number571/go-peer/pkg/storage/cache/lru"
"github.com/number571/go-peer/pkg/storage/cache"
"github.com/number571/go-peer/pkg/types"
)

Expand Down Expand Up @@ -52,7 +52,7 @@ func (p *sApp) Run(pCtx context.Context) error {
adapted.NewAdaptedConsumer(
p.fPostID,
p.fSettings,
lru.NewLRUCache(1<<10),
cache.NewLRUCache(1<<10),
),
p.fStdfLogger,
hlt_client.NewClient(
Expand Down
2 changes: 1 addition & 1 deletion cmd/hidden_lake/helpers/traffic/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<img src="_images/hlt_logo.png" alt="hlt_logo.png"/>

The `Hidden Lake Traffic` is an application that saves traffic passed through HLS. The saved traffic can be used by other applications when they were offline. HLT provides an API for loading and unloading messages. Messages are stored in the database based on the "ring" structure. Thus, new messages will overwrite the old ones after some time. Can act as a TURN server for HLS's or other P2P nodes with go-peer protocol.
The `Hidden Lake Traffic` is an application that saves traffic passed through HLS. The saved traffic can be used by other applications when they were offline. HLT provides an API for loading and unloading messages. Messages are stored in the inmemory database based on the "ring" structure. Thus, new messages will overwrite the old ones after some time. Can act as a TURN server for HLS's or other P2P nodes with GP/12 protocol.

> More information about HLT in the [habr.com/ru/post/717184](https://habr.com/ru/post/717184/ "Habr HLT")
Expand Down
12 changes: 12 additions & 0 deletions cmd/hidden_lake/helpers/traffic/internal/cache/lru_cache.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package cache

import (
"github.com/number571/go-peer/pkg/storage/cache"
)

func NewLRUCache(pCapacity uint64) cache.ILRUCache {
if pCapacity == 0 {
return newVoidLRUCache()
}
return cache.NewLRUCache(pCapacity)
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
package app
package cache

import (
"github.com/number571/go-peer/pkg/storage/cache/lru"
"github.com/number571/go-peer/pkg/storage/cache"
)

var (
_ lru.ILRUCache = &sVoidLRUCache{}
)
var _ cache.ILRUCache = &sVoidLRUCache{}

type sVoidLRUCache struct{}

func newVoidLRUCache() lru.ILRUCache { return &sVoidLRUCache{} }
func newVoidLRUCache() cache.ILRUCache { return &sVoidLRUCache{} }

func (p *sVoidLRUCache) GetIndex() uint64 { return 0 }
func (p *sVoidLRUCache) GetKey(_ uint64) ([]byte, bool) { return nil, false }
Expand Down
Loading

0 comments on commit 4d3b5fd

Please sign in to comment.