-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'create-keygen-service' into 'dev'
init project Closes #1 See merge request ergo/rosen-bridge/keygen-service!1
- Loading branch information
Showing
40 changed files
with
12,234 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
# Changesets | ||
|
||
Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works | ||
with multi-package repos, or single-package repos to help you version and publish your code. You can | ||
find the full documentation for it [in our repository](https://github.com/changesets/changesets) | ||
|
||
We have a quick list of common questions to get you started engaging with this project in | ||
[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"$schema": "https://unpkg.com/@changesets/[email protected]/schema.json", | ||
"changelog": "@rosen-bridge/changeset-formatter", | ||
"commit": false, | ||
"fixed": [], | ||
"linked": [], | ||
"access": "public", | ||
"baseBranch": "dev", | ||
"updateInternalDependencies": "patch", | ||
"ignore": [] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
--- | ||
--- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
.idea | ||
node_modules | ||
.nyc_output | ||
coverage | ||
dir | ||
build | ||
dist | ||
logs | ||
tests | ||
docker* | ||
Dockerfile | ||
.dockerignore | ||
.env | ||
.git* | ||
.eslintignore | ||
README.md | ||
.husky | ||
.lintstagedrc.js | ||
.mocharc.json | ||
.prettierrc.json | ||
vitest.config.ts | ||
peer-dialer*.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
dist | ||
docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
{ | ||
"root": true, | ||
"env": { | ||
"node": true | ||
}, | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": ["@typescript-eslint"], | ||
"extends": [ | ||
"eslint:recommended", | ||
"plugin:@typescript-eslint/recommended", | ||
"prettier" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
name: Build and Push Docker Image | ||
|
||
on: | ||
release: | ||
types: [published] | ||
push: | ||
branches: | ||
- dev | ||
|
||
jobs: | ||
build: | ||
name: Build and Push Docker Image | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout the Code | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Download Release From tss-api | ||
uses: dsaltares/[email protected] | ||
with: | ||
repo: 'rosen-bridge/tss-api' | ||
version: 'latest' | ||
regex: true | ||
file: 'rosenTss-linux-*' | ||
target: './bin/' | ||
|
||
- name: Move the Files | ||
run: | | ||
mv ./docker/production.yaml ./config/ | ||
mv ./docker/custom-environment-variables.yaml ./config/ | ||
7z x ./bin/rosenTss-linux-* -obin/ && rm -rf ./bin/*.zip | ||
mv ./bin/rosenTss-* ./bin/rosenTss | ||
- name: Set up QEMU | ||
uses: docker/setup-qemu-action@v2 | ||
with: | ||
platforms: ${{ vars.PLATFORM_LIST || 'linux/amd64' }} | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Login to Docker Registry | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ghcr.io | ||
username: rosen-bridge | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Docker Metadata action | ||
uses: docker/metadata-action@v5 | ||
id: meta | ||
with: | ||
images: ghcr.io/rosen-bridge/keygen-service | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
platforms: ${{ vars.PLATFORM_LIST || 'linux/amd64' }} | ||
push: true | ||
tags: ${{ steps.meta.outputs.tags }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Mirroring | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
- dev | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
git-sync: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: git-sync | ||
uses: wei/git-sync@v3 | ||
with: | ||
source_repo: ${GITHUB_REPOSITORY} | ||
source_branch: ${{github.ref_name}} | ||
destination_repo: 'https://${{ secrets.DESTINATION_USER }}:${{ secrets.DESTINATION_TOKEN }}@${{ secrets.DESTINATION_SERVER }}/ergo/${GITHUB_REPOSITORY}.git' | ||
destination_branch: ${{github.ref_name}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
yarn.lock | ||
.idea | ||
.vscode | ||
node_modules | ||
.nyc_output | ||
coverage | ||
dir | ||
build | ||
dist | ||
logs | ||
peer-dialer*.json | ||
bin | ||
config/rosen/ | ||
config/thresholds.json | ||
config/production.yaml | ||
config/local*.yaml | ||
.env | ||
.DS_Store |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
image: node:20.11 | ||
|
||
stages: | ||
- installation | ||
- type_check | ||
- lint | ||
- changeset | ||
|
||
installation: | ||
stage: installation | ||
cache: | ||
key: $CI_COMMIT_REF_NAME | ||
policy: push | ||
paths: | ||
- node_modules | ||
script: | ||
- npm ci | ||
|
||
type_check: | ||
stage: type_check | ||
cache: | ||
key: $CI_COMMIT_REF_NAME | ||
policy: pull | ||
paths: | ||
- node_modules | ||
script: | ||
- npm run type-check | ||
|
||
lint: | ||
stage: lint | ||
cache: | ||
key: $CI_COMMIT_REF_NAME | ||
policy: pull | ||
paths: | ||
- node_modules | ||
script: | ||
- npm run lint | ||
|
||
changeset: | ||
stage: changeset | ||
cache: | ||
key: $CI_COMMIT_REF_NAME | ||
policy: pull | ||
paths: | ||
- node_modules | ||
before_script: | ||
- git fetch origin dev | ||
script: | ||
- npx changeset status --since=origin/dev |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
**Issue Description:** | ||
|
||
<TBD / N/A> | ||
|
||
**Solution:** | ||
|
||
<TBD / N/A> | ||
|
||
**Acceptance Conditions:** | ||
|
||
<TBD / N/A> | ||
|
||
**Requierd Unit Tests:** | ||
|
||
<TBD / N/A> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env sh | ||
. "$(dirname -- "$0")/_/husky.sh" | ||
|
||
npx lint-staged |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export default { | ||
'*.ts': () => 'tsc --noEmit', | ||
'*.{js,ts}': 'eslint --fix', | ||
'*': 'prettier --ignore-unknown --write', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
20.11.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"singleQuote": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
FROM node:18.12 | ||
|
||
LABEL maintainer="rosen-bridge team <[email protected]>" | ||
LABEL description="Docker image for the keygen-service owned by rosen-bridge organization." | ||
LABEL org.label-schema.vcs-url="https://github.com/rosen-bridge/keygen-service" | ||
|
||
RUN adduser --disabled-password --home /app --uid 8080 --gecos "ErgoPlatform" ergo && \ | ||
install -m 0740 -o ergo -g ergo -d /app/peer-dialer /app/logs /app/tss-api/logs /app/tss-api/home \ | ||
&& chown -R ergo:ergo /app/ && umask 0077 | ||
USER ergo | ||
|
||
WORKDIR /app | ||
COPY --chmod=700 --chown=ergo:ergo package*.json ./ | ||
ADD --chmod=700 --chown=ergo:ergo ./patches/ ./patches/ | ||
RUN npm ci | ||
COPY --chmod=700 --chown=ergo:ergo . . | ||
RUN npm run build | ||
|
||
ENV NODE_ENV=production | ||
ENV SERVICE_PORT=8080 | ||
ENV TSS_HOME_ADDRESS="/app/tss-api/home" | ||
ENV TSS_LOG_ADDRESS="/app/tss-api/logs" | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["npm", "run", "start"] |
Oops, something went wrong.