-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Dmitri Meshin
committed
May 15, 2022
0 parents
commit 173e5c8
Showing
43 changed files
with
7,805 additions
and
0 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,14 @@ | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 2 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
max_line_length = 0 | ||
trim_trailing_whitespace = 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,15 @@ | ||
module.exports = { | ||
root: true, | ||
parser: '@typescript-eslint/parser', | ||
plugins: [ | ||
'@typescript-eslint', | ||
], | ||
extends: [ | ||
'eslint:recommended', | ||
'plugin:@typescript-eslint/recommended', | ||
], | ||
"rules": { | ||
"@typescript-eslint/no-var-requires": "off", | ||
"@typescript-eslint/no-explicit-any": "off" | ||
} | ||
}; |
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,16 @@ | ||
## Expected Behavior | ||
|
||
|
||
## Actual Behavior | ||
|
||
|
||
## Steps to Reproduce the Problem | ||
|
||
1. | ||
1. | ||
1. | ||
|
||
## Specifications | ||
|
||
- Version: | ||
- Platform: |
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,6 @@ | ||
Fixes #<issue_number_goes_here> | ||
|
||
> It's a good idea to open an issue first for discussion. | ||
- [ ] Tests pass | ||
- [ ] Appropriate changes to README are included in PR |
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,34 @@ | ||
# | ||
# Builds the docs and deploys to GitHub pages | ||
# | ||
# https://github.com/actions/setup-node | ||
# Using https://github.com/marketplace/actions/deploy-to-github-pages | ||
name: Deploy to Github pages | ||
|
||
on: | ||
push: | ||
#tags: | ||
# - v* | ||
branches: | ||
- master | ||
|
||
jobs: | ||
deploy_pages: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
with: | ||
node-version: '12' | ||
cache: 'yarn' | ||
- run: yarn install | ||
- run: yarn docs | ||
|
||
- run: touch docs/.nojekyll | ||
- name: Deploy docs 🚀 | ||
uses: JamesIves/github-pages-deploy-action@releases/v3 | ||
with: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
BRANCH: gh-pages # The branch the action should deploy to. | ||
FOLDER: docs # The folder the action should deploy. |
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,25 @@ | ||
name: Lint and test | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
build_and_test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
nodejs: [10, 12, 14] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# https://github.com/actions/setup-node | ||
- uses: actions/setup-node@v2-beta | ||
with: | ||
node-version: ${{ matrix.nodejs }} | ||
|
||
- run: yarn install | ||
- run: yarn add -D esbuild | ||
- run: yarn test | ||
- run: yarn lint | ||
- run: yarn build-all |
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 @@ | ||
/node_modules/ | ||
/build/ | ||
/lib/ | ||
/dist/ | ||
/docs/ | ||
.idea/* | ||
|
||
.DS_Store | ||
coverage | ||
*.log | ||
/data/* |
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,31 @@ | ||
image: node:12 | ||
|
||
cache: | ||
paths: | ||
- node_modules/ | ||
|
||
stages: | ||
- test | ||
- deploy | ||
|
||
lint-and-test: | ||
stage: test | ||
script: | ||
- yarn install | ||
- yarn add -D esbuild | ||
- yarn test | ||
- yarn lint | ||
- yarn build-all | ||
|
||
# Deploy docs to Gitlab pages | ||
pages: | ||
stage: deploy | ||
only: | ||
- master | ||
script: | ||
- yarn install | ||
- yarn docs | ||
- mv docs public | ||
artifacts: | ||
paths: | ||
- public |
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,17 @@ | ||
/.github/ | ||
/.vscode/ | ||
/node_modules/ | ||
/build/ | ||
/tmp/ | ||
.idea/* | ||
/docs/ | ||
|
||
coverage | ||
*.log | ||
.gitlab-ci.yml | ||
|
||
package-lock.json | ||
/*.tgz | ||
/tmp* | ||
/mnt/ | ||
/package/ |
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,27 @@ | ||
{ | ||
"version": "2.0.0", | ||
"tasks": [ | ||
{ | ||
"type": "npm", | ||
"script": "build", | ||
"group": { | ||
"kind": "build", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": [], | ||
"label": "npm: build", | ||
"detail": "tsc -p tsconfig.json" | ||
}, | ||
{ | ||
"type": "npm", | ||
"script": "test", | ||
"group": { | ||
"kind": "test", | ||
"isDefault": true | ||
}, | ||
"problemMatcher": [], | ||
"label": "npm: test", | ||
"detail": "jest" | ||
} | ||
] | ||
} |
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 @@ | ||
MIT License | ||
|
||
Copyright (c) 2021 Chris Hager | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
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,27 @@ | ||
# SSV Keys | ||
|
||
[](https://github.com/metachris/typescript-boilerplate/actions?query=workflow%3A%22Build+and+test%22) | ||
|
||
Library and CLI to work with ETH keystore file, decrypt private key from it using password, | ||
use that private key to get shares for operators and to build final payload for transaction | ||
to use it in SSV Network. | ||
|
||
* [Installation](docs/install.md) | ||
* [Running CLI](docs/cli.md) | ||
* [Using in your projects](docs/library.md) | ||
* [Code Architecture](docs/arch.md) | ||
* [Development](docs/dev.md) | ||
|
||
## Todo | ||
|
||
* Make it possible to use specific number of signers and fails in shares generation, use four by default. | ||
Read: [From Crash to Byzantine Consensus with 2f + 1 Processes](https://www.gsd.inesc-id.pt/~mpc/pubs/bc2f+1.pdf) | ||
|
||
## Authors | ||
|
||
* [Dmitri Meshin](https://github.com/meshin-blox) | ||
* [Guy Muroch](https://github.com/guym-blox) | ||
|
||
## License | ||
|
||
MIT License |
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,9 @@ | ||
<html> | ||
<head> | ||
<script src="./dist/esbuild/browser.js"></script> | ||
<!-- <script src="https://cdn.jsdelivr.net/npm/typescript-boilerplate-2021"></script> --> | ||
</head> | ||
<body> | ||
Open the devtools 👇 | ||
</body> | ||
</html> |
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 @@ | ||
keep it here |
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,27 @@ | ||
#!/usr/bin/env node | ||
|
||
const { nodeExternalsPlugin } = require('esbuild-node-externals'); | ||
|
||
const options = { | ||
tsconfig: 'tsconfig.json', | ||
logLevel: "info", | ||
entryPoints: [ | ||
"src/main.ts" | ||
], | ||
minify: true, | ||
bundle: true, | ||
outfile: "dist/esbuild/main.js", | ||
sourcemap: "external", | ||
plugins: [ | ||
nodeExternalsPlugin({}), | ||
], | ||
}; | ||
|
||
console.debug('Final build config: ', { options }); | ||
|
||
require("esbuild") | ||
.build(options) | ||
.catch((error) => { | ||
console.error(error); | ||
process.exit(1); | ||
}); |
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,44 @@ | ||
module.exports = { | ||
roots: ['<rootDir>/src'], | ||
testMatch: [ | ||
"**/__tests__/**/*.+(ts|tsx|js)", | ||
"**/?(*.)+(spec|test).+(ts|tsx|js)" | ||
], | ||
transform: { | ||
"^.+\\.(ts|tsx)$": "ts-jest" | ||
}, | ||
setupFilesAfterEnv: [ | ||
"<rootDir>/src/config/jest/setupTests.ts" | ||
], | ||
globals: { | ||
Uint8Array: Uint8Array, | ||
}, | ||
testEnvironment: "./src/config/jest/TestsEnvironments", | ||
watchPlugins: [ | ||
"jest-watch-typeahead/filename", | ||
"jest-watch-typeahead/testname" | ||
], | ||
resetMocks: true, | ||
testTimeout: 10000, | ||
moduleFileExtensions: [ | ||
"web.js", | ||
"js", | ||
"web.ts", | ||
"ts", | ||
"web.tsx", | ||
"tsx", | ||
"json", | ||
"web.jsx", | ||
"jsx", | ||
"node" | ||
], | ||
transformIgnorePatterns: [ | ||
"[/\\\\]node_modules[/\\\\].+\\.(js|jsx|mjs|cjs|ts|tsx)$", | ||
"^.+\\.module\\.(css|sass|scss)$" | ||
], | ||
modulePaths: [], | ||
moduleNameMapper: { | ||
"^react-native$": "react-native-web", | ||
"^.+\\.module\\.(css|sass|scss)$": "identity-obj-proxy" | ||
}, | ||
} |
Oops, something went wrong.