diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ce695b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +it/*.class +it/bin/src/test/java/org/dome/accessnode/it/*.class +it/bin/src/test/java/org/dome/accessnode/*.class +it/bin/target/ +it/target/ diff --git a/README.md b/README.md index c6eab98..a998757 100644 --- a/README.md +++ b/README.md @@ -36,17 +36,17 @@ The Blockchain-Connector is responsible for publishing and retrieving all change ![Blockchain-Connector](./doc/blockchain-connector.png) -* [Blockchain-Connector](https://github.com/in2workspace/blockchain-connector): - * receives events from the Broker-Adapter and the DLT-Adapter - * generates the blockchain events and writes them to the DLT-Adapter - * resolves blockchain events and retrieves the actual entities from their source, writes them to the Broker-Adapter -* [Broker-Adapter](https://github.com/in2workspace/broker-adapter): - * listens for changes events from the local broker and notifies - the Blockchain-Connector about them - * writes entities from the Blockchain-Connector to the local broker +* [Blockchain-Connector](https://github.com/in2workspace/desmos): + * listens for changes events from the local broker and the DLT-Adapter (subscription) + * receives events from the local broker and the DLT-Adapter + * generates the blockchain events and writes them to the DLT-Adapter + * resolves blockchain events and retrieves the actual entities from their source, writes them to the Context Broker + * writes entities from the Blockchain-Connector to the local broker + * audit any transaction processed by the Blockchain-Connector and writes them to the local database. * [DLT-Adapter](https://github.com/alastria/DOME-blockchain_connector-dlt_interface): * listens for DOME Events and notifies the Blockchain-Connector * writes transactions with events received from the Blockchain-Connector to the blockchain + * retrieves transactions from the blockchain using a range of time parameter, and notifies the Blockchain-Connector There are no known alternatives to the components at the moment. diff --git a/charts/access-node/Chart.yaml b/charts/access-node/Chart.yaml index f9958d5..933b59e 100644 --- a/charts/access-node/Chart.yaml +++ b/charts/access-node/Chart.yaml @@ -5,18 +5,14 @@ type: application version: 0.0.1-PRE-8 appVersion: 0.0.1 dependencies: - - name: blockchain-connector - condition: blockchain-connector.enabled - repository: https://dome-marketplace.github.io/access-node - version: 0.1.0 - - name: broker-adapter - condition: broker-adapter.enabled - repository: https://dome-marketplace.github.io/access-node - version: 0.1.0 + - name: desmos + condition: desmos.enabled + repository: https://in2workspace.github.io/helm-charts + version: 0.5.0 - name: dlt-adapter condition: dlt-adapter.enabled - repository: https://dome-marketplace.github.io/access-node - version: 1.0.3 + repository: https://alastria.github.io/helm-charts + version: 1.0.0 - name: kafka condition: kafka.enabled repository: oci://registry-1.docker.io/bitnamicharts diff --git a/charts/access-node/values.yaml b/charts/access-node/values.yaml index def9251..71fbdcd 100644 --- a/charts/access-node/values.yaml +++ b/charts/access-node/values.yaml @@ -1,90 +1,56 @@ -## configuration for the blockchain-connector - see https://DOME-Marketplace.github.io/access-node/blockchain-connector for configuration documentation -blockchain-connector: - # -- should the blockchain-connector be enabled +## configuration for the desmos - see https://DOME-Marketplace.github.io/access-node for configuration documentation +desmos: + # -- should the desmos-blockchain-connector be enabled enabled: true ## deployment specific configuration - deployment: + app: ## configuration to connect to the dlt-adapter - dltAdapter: + dltAdapter: + # -- provider of the dlt-adapter component + provider: digitelts # -- (local) address of the dlt-adapter - domain: http://dlt-adapter:8080 - ## configuration of the blockchain to be used - blockchain: - # -- address of the access node at the (ethereum-compatible)blockchain - userEthereumAddress: someHexNumber - # -- rpc-address of the blockchain - rpcAddress: https://red-t.alastria.io/v0/9461d9f4292b41230527d57ee90652a6 + internalDomain: http://dlt-adapter:8080 + # -- (external) address of the dlt-adapter + externalDomain: http://dlt-adapter:8080 ## configuration of subscriptions at the blockchain - subscription: - # -- should the connector listen to events on the blockchain - active: true + eventSubscription: # -- local address of the blockchain-connectors notification endpoint for dlt events - notificationEndpoint: http://blockchain-connector:8080/notifications/dlt + notificationEndpoint: http://desmos:8080/notifications/dlt # -- a list of entity-types the connector is interested in - entityTypes: > - product-offering - ## connection information for the context broker - broker: - # -- internal address of the context broker to be used by the connector - internalDomain: http://scorpio:9090 - # -- extrenal addres of the broker. Will included in the hashlink and used by other access-nodes to retrieve the actual entities - externalDomain: http://my-scorpio.org - ## configuration of ngsi-ld entities to listen for - ngsiSubscription: - # -- local address of the blockchain-connectors notification endpoint for ngsi-ld events - notificationEndpoint: http://blockchain-connector:8080/notifications/broker - # -- a list of entity-types the connector is interested in - entityTypes: catalog,individual,organization,product,product-offering,category,service-specification,product-offering-price,resource-specification,product-specification - ## connection information to the broker-adapter - brokerAdapter: - # -- (local) address of the broker-adapter - domain: http://broker-adapter:8080 - # configuration of the paths provided by the broker-adapter - paths: - # -- entities path - entites: /api/v2/entities - # -- subscriptions path - subscriptions: /api/v2/subscriptions - ## information about the access-node operator - operator: - # -- did of the organization running the node - organizationId: did:web:my-marketplace-operator.org - ## configuration of the database to be used by the blockchain-connector - db: - # -- host of the db - host: postgresql-connector - # -- password to be used - password: postgres - # -- username to be used - username: postgres - # -- overrides the generated name, provides stable service names - this should be avoided if multiple instances are available in the same namespace - fullnameOverride: blockchain-connector - -## configuration for the broker-adapter - see https://DOME-Marketplace.github.io/access-node/broker-adapter for configuration documentation -broker-adapter: - # -- should the broker-adapter be enabled - enabled: true - ## deployment specific configuration - deployment: - ## connection information for the context broker - broker: - # -- internal address of the context broker to be used by the connector - internalDomain: http://scorpio:9090 - # -- extrenal addres of the broker. Will included in the hashlink and used by other access-nodes to retrieve the actual entities - externalDomain: http://my-scorpio.org - # -- overrides the generated name, provides stable service names - this should be avoided if multiple instances are available in the same namespace - fullnameOverride: broker-adapter + eventTypes: catalog,product-offering,category + ## connection information for the context broker + broker: + # -- provider of the broker + provider: scorpio + # -- internal address of the context broker to be used by the connector + internalDomain: http://scorpio:9090 + # -- external address of the broker. Will be included in the hashlink and used by other access-nodes to retrieve the actual entities + externalDomain: https://my-scorpio.org + ## configuration of ngsi-ld entities to listen for + ngsiSubscription: + # -- local address of the blockchain-connectors notification endpoint for ngsi-ld events + notificationEndpoint: http://desmos:8080/notifications/broker + # -- a list of entity-types the connector is interested in + entityTypes: catalog,product-offering,category + ## information about the access-node operator + client: + # -- did of the organization running the node + organizationId: did:web:my-marketplace-operator.org + ## configuration of the database to be used by the blockchain-connector + db: + # -- host of the db + host: postgresql-connector + # -- password to be used + password: postgres + # -- username to be used + username: postgres + # -- overrides the generated name, provides stable service names - this should be avoided if multiple instances are available in the same namespace + fullnameOverride: desmos -## configuration for the dlt-adapter - see https://DOME-Marketplace.github.io/access-node/dlt-adapter for configuration documentation +## configuration for the dlt-adapter - see https://DOME-Marketplace.github.io/access-node/dlt-adapter for configuration documentation dlt-adapter: # -- should the dlt-adapter be enabled enabled: true - ## deployment specific configuration - deployment: - # -- private key of the access node to sign transactions on the blockchain. Has to be the key for blockchain-connector.blockchain.userEthereumAddress - privateKey: someHexNumber - # -- address of the contract to be used. Needs to be available on `blockchain-connector.deployment.blockchain.rpcAddress` - contractAddress: 0xdF6B206F89354Ee260EdC52984e6Ad2a9C8CE5Ae # -- overrides the generated name, provides stable service names - this should be avoided if multiple instances are available in the same namespace fullnameOverride: dlt-adapter @@ -198,4 +164,4 @@ tm-forum-api: ## configuration for the api proxy, to serve all apis through one kubernetes service apiProxy: # -- should the proxy be enabled - enabled: true \ No newline at end of file + enabled: true diff --git a/charts/blockchain-connector/Chart.yaml b/charts/blockchain-connector/Chart.yaml deleted file mode 100644 index 0f56509..0000000 --- a/charts/blockchain-connector/Chart.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v2 -name: blockchain-connector -description: blockchain-connector Helm-Chart - -type: application -version: 0.1.0 -appVersion: "1.1.0" diff --git a/charts/blockchain-connector/templates/_helpers.tpl b/charts/blockchain-connector/templates/_helpers.tpl deleted file mode 100644 index 90db29d..0000000 --- a/charts/blockchain-connector/templates/_helpers.tpl +++ /dev/null @@ -1,45 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "blockchain-connector.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "blockchain-connector.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "blockchain-connector.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - - -{{/* -Common labels -*/}} -{{- define "blockchain-connector.labels" -}} -app.kubernetes.io/name: {{ include "blockchain-connector.name" . }} -helm.sh/chart: {{ include "blockchain-connector.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} \ No newline at end of file diff --git a/charts/blockchain-connector/templates/deployment.yaml b/charts/blockchain-connector/templates/deployment.yaml deleted file mode 100644 index 0f28e42..0000000 --- a/charts/blockchain-connector/templates/deployment.yaml +++ /dev/null @@ -1,90 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "blockchain-connector.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{ include "blockchain-connector.labels" . | nindent 4 }} -spec: - replicas: 1 - revisionHistoryLimit: 3 - selector: - matchLabels: - app.kubernetes.io/name: {{ include "blockchain-connector.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - template: - metadata: - labels: - {{ include "blockchain-connector.labels" . | nindent 8 }} - spec: - containers: - - name: {{ .Chart.Name }} - imagePullPolicy: {{ .Values.deployment.image.pullPolicy }} - image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" - livenessProbe: - httpGet: - path: /health - port: http - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 - readinessProbe: - httpGet: - path: /health - port: http - initialDelaySeconds: 10 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 10 - env: - - name: SPRING_LOGGING_LEVEL_ROOT - value: {{ .Values.deployment.logLevel }} - - name: SPRING_R2DBC_PASSWORD - value: {{ .Values.db.password }} - - name: SPRING_R2DBC_USERNAME - value: {{ .Values.db.username }} - - name: SPRING_FLYWAY_USERNAME - value: {{ .Values.db.username }} - - name: SPRING_FLYWAY_PASSWORD - value: {{ .Values.db.password }} - - name: SPRING_R2DBC_URL - value: "r2dbc:postgresql://{{ .Values.db.host }}:5432/mktdb" - - name: SPRING_FLYWAY_URL - value: "jdbc:postgresql://{{ .Values.db.host }}:5432/mktdb" - - name: DLT_ADAPTER_DOMAIN - value: {{ .Values.deployment.dltAdapter.domain }} - - name: BLOCKCHAIN_RPC_ADDRESS - value: {{ .Values.deployment.blockchain.rpcAddress }} - - name: BLOCKCHAIN_USER_ETHEREUM_ADDRESS - value: {{ .Values.deployment.blockchain.userEthereumAddress }} - - name: BLOCKCHAIN_SUBSCRIPTION_ACTIVE - value: {{ .Values.deployment.blockchain.subscription.active | quote }} - - name: BLOCKCHAIN_SUBSCRIPTION_EVENT_TYPES - value: {{ .Values.deployment.blockchain.subscription.eventTypes | quote }} - - name: BLOCKCHAIN_SUBSCRIPTION_NOTIFICATION_ENDPOINT - value: {{ .Values.deployment.blockchain.subscription.notificationEndpoint | quote }} - - name: BROKER_EXTERNAL_DOMAIN - value: {{ .Values.deployment.broker.externalDomain }} - - name: BROKER_INTERNAL_DOMAIN - value: {{ .Values.deployment.broker.internalDomain }} - - name: NGSI_SUBSCRIPTION_NOTIFICATION_ENDPOINT - value: {{ .Values.deployment.ngsiSubscription.notificationEndpoint }} - - name: NGSI_SUBSCRIPTION_ENTITY_TYPES - value: {{ .Values.deployment.ngsiSubscription.entityTypes }} - - name: BROKER_ADAPTER_DOMAIN - value: {{ .Values.deployment.brokerAdapter.domain }} - - name: BROKER_ADAPTER_PATHS_SUBSCRIPTIONS - value: {{ .Values.deployment.brokerAdapter.paths.subscriptions }} - - name: BROKER_ADAPTER_PATHS_ENTITIES - value: {{ .Values.deployment.brokerAdapter.paths.entities }} - - name: OPERATOR_ORGANIZATION_ID - value: {{ .Values.deployment.operator.organizationId }} - ports: - - containerPort: {{ .Values.service.port}} - name: http - protocol: TCP \ No newline at end of file diff --git a/charts/blockchain-connector/templates/service.yaml b/charts/blockchain-connector/templates/service.yaml deleted file mode 100644 index abf4b5f..0000000 --- a/charts/blockchain-connector/templates/service.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "blockchain-connector.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{ include "blockchain-connector.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - # same as scorpio, makes other config easier - - port: {{ .Values.service.port }} - targetPort: {{ .Values.service.port }} - protocol: TCP - name: http - selector: - app.kubernetes.io/name: {{ include "blockchain-connector.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} \ No newline at end of file diff --git a/charts/blockchain-connector/values.yaml b/charts/blockchain-connector/values.yaml deleted file mode 100644 index b97f348..0000000 --- a/charts/blockchain-connector/values.yaml +++ /dev/null @@ -1,37 +0,0 @@ -deployment: - image: - repository: in2kizuna/blockchain-connector - # -- tag of the image to be used - tag: v2.0.1 - # -- specification of the image pull policy - pullPolicy: IfNotPresent - logLevel: DEBUG - dltAdapter: - domain: http://dlt-adapter:8080 - blockchain: - rpcAddress: http://blockchain-testnode.infra.svc.cluster.local:8545/ - subscription: - active: false - notificationEndpoint: http://blockchain-connector:8080/notifications/dlt - broker: - internalDomain: http://scorpio:9090 - ngsiSubscription: - notificationEndpoint: http://blockchain-connector:8080/notifications/broker - entityTypes: catalog,individual,organization,product,product-offering,category,service-specification,product-offering-price,resource-specification,product-specification - brokerAdapter: - domain: http://broker-adapter:8080 - paths: - entites: /api/v2/entities - subscriptions: /api/v2/subscriptions - operator: - organizationId: FIWARE_TEST_PROVIDER -db: - host: postgresql-connector - password: postgres - username: postgres - -service: - port: 8080 - type: ClusterIP - -fullnameOverride: blockchain-connector \ No newline at end of file diff --git a/charts/broker-adapter/Chart.yaml b/charts/broker-adapter/Chart.yaml deleted file mode 100644 index ee47e24..0000000 --- a/charts/broker-adapter/Chart.yaml +++ /dev/null @@ -1,7 +0,0 @@ -apiVersion: v2 -name: broker-adapter -description: broker-adapter Helm-Chart - -type: application -version: 0.1.0 -appVersion: "1.1.0" diff --git a/charts/broker-adapter/templates/_helpers.tpl b/charts/broker-adapter/templates/_helpers.tpl deleted file mode 100644 index c672d31..0000000 --- a/charts/broker-adapter/templates/_helpers.tpl +++ /dev/null @@ -1,45 +0,0 @@ -{{/* vim: set filetype=mustache: */}} -{{/* -Expand the name of the chart. -*/}} -{{- define "broker-adapter.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" -}} -{{- end -}} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "broker-adapter.fullname" -}} -{{- if .Values.fullnameOverride -}} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- $name := default .Chart.Name .Values.nameOverride -}} -{{- if contains $name .Release.Name -}} -{{- .Release.Name | trunc 63 | trimSuffix "-" -}} -{{- else -}} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" -}} -{{- end -}} -{{- end -}} -{{- end -}} -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "broker-adapter.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" -}} -{{- end -}} - - -{{/* -Common labels -*/}} -{{- define "broker-adapter.labels" -}} -app.kubernetes.io/name: {{ include "broker-adapter.name" . }} -helm.sh/chart: {{ include "broker-adapter.chart" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end -}} \ No newline at end of file diff --git a/charts/broker-adapter/templates/deployment.yaml b/charts/broker-adapter/templates/deployment.yaml deleted file mode 100644 index 20f0fe8..0000000 --- a/charts/broker-adapter/templates/deployment.yaml +++ /dev/null @@ -1,40 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "broker-adapter.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{ include "broker-adapter.labels" . | nindent 4 }} -spec: - replicas: 1 - revisionHistoryLimit: 3 - selector: - matchLabels: - app.kubernetes.io/name: {{ include "broker-adapter.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} - strategy: - rollingUpdate: - maxSurge: 1 - maxUnavailable: 0 - template: - metadata: - labels: - {{ include "broker-adapter.labels" . | nindent 8 }} - spec: - containers: - - name: {{ .Chart.Name }} - imagePullPolicy: {{ .Values.deployment.image.pullPolicy }} - image: "{{ .Values.deployment.image.repository }}:{{ .Values.deployment.image.tag }}" - env: - - name: BROKER_EXTERNAL_DOMAIN - value: {{ .Values.deployment.broker.externalDomain }} - - name: BROKER_INTERNAL_DOMAIN - value: {{ .Values.deployment.broker.internalDomain }} - - name: BROKER_PATHS_ENTITIES - value: /ngsi-ld/v1/entities - - name: BROKER_PATHS_SUBSCRIPTIONS - value: /ngsi-ld/v1/subscriptions - ports: - - containerPort: {{ .Values.service.port}} - name: http - protocol: TCP \ No newline at end of file diff --git a/charts/broker-adapter/templates/service.yaml b/charts/broker-adapter/templates/service.yaml deleted file mode 100644 index d94e313..0000000 --- a/charts/broker-adapter/templates/service.yaml +++ /dev/null @@ -1,18 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "broker-adapter.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{ include "broker-adapter.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - # same as scorpio, makes other config easier - - port: {{ .Values.service.port }} - targetPort: {{ .Values.service.port }} - protocol: TCP - name: http - selector: - app.kubernetes.io/name: {{ include "broker-adapter.name" . }} - app.kubernetes.io/instance: {{ .Release.Name }} \ No newline at end of file diff --git a/charts/broker-adapter/values.yaml b/charts/broker-adapter/values.yaml deleted file mode 100644 index 2a109ef..0000000 --- a/charts/broker-adapter/values.yaml +++ /dev/null @@ -1,17 +0,0 @@ -deployment: - image: - repository: in2kizuna/broker-adapter - # -- tag of the image to be used - tag: v2.0.0 - # -- specification of the image pull policy - pullPolicy: IfNotPresent - logLevel: DEBUG - broker: - externalDomain: http://scorpio:9090 - internalDomain: http://scorpio:9090 - -service: - port: 8080 - type: ClusterIP - -fullnameOverride: broker-adapter \ No newline at end of file diff --git a/charts/dlt-adapter/Chart.yaml b/charts/dlt-adapter/Chart.yaml deleted file mode 100644 index 6f126ca..0000000 --- a/charts/dlt-adapter/Chart.yaml +++ /dev/null @@ -1,10 +0,0 @@ -apiVersion: v2 -name: dlt-adapter -description: A Helm chart for DLT Adapter component - -type: application -version: 1.0.3 -appVersion: "1.2.1" - -sources: - - https://github.com/alastria/DOME-blockchain_connector-dlt_interface \ No newline at end of file diff --git a/charts/dlt-adapter/templates/_helpers.tpl b/charts/dlt-adapter/templates/_helpers.tpl deleted file mode 100644 index b43fadc..0000000 --- a/charts/dlt-adapter/templates/_helpers.tpl +++ /dev/null @@ -1,62 +0,0 @@ -{{/* -Expand the name of the chart. -*/}} -{{- define "dlt-adapter.name" -}} -{{- default .Chart.Name .Values.nameOverride | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Create a default fully qualified app name. -We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). -If release name contains chart name it will be used as a full name. -*/}} -{{- define "dlt-adapter.fullname" -}} -{{- if .Values.fullnameOverride }} -{{- .Values.fullnameOverride | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- $name := default .Chart.Name .Values.nameOverride }} -{{- if contains $name .Release.Name }} -{{- .Release.Name | trunc 63 | trimSuffix "-" }} -{{- else }} -{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} -{{- end }} -{{- end }} -{{- end }} - -{{/* -Create chart name and version as used by the chart label. -*/}} -{{- define "dlt-adapter.chart" -}} -{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} -{{- end }} - -{{/* -Common labels -*/}} -{{- define "dlt-adapter.labels" -}} -helm.sh/chart: {{ include "dlt-adapter.chart" . }} -{{ include "dlt-adapter.selectorLabels" . }} -{{- if .Chart.AppVersion }} -app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} -{{- end }} -app.kubernetes.io/managed-by: {{ .Release.Service }} -{{- end }} - -{{/* -Selector labels -*/}} -{{- define "dlt-adapter.selectorLabels" -}} -app.kubernetes.io/name: {{ include "dlt-adapter.name" . }} -app.kubernetes.io/instance: {{ .Release.Name }} -{{- end }} - -{{/* -Create the name of the service account to use -*/}} -{{- define "dlt-adapter.serviceAccountName" -}} -{{- if .Values.serviceAccount.create }} -{{- default (include "dlt-adapter.fullname" .) .Values.serviceAccount.name }} -{{- else }} -{{- default "default" .Values.serviceAccount.name }} -{{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/dlt-adapter/templates/deployment.yaml b/charts/dlt-adapter/templates/deployment.yaml deleted file mode 100644 index d465f9a..0000000 --- a/charts/dlt-adapter/templates/deployment.yaml +++ /dev/null @@ -1,75 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: {{ include "dlt-adapter.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{- include "dlt-adapter.labels" . | nindent 4 }} -spec: - {{- if not .Values.autoscaling.enabled }} - replicas: {{ .Values.replicaCount }} - {{- end }} - selector: - matchLabels: - {{- include "dlt-adapter.selectorLabels" . | nindent 6 }} - template: - metadata: - {{- with .Values.podAnnotations }} - annotations: - {{- toYaml . | nindent 8 }} - {{- end }} - labels: - {{- include "dlt-adapter.selectorLabels" . | nindent 8 }} - spec: - {{- with .Values.imagePullSecrets }} - imagePullSecrets: - {{- toYaml . | nindent 8 }} - {{- end }} - serviceAccountName: {{ include "dlt-adapter.serviceAccountName" . }} - securityContext: - {{- toYaml .Values.podSecurityContext | nindent 8 }} - containers: - - name: {{ .Chart.Name }} - securityContext: - {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.image.pullPolicy }} - ports: - - name: http - containerPort: {{ .Values.port}} - protocol: TCP - livenessProbe: - httpGet: - path: /health - port: http - initialDelaySeconds: {{ .Values.livenessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.livenessProbe.periodSeconds }} - successThreshold: {{ .Values.livenessProbe.successThreshold }} - timeoutSeconds: {{ .Values.livenessProbe.timeoutSeconds }} - readinessProbe: - httpGet: - path: /health - port: http - initialDelaySeconds: {{ .Values.readinessProbe.initialDelaySeconds }} - periodSeconds: {{ .Values.readinessProbe.periodSeconds }} - successThreshold: {{ .Values.readinessProbe.successThreshold }} - timeoutSeconds: {{ .Values.readinessProbe.timeoutSeconds }} - env: - - name: PRIVATE_KEY - value: {{ .Values.deployment.privateKey }} - - name: CONTRACT_ADDRESS - value: {{ .Values.deployment.contractAddress }} - resources: - {{- toYaml .Values.resources | nindent 12 }} - {{- with .Values.nodeSelector }} - nodeSelector: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.affinity }} - affinity: - {{- toYaml . | nindent 8 }} - {{- end }} - {{- with .Values.tolerations }} - tolerations: - {{- toYaml . | nindent 8 }} - {{- end }} \ No newline at end of file diff --git a/charts/dlt-adapter/templates/hpa.yaml b/charts/dlt-adapter/templates/hpa.yaml deleted file mode 100644 index 29a04e6..0000000 --- a/charts/dlt-adapter/templates/hpa.yaml +++ /dev/null @@ -1,29 +0,0 @@ -{{- if .Values.autoscaling.enabled }} -apiVersion: autoscaling/v2beta1 -kind: HorizontalPodAutoscaler -metadata: - name: {{ include "dlt-adapter.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{- include "dlt-adapter.labels" . | nindent 4 }} -spec: - scaleTargetRef: - apiVersion: apps/v1 - kind: Deployment - name: {{ include "dlt-adapter.fullname" . }} - minReplicas: {{ .Values.autoscaling.minReplicas }} - maxReplicas: {{ .Values.autoscaling.maxReplicas }} - metrics: - {{- if .Values.autoscaling.targetCPUUtilizationPercentage }} - - type: Resource - resource: - name: cpu - targetAverageUtilization: {{ .Values.autoscaling.targetCPUUtilizationPercentage }} - {{- end }} - {{- if .Values.autoscaling.targetMemoryUtilizationPercentage }} - - type: Resource - resource: - name: memory - targetAverageUtilization: {{ .Values.autoscaling.targetMemoryUtilizationPercentage }} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/dlt-adapter/templates/service.yaml b/charts/dlt-adapter/templates/service.yaml deleted file mode 100644 index 7b78fb0..0000000 --- a/charts/dlt-adapter/templates/service.yaml +++ /dev/null @@ -1,16 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: {{ include "dlt-adapter.fullname" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{- include "dlt-adapter.labels" . | nindent 4 }} -spec: - type: {{ .Values.service.type }} - ports: - - port: {{ .Values.service.port }} - targetPort: http - protocol: TCP - name: http - selector: - {{- include "dlt-adapter.selectorLabels" . | nindent 4 }} \ No newline at end of file diff --git a/charts/dlt-adapter/templates/service_account.yaml b/charts/dlt-adapter/templates/service_account.yaml deleted file mode 100644 index a58eb71..0000000 --- a/charts/dlt-adapter/templates/service_account.yaml +++ /dev/null @@ -1,13 +0,0 @@ -{{- if .Values.serviceAccount.create -}} -apiVersion: v1 -kind: ServiceAccount -metadata: - name: {{ include "dlt-adapter.serviceAccountName" . }} - namespace: {{ .Release.Namespace | quote }} - labels: - {{- include "dlt-adapter.labels" . | nindent 4 }} - {{- with .Values.serviceAccount.annotations }} - annotations: - {{- toYaml . | nindent 4 }} - {{- end }} -{{- end }} \ No newline at end of file diff --git a/charts/dlt-adapter/values.yaml b/charts/dlt-adapter/values.yaml deleted file mode 100644 index c7c8367..0000000 --- a/charts/dlt-adapter/values.yaml +++ /dev/null @@ -1,88 +0,0 @@ -# Default values for dltAdapter. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - -replicaCount: 2 - -image: - repository: quay.io/digitelts/dlt-adapter - pullPolicy: Always - tag: "" -port: 8080 - -service: - type: ClusterIP - port: 8080 - -livenessProbe: - initialDelaySeconds: 30 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 30 -readinessProbe: - initialDelaySeconds: 31 - periodSeconds: 10 - successThreshold: 1 - timeoutSeconds: 30 - -autoscaling: - enabled: false - minReplicas: 1 - maxReplicas: 100 - targetCPUUtilizationPercentage: 80 - # targetMemoryUtilizationPercentage: 80 - -## configuration for prometheus monitoring -prometheus: - # -- should prometheus scrape be enabled - enabled: false - # -- path for prometheus scrape - path: /prometheus - # -- port prometheus scrape is available at - port: 8081 - -imagePullSecrets: [] -nameOverride: "" -fullnameOverride: "" - -serviceAccount: - # Specifies whether a service account should be created - create: false - # Annotations to add to the service account - annotations: {} - # The name of the service account to use. - # If not set and create is true, a name is generated using the fullname template - name: "" - -podAnnotations: {} - -podSecurityContext: {} - # fsGroup: 2000 - -securityContext: {} - # capabilities: - # drop: - # - ALL - # readOnlyRootFilesystem: true - # runAsNonRoot: true - # runAsUser: 1000 - -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. - # If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - - - -nodeSelector: {} - -tolerations: [] - -affinity: {} \ No newline at end of file diff --git a/doc/blockchain-connector.png b/doc/blockchain-connector.png index e7cf5a8..68940e4 100644 Binary files a/doc/blockchain-connector.png and b/doc/blockchain-connector.png differ diff --git a/it/charts/infra/blockchain-testnode/templates/contract-deploy.yaml b/it/charts/infra/blockchain-testnode/templates/contract-deploy.yaml index 8fc4612..810394b 100644 --- a/it/charts/infra/blockchain-testnode/templates/contract-deploy.yaml +++ b/it/charts/infra/blockchain-testnode/templates/contract-deploy.yaml @@ -12,14 +12,17 @@ spec: spec: containers: - name: contract-create - image: quay.io/wi_stefan/dome-contract:latest + image: quay.io/digitelts/dome-contract-deploy:1.0.0 env: - - name: NET_CHAIN_ID - value: "1" - name: PRIVATE_KEY value: "0x304d170fb355df65cc17ef7934404fe9baee73a1244380076436dec6fafb1e1f" #value: "0x09bac90daf84adc6ca0e3161e3a67c80e4a2ab79d7f55bf9b82f566e6d62ad87" - name: NODE_ENDPOINT value: http://blockchain-testnode.infra.svc.cluster.local:8545/ + - name: T_NET_CHAIN_ID + value: "83584648538" + - name: B_NET_CHAIN_ID + value: "2020" restartPolicy: OnFailure backoffLimit: 10 + diff --git a/it/consumer-values.yaml b/it/consumer-values.yaml index 95821cc..c26ec65 100644 --- a/it/consumer-values.yaml +++ b/it/consumer-values.yaml @@ -1,29 +1,31 @@ -blockchain-connector: - deployment: - blockchain: - rpcAddress: http://blockchain-testnode.infra.svc.cluster.local:8545/ - userEthereumAddress: 0x72b440177bcDfD339eF00ffF6B78c3620c09c469 - subscription: - active: true - eventTypes: service-catalog - notificationEndpoint: http://blockchain-connector.consumer.svc.cluster.local:8080/notifications/dlt +desmos: + app: + eventSubscription: + notificationEndpoint: http://desmos.consumer.svc.cluster.local:8080/notifications/dlt + eventTypes: service-catalog broker: + provider: scorpio externalDomain: http://scorpio.consumer.svc.cluster.local:9090 internalDomain: http://scorpio.consumer.svc.cluster.local:9090 ngsiSubscription: + notificationEndpoint: http://desmos.consumer.svc.cluster.local:8080/notifications/broker entityTypes: party - operator: + client: organizationId: did:web:consumer.org + fullnameOverride: desmos dlt-adapter: - deployment: - privateKey: 0x304d170fb355df65cc17ef7934404fe9baee73a1244380076436dec6fafb1e1f - contractAddress: 0x37532a3dbf29942d10fb8ba57dc35d2134fe494d + env: + PRIVATE_KEY: "0x304d170fb355df65cc17ef7934404fe9baee73a1244380076436dec6fafb1e1f" + DOME_EVENTS_CONTRACT_ADDRESS: "" + RPC_ADDRESS: "http://blockchain-testnode.infra.svc.cluster.local:8545/" + DOME_PRODUCTION_BLOCK_NUMBER: "0" + ISS: "0x9eb763b0a6b7e617d56b85f1df943f176018c8eedb2dd9dd37c0bd77496833fe" replicaCount: 1 image: - repository: quay.io/wi_stefan/dlt-adapter + repository: quay.io/digitelts/dlt-adapter # -- tag of the image to be used - tag: latest + tag: "" # -- specification of the image pull policy pullPolicy: Always logLevel: DEBUG @@ -55,4 +57,4 @@ tm-forum-api: apiProxy: service: type: LoadBalancer - port: 8081 \ No newline at end of file + port: 8081 diff --git a/it/it.iml b/it/it.iml new file mode 100644 index 0000000..940e608 --- /dev/null +++ b/it/it.iml @@ -0,0 +1,6 @@ + + + + + \ No newline at end of file diff --git a/it/pom.xml b/it/pom.xml index 1c2be2f..8810081 100644 --- a/it/pom.xml +++ b/it/pom.xml @@ -15,7 +15,7 @@ 17 UTF-8 - + 3.3.1 3.0.0-M5 1.2.4 @@ -459,6 +459,7 @@ maven-resources-plugin + ${version.maven-resources-plugin} copy-resources-infra @@ -541,6 +542,7 @@ false true ${project.build.directory}/k3s/provider + provider --name-template=provider --namespace=provider -f ${project.basedir}/provider-values.yaml @@ -557,6 +559,7 @@ false true ${project.build.directory}/k3s/consumer + consumer --name-template=consumer --namespace=consumer -f ${project.basedir}/consumer-values.yaml @@ -573,6 +576,7 @@ false true ${project.build.directory}/k3s/infra + infra --name-template=testnode --namespace=infra diff --git a/it/provider-values.yaml b/it/provider-values.yaml index c8415f4..5c3a07a 100644 --- a/it/provider-values.yaml +++ b/it/provider-values.yaml @@ -1,28 +1,31 @@ -blockchain-connector: - deployment: - blockchain: - rpcAddress: http://blockchain-testnode.infra.svc.cluster.local:8545/ - userEthereumAddress: 0x72b440177bcDfD339eF00ffF6B78c3620c09c469 - subscription: - active: false - privateKey: 0x304d170fb355df65cc17ef7934404fe9baee73a1244380076436dec6fafb1e1f +desmos: + app: + eventSubscription: + notificationEndpoint: http://desmos.provider.svc.cluster.local:8080/notifications/dlt + eventTypes: service-catalog broker: + provider: scorpio externalDomain: http://scorpio.provider.svc.cluster.local:9090 internalDomain: http://scorpio.provider.svc.cluster.local:9090 ngsiSubscription: + notificationEndpoint: http://desmos.provider.svc.cluster.local:8080/notifications/broker entityTypes: service-catalog,catalog,individual,organization,product,product-offering,category,service-specification,product-offering-price,resource-specification,product-specification - operator: + client: organizationId: did:web:provider.org + fullnameOverride: desmos dlt-adapter: - deployment: - privateKey: 0x304d170fb355df65cc17ef7934404fe9baee73a1244380076436dec6fafb1e1f - contractAddress: 0x37532a3dbf29942d10fb8ba57dc35d2134fe494d + env: + PRIVATE_KEY: "0x304d170fb355df65cc17ef7934404fe9baee73a1244380076436dec6fafb1e1f" + DOME_EVENTS_CONTRACT_ADDRESS: "" + RPC_ADDRESS: "http://blockchain-testnode.infra.svc.cluster.local:8545/" + DOME_PRODUCTION_BLOCK_NUMBER: "0" + ISS: "0xb95536636339fb1ee3b29e322feac9aa65a85ab098640aedc4fe998d063424c8" replicaCount: 1 image: - repository: quay.io/wi_stefan/dlt-adapter + repository: quay.io/digitelts/dlt-adapter # -- tag of the image to be used - tag: latest + tag: "" # -- specification of the image pull policy pullPolicy: Always logLevel: DEBUG @@ -54,4 +57,4 @@ tm-forum-api: apiProxy: service: type: LoadBalancer - port: 8080 \ No newline at end of file + port: 8080 diff --git a/it/src/test/java/org/dome/accessnode/it/StepDefinitions.java b/it/src/test/java/org/dome/accessnode/it/StepDefinitions.java index 3cf5448..efb2c2c 100644 --- a/it/src/test/java/org/dome/accessnode/it/StepDefinitions.java +++ b/it/src/test/java/org/dome/accessnode/it/StepDefinitions.java @@ -22,7 +22,6 @@ public class StepDefinitions { ServiceCatalogApi scaProvider; ServiceCatalogApi scaConsumer; - ServiceCatalogVO serviceCatalog; @Before @@ -40,7 +39,6 @@ public void checkProviderAndConsumerAvailable() throws ApiException { "The service catalog api should be available at the provider."); assertDoesNotThrow(() -> scaConsumer.listServiceCatalog(null, null, null), "The service catalog api should be available at the consumer."); - } @When("a catalog is created at the providers marketplace.") @@ -63,7 +61,6 @@ private boolean checkCatalogExistence(String id) { } catch (ApiException e) { return false; } - } }