Skip to content

Commit

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

- Update `cmd/hidden_lake/service`: CNetworkMaxConns 64 -> 256
- Update `examples/echo_service/prod_test`: append switch prod_1/prod_2 in Makefile with PROD param
- Update `cmd/hidden_lake`: delete jino, timeweb.cloud providers

### BUG FIXES

Expand Down
3 changes: 2 additions & 1 deletion examples/echo_service/prod_test/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
CMDPATH=../../../cmd
BINPATH=../../../bin

PROD=1
NUM_NODES=$(shell ls ./other_nodes | wc -l)

.PHONY: default init build run clean
Expand All @@ -10,7 +11,7 @@ init:
pkill -15 --version

generate-configs:
go run ./gen_cfgs
go run ./gen_cfgs prod_$(PROD)

build: generate-configs
# MAKEFILE BUILD
Expand Down
48 changes: 31 additions & 17 deletions examples/echo_service/prod_test/gen_cfgs/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,6 @@ import (
const (
cMessageSizeBytes = (8 << 10)
cLenOtherNodes = 10
cNetworkKey = "8Jkl93Mdk93md1bz"
// cNetworkKey = "oi4r9NW9Le7fKF9d"
)

var (
gListOfConnects = []string{
// 8Jkl93Mdk93md1bz
"94.103.91.81:9581", // 1x4.0GHz, 1.0GB RAM, 30GB HDD
"195.133.1.126:9581", // 1x2.2GHz, 0.5GB RAM, 10GB HDD

// // oi4r9NW9Le7fKF9d
// "193.233.18.245:9581", // 1x2.5GHz, 1.0GB RAM, 5GB VNMe
// "62.233.46.109:9581", // 1x2.8GHz, 1.0GB RAM, 16GB SSD
}
)

type sNodeHLS struct {
Expand All @@ -31,7 +17,35 @@ type sNodeHLS struct {
fMakefile string
}

var (
gNetworkKey string
gListOfConnects []string
)

func initRun() error {
if len(os.Args) != 2 {
return fmt.Errorf("len args != 2")
}

switch os.Args[1] {
case "prod_1":
gNetworkKey = cNetworkKey_1
gListOfConnects = gListOfConnects_1
case "prod_2":
gNetworkKey = cNetworkKey_2
gListOfConnects = gListOfConnects_2
default:
return fmt.Errorf("unknown param")
}

return nil
}

func main() {
if err := initRun(); err != nil {
panic(err)
}

connects := make([]string, 0, len(gListOfConnects))
for _, arg := range gListOfConnects {
connects = append(connects, fmt.Sprintf(`"%s"`, arg))
Expand Down Expand Up @@ -83,7 +97,7 @@ func initRecvNode(pConnects string) *sNodeHLS {
}
`,
cMessageSizeBytes,
cNetworkKey,
gNetworkKey,
pConnects,
),
}
Expand Down Expand Up @@ -113,7 +127,7 @@ func initSendNode(pConnects string) *sNodeHLS {
}
`,
cMessageSizeBytes,
cNetworkKey,
gNetworkKey,
pConnects,
),
}
Expand Down Expand Up @@ -147,7 +161,7 @@ clean:
}
`,
cMessageSizeBytes,
cNetworkKey,
gNetworkKey,
pConnects,
),
}
Expand Down
12 changes: 12 additions & 0 deletions examples/echo_service/prod_test/gen_cfgs/prod_1.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

const (
cNetworkKey_1 = "8Jkl93Mdk93md1bz"
)

var (
gListOfConnects_1 = []string{
"94.103.91.81:9581", // 1x4.0GHz, 1.0GB RAM, 30GB HDD
"195.133.1.126:9581", // 1x2.2GHz, 0.5GB RAM, 10GB HDD
}
)
12 changes: 12 additions & 0 deletions examples/echo_service/prod_test/gen_cfgs/prod_2.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package main

const (
cNetworkKey_2 = "oi4r9NW9Le7fKF9d"
)

var (
gListOfConnects_2 = []string{
"193.233.18.245:9581", // 1x2.5GHz, 1.0GB RAM, 5GB VNMe
"62.233.46.109:9581", // 1x2.8GHz, 1.0GB RAM, 16GB SSD
}
)

0 comments on commit c93f213

Please sign in to comment.