Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ticket 25/rewrite ima agent on type script #41

Merged
merged 58 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
57212a6
code porting to TypeScript
sergiy-skalelabs Dec 8, 2023
7d59ed9
code porting to TypeScript
sergiy-skalelabs Dec 8, 2023
29ab85b
code porting to TypeScript
sergiy-skalelabs Dec 8, 2023
15c40d2
code porting to TypeScript
sergiy-skalelabs Dec 11, 2023
929ac58
code porting to TypeScript
sergiy-skalelabs Dec 11, 2023
af16e36
code porting to TypeScript
sergiy-skalelabs Dec 12, 2023
f57c7f0
code porting to TypeScript
sergiy-skalelabs Dec 12, 2023
07a2d69
code porting to TypeScript
sergiy-skalelabs Dec 12, 2023
babba72
code porting to TypeScript
sergiy-skalelabs Dec 12, 2023
1953556
code porting to TypeScript
sergiy-skalelabs Dec 12, 2023
32631bb
code porting to TypeScript
sergiy-skalelabs Dec 12, 2023
ae127aa
IMA/TypeScript support
sergiy-skalelabs Dec 13, 2023
1acebb3
IMA/TypeScript support
sergiy-skalelabs Dec 13, 2023
2a0a881
Merge remote-tracking branch 'origin/develop' into ticket-25/rewrite-…
sergiy-skalelabs Dec 13, 2023
7901d98
IMA/TypeScript support improvements, linting added, GA improved
sergiy-skalelabs Dec 14, 2023
8c8b5f4
IMA/TypeScript support improvements, linting added, GA improved
sergiy-skalelabs Dec 14, 2023
c0fef1b
IMA/TypeScript support improvements, linting added, GA improved
sergiy-skalelabs Dec 14, 2023
2e4dfe0
IMA/TypeScript support improvements, unit-test fixes
sergiy-skalelabs Dec 14, 2023
2636e28
IMA/TypeScript support improvements, unit-test fixes
sergiy-skalelabs Dec 14, 2023
9a97714
IMA/TypeScript support improvements, unit-test fixes
sergiy-skalelabs Dec 14, 2023
764865f
IMA/TypeScript support improvements, unit-test fixes
sergiy-skalelabs Dec 14, 2023
ca94fad
Merge remote-tracking branch 'origin/add-multicall-autodetection' int…
sergiy-skalelabs Dec 14, 2023
9235b4b
Merge remote-tracking branch 'origin/develop' into ticket-25/rewrite-…
sergiy-skalelabs Dec 14, 2023
132799a
IMA/TypeScript support improvements
sergiy-skalelabs Dec 15, 2023
2f758e5
IMA/TypeScript support improvements
sergiy-skalelabs Dec 18, 2023
9d72bbb
Massively added types to various compound and simple data pbjects
sergiy-skalelabs Dec 18, 2023
218bd97
code porting to TypeScript
sergiy-skalelabs Dec 20, 2023
c633a09
code porting to TypeScript
sergiy-skalelabs Dec 20, 2023
dc07148
Merge remote-tracking branch 'origin/develop' into ticket-25/rewrite-…
sergiy-skalelabs Dec 22, 2023
3e69a43
linting improvement, space-unary-ops: off and spaced-comment: off rul…
sergiy-skalelabs Dec 29, 2023
03ae31d
linting improvement, camelcase: off rule removed
sergiy-skalelabs Dec 29, 2023
2d32235
linting improvement, removed un-needed inplace disable for linter
sergiy-skalelabs Dec 29, 2023
c1e189e
linting improvement, removed no-tabs: off and no-mixed-spaces-and-tab…
sergiy-skalelabs Dec 29, 2023
4409ddb
linting improvement, removed no-useless-return: off and no-new: off r…
sergiy-skalelabs Dec 29, 2023
390aa0b
linting improvement, removed comma-spacing: off rule
sergiy-skalelabs Dec 29, 2023
4873029
linting improvement, removed no-unneeded-ternary: off rule
sergiy-skalelabs Dec 29, 2023
d96e0a0
linting improvement, removed no-fallthrough: off rule
sergiy-skalelabs Dec 29, 2023
b79b3dd
linting improvement, removed padded-blocks: off rule
sergiy-skalelabs Dec 29, 2023
ccef74c
linting improvement, removed multiline-ternary: off rule
sergiy-skalelabs Dec 29, 2023
c1d0fdf
linting improvement, removed handle-callback-err rule
sergiy-skalelabs Dec 29, 2023
b972268
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
c18c974
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
5e58943
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
062a9e1
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
2acad77
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
6f3f867
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
b10e125
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
e5a9d16
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
5b3840e
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
a81fd7d
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
9aa8824
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
2cc5f2f
ESLint rules simplifications
sergiy-skalelabs Jan 2, 2024
feb8069
ESLint rules simplifications
sergiy-skalelabs Jan 3, 2024
5e57feb
ESLint rules simplifications
sergiy-skalelabs Jan 3, 2024
1c71c4c
ESLint rules simplifications
sergiy-skalelabs Jan 3, 2024
ac6de55
ESLint rules simplifications
sergiy-skalelabs Jan 5, 2024
c526be3
BLS code cleanup
sergiy-skalelabs Jan 8, 2024
79e645c
ESLint rules simplifications
sergiy-skalelabs Jan 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions .github/workflows/comprehensive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,11 @@ jobs:
run: |
yarn install

- name: INIT - build IMA
working-directory: ${{env.working-directory}}
run: |
yarn rebuild

- name: INIT - initialize comprehensive test tokens
working-directory: ${{env.working-directory}}
run: |
Expand Down Expand Up @@ -276,22 +281,22 @@ jobs:
- name: SELF-TEST A - use IMA to browse S-Chain via node 00-00 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/main.mjs --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.1:2164 || true
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.1:2164 || true

- name: SELF-TEST B - use IMA to browse S-Chain via node 00-01 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/main.mjs --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.2:2264 || true
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.2:2264 || true

- name: SELF-TEST C - use IMA to browse S-Chain via node 01-00 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/main.mjs --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.3:2364 || true
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.3:2364 || true

- name: SELF-TEST D - use IMA to browse S-Chain via node 01-01 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/main.mjs --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.4:2464 || true
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.4:2464 || true

- name: INIT - download SGX Wallet
working-directory: ${{env.working-directory}}
Expand Down
13 changes: 9 additions & 4 deletions .github/workflows/container-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ jobs:
run: |
yarn install

- name: INIT - build IMA
working-directory: ${{env.working-directory}}
run: |
yarn rebuild

- name: INIT - initialize comprehensive test tokens
working-directory: ${{env.working-directory}}
run: |
Expand Down Expand Up @@ -286,22 +291,22 @@ jobs:
- name: SELF-TEST A - use IMA to browse S-Chain via node 00-00 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/main.mjs --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.1:2164 || true
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.1:2164 || true

- name: SELF-TEST B - use IMA to browse S-Chain via node 00-01 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/main.mjs --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.2:2264 || true
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.2:2264 || true

- name: SELF-TEST C - use IMA to browse S-Chain via node 01-00 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/main.mjs --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.3:2364 || true
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.3:2364 || true

- name: SELF-TEST D - use IMA to browse S-Chain via node 01-01 and test last is alive
working-directory: ${{env.working-directory}}
run: |
node ./src/main.mjs --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.4:2464 || true
node ./src/build/main.js --colors --no-gathered --browse-s-chain --url-s-chain=http://127.0.0.4:2464 || true

- name: INIT - build IMA docker container
working-directory: ${{env.working-directory}}
Expand Down
5 changes: 5 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,11 @@ jobs:
run: |
yarn install

- name: INIT - build IMA
working-directory: ./src
run: |
yarn rebuild

- name: Compile contracts
working-directory: ./IMA/proxy
run: |
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,5 +73,7 @@ venv
# network-browser

network-browser/test*.json

src/build
network-browser/build/*
network-browser.js
network-browser.js
2 changes: 2 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ RUN which python3

RUN mkdir /ima
WORKDIR /ima

COPY package.json package.json

COPY runner runner
Expand Down Expand Up @@ -66,5 +67,6 @@ RUN node-gyp --version

WORKDIR /ima
RUN yarn install
RUN yarn rebuild

CMD ["bash", "/ima/runner/run.sh"]
2 changes: 1 addition & 1 deletion IMA
3 changes: 3 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@
"license": "AGPL-3.0",
"author": "SKALE Labs and contributors",
"scripts": {
"build": "cd src && yarn build && cd ..",
"rebuild": "cd src && yarn rebuild && cd ..",
"clean-build": "cd src && yarn clean-build && cd ..",
"lint-check": "cd src && yarn lint-check && cd ..",
"lint-nb": "cd network-browser && yarn lint-check && cd ..",
"install-nb": "cd network-browser && bun install && cd ..",
Expand Down
2 changes: 1 addition & 1 deletion runner/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ BASE_OPTIONS="--gas-price-multiplier=$GAS_PRICE_MULTIPLIER \
--no-expose-pwa \
--auto-exit=86400"

IMA_LOOP_CMD="node $DIR/../src/main.mjs --loop $BASE_OPTIONS"
IMA_LOOP_CMD="node $DIR/../src/build/main.js --loop $BASE_OPTIONS"
NETWORK_BROWSER_CMD="node $DIR/../network-browser/build/index.js"

echo "$(date) - Running IMA loop and network-browser"
Expand Down
45 changes: 45 additions & 0 deletions src/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
module.exports = {
"env": {
browser: false,
es2020: true,
node: true
},
extends: "standard-with-typescript",
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parserOptions": {
"ecmaVersion": 2020,
"sourceType": "module"
},
"rules": {
"linebreak-style": [ "error", "unix" ],
"eqeqeq": "off",
sergiy-skalelabs marked this conversation as resolved.
Show resolved Hide resolved
"comma-dangle": [ "error", "never" ],
"comma-style": [ "error", "last" ],
"space-in-parens": [ "error", "always" ],
"space-before-blocks": [ "error", "always" ],
"array-bracket-spacing": [ "error", "always" ],
"object-curly-spacing": [ "error", "always" ],
"curly": [ "error", "multi-or-nest" ],
"nonblock-statement-body-position": [ "error", "below" ],
"no-cond-assign": [ "error", "always" ],
"max-len": [ "error", { "code": 100, "tabWidth": 4 } ],
"max-lines-per-function": [ "error", { "max": 200, "skipBlankLines": false } ],
"@typescript-eslint/indent": [ "error", 4, { "ignoredNodes": [ "SwitchCase" ] } ],
"@typescript-eslint/quotes": [ "error", "double" ],
"@typescript-eslint/semi": [ "error", "always" ],
"@typescript-eslint/space-before-function-paren": "off",
"@typescript-eslint/keyword-spacing": [ "error", {
"overrides": {
"if": { "before": false, "after": false },
"else": { "before": true, "after": true },
"for": { "before": false, "after": false },
"while": { "before": false, "after": false }
}
} ],
"@typescript-eslint/strict-boolean-expressions": "off",
"@typescript-eslint/no-this-alias": "off"
}
};
73 changes: 0 additions & 73 deletions src/.eslintrc.js

This file was deleted.

5 changes: 1 addition & 4 deletions src/about.txt
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ PAYMENT TRANSACTION options:
--gas-price-multiplier-tc ..............Sets Gas Price Multiplier for S<->S Target S-Chain transactions, Default value is 0.0.
--gas-price-multiplier .................Sets Gas Price Multiplier for both Main Net and S-Chain(s).
--gas-multiplier-mn ....................Sets Gas Value Multiplier for Main Net transactions, Default value is 1.25. Specify value 0.0 to disable Gas Price Customization for Main Net.
--gas-multiplier-sc ....................Sets Gas Value Multiplierfor S-Chain transactions, Default value is 1.25.
--gas-multiplier-sc ....................Sets Gas Value Multiplier S-Chain transactions, Default value is 1.25.
--gas-multiplier-tc ....................Sets Gas Value Multiplier for S<->S Target S-Chain transactions, Default value is 1.25.
--gas-multiplier .......................Sets Gas Value Multiplier for both Main Net and S-Chain(s).
REGISTRATION commands:
Expand Down Expand Up @@ -194,9 +194,6 @@ IMA JSON RPC SERVER options:
--no-cross-ima .........................Disable calls to IMA JSON RPC servers to compute BLS signature parts and operation state inside time frames. Use calls to skaled. Default mode.
TEST options:
--browse-s-chain .......................Download own S-Chain's network information.
OPTIMIZATION options:
--enable-multicall .....................Enable optimizations via multi-call. Default mode.
--disable-multicall ....................Disable optimizations via multi-call.
LOGGING options:
--expose ...............................Expose low-level log details after successful operations. By default details exposed only on errors.
--no-expose ............................Expose low-level log details only after errors. Default expose mode.
Expand Down
Loading
Loading