Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
number571 committed Oct 8, 2023
1 parent d5337a0 commit df2bac8
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 18 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@

*??? ??, ????*

### IMPROVEMENTS

- Update `cmd/hidden_lake/service`: update _daemon/install_hls.sh script, append key generation

### CHANGES

- Update `cmd/hidden_lake/service`: CNetworkMaxConns 64 -> 256
Expand All @@ -15,6 +19,7 @@
### BUG FIXES

- Update `cmd/hidden_lake/service`: append check on size of input private key
- Update `cmd/hidden_lake/service`: update _math directory

## v1.5.19

Expand Down
12 changes: 10 additions & 2 deletions cmd/hidden_lake/service/_daemon/install_hls.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ echo "
Description=HiddenLakeService
[Service]
ExecStart=/root/hls_amd64_linux -path=/root
ExecStart=/root/hls_amd64_linux -path=/root -key=root/priv.key
Restart=always
RestartSec=10
Expand All @@ -18,7 +18,15 @@ cd /root && \
wget https://github.com/number571/go-peer/releases/download/v1.5.19/hls_amd64_linux && \
chmod +x hls_amd64_linux

chmod +x /root/hls_amd64_linux
cd /root && \
rm -f tkeygen_amd64_linux && \
wget https://github.com/number571/go-peer/releases/download/v1.5.19/tkeygen_amd64_linux && \
chmod +x tkeygen_amd64_linux

if [ ! -f /root/priv.key ]; then
cd /root && ./tkeygen_amd64_linux 4096
fi

systemctl daemon-reload
systemctl enable hidden_lake_service.service
systemctl restart hidden_lake_service.service
16 changes: 8 additions & 8 deletions cmd/hidden_lake/service/_math/msg_hashes_size_in_time.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
def get_sizes(b):
return f"\n\t{int(b)}B,\n\t{b/1024}KiB,\n\t{b/1024/1024}MiB,\n\t{b/1024/1024/1024}GiB"

HASH_SIZE = 6 + 64 # _hash_[hex-sha256]
NODE_COUNT = 1 + 10 # yourself + N
PERIOD = 5 # seconds
HASH_SIZE = 64 # hash(sha256) of message + hash(sha256) of public key
NODE_COUNT = 10 # N
PERIOD = 5 # seconds

size_in_second = (HASH_SIZE * NODE_COUNT) / PERIOD
size_in_minute = size_in_second * 60
size_in_hour = size_in_minute * 60
size_in_day = size_in_hour * 24
size_in_week = size_in_day * 7
size_in_month = size_in_week * 4 # 4 weeks != full month
size_in_year = size_in_month * 12
size_in_hour = size_in_minute * 60
size_in_day = size_in_hour * 24
size_in_week = size_in_day * 7
size_in_month = size_in_week * 4 + 2 # 4 weeks != full month
size_in_year = size_in_month * 12

print("Second\t=", get_sizes(size_in_second))
print("Minute\t=", get_sizes(size_in_minute))
Expand Down
17 changes: 9 additions & 8 deletions cmd/hidden_lake/service/_math/queue_traffic_size_in_time.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
def get_sizes(b):
return f"\n\t{int(b)}B,\n\t{b/1024}KiB,\n\t{b/1024/1024}MiB,\n\t{b/1024/1024/1024}GiB"

PACK_SIZE = (1 << 20) # bytes
PERIOD = 5 # seconds
PACK_SIZE = (8 << 10) # 8KiB
NODE_COUNT = 10 # N
PERIOD = 5 # seconds

size_in_second = PACK_SIZE / PERIOD
size_in_second = (PACK_SIZE * NODE_COUNT) / PERIOD
size_in_minute = size_in_second * 60
size_in_hour = size_in_minute * 60
size_in_day = size_in_hour * 24
size_in_week = size_in_day * 7
size_in_month = size_in_week * 4 # 4 weeks != full month
size_in_year = size_in_month * 12
size_in_hour = size_in_minute * 60
size_in_day = size_in_hour * 24
size_in_week = size_in_day * 7
size_in_month = size_in_week * 4 + 2 # 4 weeks != full month
size_in_year = size_in_month * 12

print("Second\t=", get_sizes(size_in_second))
print("Minute\t=", get_sizes(size_in_minute))
Expand Down

0 comments on commit df2bac8

Please sign in to comment.