From 26f8948cad0ce5c04ba788fb6705ec8830ca2ba8 Mon Sep 17 00:00:00 2001 From: Dzianis Andreyenka Date: Mon, 5 Aug 2024 19:38:32 +0200 Subject: [PATCH 1/2] DA-608 Update tezosconnect volumes Signed-off-by: Dzianis Andreyenka --- .../blockchain/tezos/connector/tezosconnect/config.go | 2 +- .../blockchain/tezos/connector/tezosconnect/docker.go | 10 +++++----- .../tezos/connector/tezosconnect/docker_test.go | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal/blockchain/tezos/connector/tezosconnect/config.go b/internal/blockchain/tezos/connector/tezosconnect/config.go index 72879dc7..e7008726 100644 --- a/internal/blockchain/tezos/connector/tezosconnect/config.go +++ b/internal/blockchain/tezos/connector/tezosconnect/config.go @@ -133,7 +133,7 @@ func (t *Tezosconnect) GenerateConfig(stack *types.Stack, org *types.Organizatio }, Persistence: &PersistenceConfig{ LevelDB: &LevelDBConfig{ - Path: "/tezosconnect/leveldb", + Path: "/tezosconnect/db/leveldb", }, }, FFCore: &FFCoreConfig{ diff --git a/internal/blockchain/tezos/connector/tezosconnect/docker.go b/internal/blockchain/tezos/connector/tezosconnect/docker.go index 7fa902fa..65c6ce23 100644 --- a/internal/blockchain/tezos/connector/tezosconnect/docker.go +++ b/internal/blockchain/tezos/connector/tezosconnect/docker.go @@ -30,24 +30,24 @@ func (t *Tezosconnect) GetServiceDefinitions(s *types.Stack, dependentServices m } serviceDefinitions := make([]*docker.ServiceDefinition, len(s.Members)) for i, member := range s.Members { + dataVolumeName := fmt.Sprintf("tezosconnect_data_%s", member.ID) serviceDefinitions[i] = &docker.ServiceDefinition{ ServiceName: "tezosconnect_" + member.ID, Service: &docker.Service{ Image: s.VersionManifest.Tezosconnect.GetDockerImageString(), ContainerName: fmt.Sprintf("%s_tezosconnect_%v", s.Name, i), - Command: "-f /tezosconnect/config/config.yaml", + Command: "-f /tezosconnect/config.yaml", DependsOn: dependsOn, Ports: []string{fmt.Sprintf("%d:%v", member.ExposedConnectorPort, t.Port())}, Volumes: []string{ - fmt.Sprintf("tezosconnect_config_%s:/tezosconnect/config", member.ID), - fmt.Sprintf("tezosconnect_leveldb_%s:/tezosconnect/leveldb", member.ID), + fmt.Sprintf("%s/config/tezosconnect_%s.yaml:/tezosconnect/config.yaml", s.RuntimeDir, member.ID), + fmt.Sprintf("%s:/tezosconnect/db", dataVolumeName), }, Logging: docker.StandardLogOptions, Environment: s.EnvironmentVars, }, VolumeNames: []string{ - fmt.Sprintf("tezosconnect_config_%s", member.ID), - fmt.Sprintf("tezosconnect_leveldb_%s", member.ID), + dataVolumeName, }, } } diff --git a/internal/blockchain/tezos/connector/tezosconnect/docker_test.go b/internal/blockchain/tezos/connector/tezosconnect/docker_test.go index 848c4a86..c7e3cc96 100644 --- a/internal/blockchain/tezos/connector/tezosconnect/docker_test.go +++ b/internal/blockchain/tezos/connector/tezosconnect/docker_test.go @@ -83,7 +83,7 @@ func TestGetServiceDefinition(t *testing.T) { serviceDefinitions := tezos.GetServiceDefinitions(tc.Members, tc.DependentServices) assert.NotNil(t, serviceDefinitions) - expectedCommand := "-f /tezosconnect/config/config.yaml" + expectedCommand := "-f /tezosconnect/config.yaml" if serviceDefinitions[0].Service.Command != expectedCommand { t.Errorf("Expected Command %q, got %q", expectedCommand, serviceDefinitions[0].Service.Command) } From 9268f679ab42c5a2a8be7dd078b8c03ba778fab2 Mon Sep 17 00:00:00 2001 From: Dzianis Andreyenka Date: Sat, 10 Aug 2024 10:28:45 +0200 Subject: [PATCH 2/2] Add an instant receipt check as a default option Signed-off-by: Dzianis Andreyenka --- internal/blockchain/tezos/connector/tezosconnect/config.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/internal/blockchain/tezos/connector/tezosconnect/config.go b/internal/blockchain/tezos/connector/tezosconnect/config.go index e7008726..33967d69 100644 --- a/internal/blockchain/tezos/connector/tezosconnect/config.go +++ b/internal/blockchain/tezos/connector/tezosconnect/config.go @@ -67,7 +67,8 @@ type FFCoreConfig struct { } type ConfirmationsConfig struct { - Required *int `yaml:"required,omitempty"` + Required *int `yaml:"required,omitempty"` + FetchReceiptUponEntry bool `yaml:"fetchReceiptUponEntry,omitempty"` } func (c *Config) WriteConfig(filename string, extraTezosconnectConfigPath string) error { @@ -142,7 +143,8 @@ func (t *Tezosconnect) GenerateConfig(stack *types.Stack, org *types.Organizatio }, Metrics: metrics, Confirmations: &ConfirmationsConfig{ - Required: confirmations, + Required: confirmations, + FetchReceiptUponEntry: true, }, } }