Skip to content

Commit

Permalink
fix health status of tessera for quorum to start up properly and add …
Browse files Browse the repository at this point in the history
…debug launch config

Signed-off-by: Enrique Lacal <enrique.lacal@kaleido.io>
  • Loading branch information
EnriqueL8 committed Jul 16, 2024
1 parent 9bfa7b5 commit 2c629e9
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@


.DS_Store
.vscode
ff/ff
dist/
*.iml
Expand Down
29 changes: 29 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
{
"version": "0.2.0",
"configurations": [
{
"name": "Debug init mode",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "ff/main.go",
"args": ["init", "ethereum", "dev", "2"]
},
{
"name": "Debug remove mode",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "ff/main.go",
"args": ["remove", "dev", "--force"]
},
{
"name": "Debug start mode",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "ff/main.go",
"args": ["start", "dev"]
},
]
}
12 changes: 11 additions & 1 deletion internal/blockchain/ethereum/quorum/quorum_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ func (p *QuorumProvider) GetDockerServiceDefinitions() []*docker.ServiceDefiniti
for i := 0; i < memberCount; i++ {
var quorumDependsOn map[string]map[string]string
if !p.stack.PrivateTransactionManager.Equals(types.PrivateTransactionManagerNone) {
quorumDependsOn = map[string]map[string]string{fmt.Sprintf("tessera_%d", i): {"condition": "service_started"}}
quorumDependsOn = map[string]map[string]string{fmt.Sprintf("tessera_%d", i): {"condition": "service_healthy"}}
serviceDefinitions[i+memberCount] = &docker.ServiceDefinition{
ServiceName: fmt.Sprintf("tessera_%d", i),
Service: &docker.Service{
Expand All @@ -259,6 +259,16 @@ func (p *QuorumProvider) GetDockerServiceDefinitions() []*docker.ServiceDefiniti
Environment: p.stack.EnvironmentVars,
EntryPoint: []string{"/bin/sh", "-c", "/data/docker-entrypoint.sh"},
Deploy: map[string]interface{}{"restart_policy": map[string]interface{}{"condition": "on-failure", "max_attempts": int64(3)}},
HealthCheck: &docker.HealthCheck{
Test: []string{
"CMD",
"curl",
"--fail",
fmt.Sprintf("http://localhost:%s/upcheck", TmTpPort),
},
Interval: "15s", // 6000 requests in a day
Retries: 30,
},
},
VolumeNames: []string{fmt.Sprintf("tessera_%d", i)},
}
Expand Down

0 comments on commit 2c629e9

Please sign in to comment.