Skip to content

Commit

Permalink
Merge branch 'meeco-integration' into meeco-integration-fe
Browse files Browse the repository at this point in the history
  • Loading branch information
itelesheva committed Jul 27, 2023
2 parents 96c9d6f + 556f1c6 commit 7c91623
Show file tree
Hide file tree
Showing 146 changed files with 13,930 additions and 39,832 deletions.
18 changes: 18 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,24 @@ jobs:
push: true
tags: 'gcr.io/hedera-registry/mrv-sender:${{ steps.package-version.outputs.current-version}}'

- name: analytics-service-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@v2
with:
context: .
file: ./analytics-service/Dockerfile
push: true
tags: 'gcr.io/hedera-registry/analytics-service:${{ steps.package-version.outputs.current-version}}, gcr.io/hedera-registry/analytics-service:latest'

- name: analytics-service
if: ${{ steps.latestTag.outputs.value == 'hotfix'}}
uses: docker/build-push-action@v2
with:
context: .
file: ./analytics-service/Dockerfile
push: true
tags: 'gcr.io/hedera-registry/analytics-service:${{ steps.package-version.outputs.current-version}}'

- name: web-proxy-latest
if: ${{ steps.latestTag.outputs.value == 'latest'}}
uses: docker/build-push-action@v2
Expand Down
4 changes: 4 additions & 0 deletions analytics-service/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules
npm-debug.log
dist
.env
2 changes: 2 additions & 0 deletions analytics-service/.env.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
GUARDIAN_ENV=""
#OVVERRIDE="false"
2 changes: 2 additions & 0 deletions analytics-service/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/node_modules/
/dist/
46 changes: 46 additions & 0 deletions analytics-service/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
FROM node:16 AS interfacesModuleBuilder
WORKDIR /usr/local/interfaces
COPY ./interfaces/package.json ./
COPY ./interfaces/tsconfig*.json ./
ADD ./interfaces/src ./src/.
RUN yarn install
RUN yarn pack

FROM node:16 AS commonModuleBuilder
WORKDIR /usr/local/common
COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz
COPY ./common/package.json ./
COPY ./common/tsconfig*.json ./
RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));"
RUN yarn install
ADD ./common/src ./src/.
RUN yarn pack

FROM node:16 AS analyticsBuilder
WORKDIR /usr/local/analytics-service
COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz
COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz
COPY ./analytics-service/package.json ./
COPY ./analytics-service/tsconfig*.json ./
RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));"
RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));"
RUN yarn install
ADD ./analytics-service/src ./src/.
RUN yarn run build:prod

FROM node:16
ENV PLATFORM="docker"
ENV NODE_ENV="production"
WORKDIR /usr/local/analytics-service
COPY --from=interfacesModuleBuilder /usr/local/interfaces/guardian-interfaces-*.tgz /tmp/interfaces.tgz
COPY --from=commonModuleBuilder /usr/local/common/guardian-common-*.tgz /tmp/common.tgz
COPY --from=analyticsBuilder /usr/local/analytics-service/yarn.lock ./
COPY ./analytics-service/package.json ./
COPY ./analytics-service/public ./public
RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/interfaces']='file:/tmp/interfaces.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));"
RUN node -e "const fs=require('fs'); const input=JSON.parse(fs.readFileSync('package.json')); input.dependencies['@guardian/common']='file:/tmp/common.tgz'; fs.writeFileSync('package.json', JSON.stringify(input));"
RUN yarn install --frozen-lockfile
COPY --from=analyticsBuilder /usr/local/analytics-service/dist ./dist
RUN rm /tmp/interfaces.tgz /tmp/common.tgz

CMD npm start
23 changes: 23 additions & 0 deletions analytics-service/configs/.env.analytics
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Analytics Service Specialized Variables
SERVICE_CHANNEL="analytics-service"
DB_DATABASE="analytics_db"
DIRECT_MESSAGE_PORT="6558"

# Ecosystem Defined Variables
HEDERA_NET="testnet"
PREUSED_HEDERA_NET="testnet"
ACCESS_TOKEN_SECRET="youraccesstokensecret"
MQ_ADDRESS="localhost"
DB_HOST="localhost"
MQ_MAX_PAYLOAD="1048576"
#LOG_LEVEL="2"
#MQ_MESSAGE_CHUNK=5000000
#RAW_REQUEST_LIMIT="1gb"
#JSON_REQUEST_LIMIT="1mb"

MESSAGE_LANG="en-US"
TRANSACTION_LOG_LEVEL="1"
INITIALIZATION_TOPIC_ID="0.0.2030"

# ANALYTICS
ANALYTICS_SCHEDULER="0 0 * * 1"
23 changes: 23 additions & 0 deletions analytics-service/configs/.env.analytics.develop
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Analytics Service Specialized Variables
SERVICE_CHANNEL="analytics-service"
DB_DATABASE="analytics_db"
DIRECT_MESSAGE_PORT="6558"

# Ecosystem Defined Variables
HEDERA_NET="testnet"
PREUSED_HEDERA_NET="testnet"
ACCESS_TOKEN_SECRET="youraccesstokensecret"
MQ_ADDRESS="localhost"
DB_HOST="localhost"
MQ_MAX_PAYLOAD="1048576"
#LOG_LEVEL="2"
#MQ_MESSAGE_CHUNK=5000000
#RAW_REQUEST_LIMIT="1gb"
#JSON_REQUEST_LIMIT="1mb"

MESSAGE_LANG="en-US"
TRANSACTION_LOG_LEVEL="1"
INITIALIZATION_TOPIC_ID="0.0.2030"

# ANALYTICS
ANALYTICS_SCHEDULER="0 0 * * 1"
23 changes: 23 additions & 0 deletions analytics-service/configs/.env.analytics.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Analytics Service Specialized Variables
SERVICE_CHANNEL="analytics-service"
DB_DATABASE="analytics_db"
DIRECT_MESSAGE_PORT="6558"

# Ecosystem Defined Variables
HEDERA_NET=""
PREUSED_HEDERA_NET=""
ACCESS_TOKEN_SECRET="youraccesstokensecret"
MQ_ADDRESS=""
DB_HOST=""
MQ_MAX_PAYLOAD=""
#LOG_LEVEL="2"
#MQ_MESSAGE_CHUNK=5000000
#RAW_REQUEST_LIMIT="1gb"
#JSON_REQUEST_LIMIT="1mb"

MESSAGE_LANG="en-US"
TRANSACTION_LOG_LEVEL="1"
INITIALIZATION_TOPIC_ID=""

# ANALYTICS
ANALYTICS_SCHEDULER="0 0 * * 1"
10 changes: 10 additions & 0 deletions analytics-service/nodemon.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"watch": [
"./dist",
"../interfaces/dist",
"../common/dist"
],
"delay": 2500,
"ext": "ts, js",
"exec": "node dist/index.js"
}
74 changes: 74 additions & 0 deletions analytics-service/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"packageManager": "yarn@3.2.1",
"_moduleAliases": {
"@api": "dist/api",
"@helpers": "dist/helpers",
"@entity": "dist/entity",
"@interfaces": "dist/interfaces",
"@middlewares": "dist/middlewares"
},
"author": "Envision Blockchain Solutions <info@envisionblockchain.com>",
"dependencies": {
"@guardian/common": "^2.14.3-prerelease",
"@guardian/interfaces": "^2.14.3-prerelease",
"@nestjs/common": "^9.4.1",
"@nestjs/core": "^9.4.1",
"@nestjs/jwt": "^10.0.3",
"@nestjs/microservices": "^9.4.1",
"@nestjs/platform-express": "^9.4.2",
"@nestjs/swagger": "^6.3.0",
"@types/express-fileupload": "^1.4.1",
"class-transformer": "^0.5.1",
"class-validator": "^0.14.0",
"cron": "^2.0.0",
"dotenv": "^16.0.0",
"excel4node": "^1.8.2",
"express": "^4.17.1",
"express-fileupload": "^1.4.0",
"hpp": "^0.2.3",
"http-errors": "^2.0.0",
"jszip": "^3.7.1",
"module-alias": "^2.2.2",
"prom-client": "^14.1.1",
"prometheus-api-metrics": "3.2.2",
"reflect-metadata": "^0.1.13",
"ws": "^8.2.1",
"yaml": "^2.3.1",
"yup": "^1.1.1"
},
"description": "",
"devDependencies": {
"@types/express": "^4.17.13",
"@types/jszip": "^3.4.1",
"@types/node": "^18.16.0",
"@types/ws": "^8.2.2",
"chai": "^4.3.4",
"cross-env": "^7.0.3",
"mocha": "^9.2.0",
"mocha-junit-reporter": "^2.0.2",
"nodemon": "^2.0.12",
"rewire": "^6.0.0",
"sinon": "^15.0.4",
"tslint": "^6.1.3",
"typescript": "^4.5.5"
},
"files": [
"dist"
],
"license": "Apache-2.0",
"main": "dist/index.js",
"module": "dist/index.js",
"name": "analytics-service",
"scripts": {
"build": "tsc",
"build:prod": "tsc --project tsconfig.production.json",
"debug": "nodemon dist/index.js",
"dev:docker": "npm run build && nodemon .",
"dev": "tsc -w",
"lint": "tslint --config ../tslint.json --project .",
"start": "node dist/index.js",
"test": "mocha tests/**/*.test.js --reporter mocha-junit-reporter --reporter-options mochaFile=../test_results/ui-service.xml"
},
"version": "2.14.3-prerelease",
"stableVersion": "2.14.1"
}
Loading

0 comments on commit 7c91623

Please sign in to comment.