Skip to content

Commit

Permalink
clean up docker compose, genesis, localnet
Browse files Browse the repository at this point in the history
  • Loading branch information
0xBigBoss committed May 7, 2023
1 parent 39635fa commit 54771d3
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 27 deletions.
3 changes: 3 additions & 0 deletions build/config/config.node1.validator.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,8 @@
"port": "50832",
"timeout": 30000,
"use_cors": false
},
"servicer": {
"enabled": true
}
}
15 changes: 13 additions & 2 deletions build/config/genesis.json
Original file line number Diff line number Diff line change
Expand Up @@ -4094,11 +4094,22 @@
}
],
"servicers": [
{
"address": "00104055c00bed7c983a48aac7dc6335d7c607a7",
"public_key": "dfe357de55649e6d2ce889acf15eb77e94ab3c5756fe46d3c7538d37f27f115e",
"chains": ["0001"],
"service_url": "node1.consensus:42069",
"staked_amount": "1000000000000",
"paused_height": -1,
"unstaking_height": -1,
"output": "00104055c00bed7c983a48aac7dc6335d7c607a7",
"actor_type": 2
},
{
"address": "00604d18001a2012830b93efcc23100450e5a512",
"public_key": "6ac62bddc541432cff818a02bab732f815ef2e6f7099e7dddc793d62d482b451",
"chains": ["0001"],
"service_url": "node1.servicer:42069",
"service_url": "node5.servicer:42069",
"staked_amount": "1000000000000",
"paused_height": -1,
"unstaking_height": -1,
Expand All @@ -4111,7 +4122,7 @@
"address": "00504987d4b181c1e97b1da9af42f3db733b1ff4",
"public_key": "2777a49cdfde21867a538ddcfca05002f0115b1955a75b80e965ed63fc95f809",
"chains": ["0001"],
"service_url": "node1.fisherman:42069",
"service_url": "node6.fisherman:42069",
"staked_amount": "1000000000000",
"paused_height": -1,
"unstaking_height": -1,
Expand Down
14 changes: 6 additions & 8 deletions build/deployments/.env.example
Original file line number Diff line number Diff line change
@@ -1,31 +1,29 @@
# docker compose stuff
# override with your own values if the default host port mappings in docker-compose do not suit you
# NODE1_DEBUG_PORT=127.0.0.1:7081
# NODE1_PORT_9081=127.0.0.1:9081
# NODE1_P2P_PORT=127.0.0.1:42070
# NODE1_RPC_PORT=127.0.0.1:50832

# NODE2_DEBUG_PORT=127.0.0.1:7082
# NODE2_PORT_9081=127.0.0.1:9082
# NODE2_P2P_PORT=127.0.0.1:42071
# NODE2_RPC_PORT=127.0.0.1:50833

# NODE3_DEBUG_PORT=127.0.0.1:7083
# NODE3_PORT_9081=127.0.0.1:9083
# NODE3_P2P_PORT=127.0.0.1:42072
# NODE3_RPC_PORT=127.0.0.1:50834

# NODE4_DEBUG_PORT=127.0.0.1:7084
# NODE4_PORT_9081=127.0.0.1:9084
# NODE4_P2P_PORT=127.0.0.1:42073
# NODE4_RPC_PORT=127.0.0.1:50835

# NODE5_DEBUG_PORT:-0.0.0.0:7085
# NODE5_PORT_9081:-0.0.0.0:9085
# NODE5_P2P_PORT:-0.0.0.0:42074
# NODE5_RPC_PORT:-0.0.0.0:50836
# NODE5_SERVICER_ENABLED=true

# NODE6_DEBUG_PORT:-0.0.0.0:7085
# NODE6_PORT_9081:-0.0.0.0:9085
# NODE6_P2P_PORT:-0.0.0.0:42074
# NODE6_RPC_PORT:-0.0.0.0:50836
# NODE6_FISHERMAN_ENABLED=true

# GRAFANA_PORT_3000=127.0.0.1:3000
# POSTGRES_PORT_5432=127.0.0.1:5432
# LOKI_PORT_3100=127.0.0.1:3100
Expand Down
20 changes: 4 additions & 16 deletions build/deployments/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,12 @@ services:
context: ../..
dockerfile: ./build/Dockerfile.localdev
expose:
- "7080" # dlv debug
- "9080"
- "7081" # dlv debug
- "9000"
- "42069"
- "50832"
ports:
- "${NODE1_DEBUG_PORT:-0.0.0.0:7081}:7081"
- "${NODE1_PORT_9081:-0.0.0.0:9081}:9080"
- "${NODE1_P2P_PORT:-0.0.0.0:42070}:42069"
- "${NODE1_RPC_PORT:-0.0.0.0:50832}:50832"
volumes:
Expand All @@ -70,12 +68,10 @@ services:
expose:
- "7082" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE2_DEBUG_PORT:-0.0.0.0:7082}:7081"
- "${NODE2_PORT_9081:-0.0.0.0:9082}:9080"
- "${NODE2_DEBUG_PORT:-0.0.0.0:7082}:7082"
- "${NODE2_P2P_PORT:-0.0.0.0:42071}:42069"
- "${NODE2_RPC_PORT:-0.0.0.0:50833}:50832"
volumes:
Expand All @@ -98,12 +94,10 @@ services:
expose:
- "7083" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE3_DEBUG_PORT:-0.0.0.0:7083}:7081"
- "${NODE3_PORT_9081:-0.0.0.0:9083}:9080"
- "${NODE3_DEBUG_PORT:-0.0.0.0:7083}:7083"
- "${NODE3_P2P_PORT:-0.0.0.0:42072}:42069"
- "${NODE3_RPC_PORT:-0.0.0.0:50834}:50832"
volumes:
Expand All @@ -126,12 +120,10 @@ services:
expose:
- "7084" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE4_DEBUG_PORT:-0.0.0.0:7084}:7081"
- "${NODE4_PORT_9081:-0.0.0.0:9084}:9080"
- "${NODE4_DEBUG_PORT:-0.0.0.0:7084}:7084"
- "${NODE4_P2P_PORT:-0.0.0.0:42073}:42069"
- "${NODE4_RPC_PORT:-0.0.0.0:50835}:50832"
volumes:
Expand Down Expand Up @@ -163,12 +155,10 @@ services:
expose:
- "7085" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE5_DEBUG_PORT:-0.0.0.0:7085}:7085"
- "${NODE5_PORT_9081:-0.0.0.0:9085}:9080"
- "${NODE5_P2P_PORT:-0.0.0.0:42074}:42069"
- "${NODE5_RPC_PORT:-0.0.0.0:50836}:50832"
volumes:
Expand Down Expand Up @@ -201,12 +191,10 @@ services:
expose:
- "7086" # dlv debug
- "42069"
- "9080"
- "9000"
- "50832"
ports:
- "${NODE6_DEBUG_PORT:-0.0.0.0:7086}:7086"
- "${NODE6_PORT_9081:-0.0.0.0:9086}:9080"
- "${NODE6_P2P_PORT:-0.0.0.0:42075}:42069"
- "${NODE6_RPC_PORT:-0.0.0.0:50837}:50832"
volumes:
Expand Down
6 changes: 5 additions & 1 deletion build/localnet/cluster-manager/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ func isValidator(service *v1.Service) bool {
//
// it follows the pattern defined in the pocket helm chart.
func extractValidatorId(validatorName string) string {
return validatorServiceNamePatternRegex.FindStringSubmatch(validatorName)[1]
match := validatorServiceNamePatternRegex.FindStringSubmatch(validatorName)
if len(match) != 2 {
logger.Fatal().Msgf("Could not extract validator id from service name: %s", validatorName)
}
return match[1]
}

// TODO: Create a type for `validatorKeyMap` and document what the expected key-value types contain
Expand Down
1 change: 1 addition & 0 deletions shared/k8s/debug.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func FetchValidatorPrivateKeys(clientset *kubernetes.Clientset) (map[string]stri
func getNamespace() (string, error) {
_, err := os.Stat(kubernetesServiceAccountNamespaceFile)
if err != nil {
logger.Global.Err(err).Msg("could not stat namespace file, using \"" + defaultNamespace + "\"")
return defaultNamespace, nil
}

Expand Down

0 comments on commit 54771d3

Please sign in to comment.