Skip to content

Commit

Permalink
feat(connector-iroha2): add support for Iroha V2
Browse files Browse the repository at this point in the history
- Add new Iroha V2 cactus connector.
- Add endpoints `transact` and `query`. Both endpoints support
  critical subset of instructions and queries supported by the upstream javascript iroha sdk.
  Transaction can be awaited or can return immediately.
- Add new endpoint `generate-transaction`, to create unsigned transactions
  that can be signed on the client side.
- Add a function to iroha2-connector package to help signing iroha transactions
  on the client (BLP) side.
- One SocketIO endpoint can be used to monitor new blocks from the ledger.
- Add new helper method for signing query payload on the client side.
- New connector can be used through a verifier-client interface.
- All added functions are tested in functional test suites and documented.
- Add test for complex scenario that involves creating new account and asset, and then transfering
  assets between two accounts.
- Add test for parsing retrieved block data to find specific transaction hashes.
- Added execution of Iroha2 tests to the CI.

Additional notes:
- Iroha V2 javascript packages are not available on official npm yet, had to include `.npmrc` with
  private npm address. I'm not sure if there's ETA of delivering these through NPM, so it might be
  necessary to commit it after all.

Closes #2138
Depends on #2140

Signed-off-by: Michal Bajer <[email protected]>
  • Loading branch information
outSH committed Dec 23, 2022
1 parent 6c62de4 commit db78969
Show file tree
Hide file tree
Showing 48 changed files with 7,947 additions and 20 deletions.
4 changes: 3 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,9 @@
"vscc",
"wasm",
"Xdai",
"goquorum"
"goquorum",
"hada",
"undici"
],
"dictionaries": [
"typescript,node,npm,go,rust"
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -820,6 +820,33 @@ jobs:
restore-keys: |
${{ runner.os }}-yarn-
- run: ./tools/ci.sh
cactus-plugin-ledger-connector-iroha2:
continue-on-error: false
env:
FULL_BUILD_DISABLED: true
JEST_TEST_PATTERN: packages/cactus-plugin-ledger-connector-iroha2/src/test/typescript/(unit|integration|benchmark)/.*/*.test.ts
JEST_TEST_RUNNER_DISABLED: false
TAPE_TEST_RUNNER_DISABLED: true
needs: build-dev
runs-on: ubuntu-20.04
steps:
- name: Use Node.js v16.14.2
uses: actions/[email protected]
with:
node-version: v16.14.2
- uses: actions/[email protected]
- id: yarn-cache-dir-path
name: Get yarn cache directory path
run: echo "::set-output name=dir::$(yarn cache dir)"
- id: yarn-cache
name: Restore Yarn Cache
uses: actions/[email protected]
with:
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
restore-keys: |
${{ runner.os }}-yarn-
- run: ./tools/ci.sh
cactus-plugin-ledger-connector-quorum:
continue-on-error: false
env:
Expand Down
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"run-ci": "./tools/ci.sh",
"reset:node-modules": "del-cli '**/node_modules'",
"reset:git": "git clean -f -X",
"reset:yarn-lock": "yarn install --update-checksums --force",
"reset:yarn-lock": "yarn run init-registries && yarn install --update-checksums --force",
"reset": "run-s reset:git reset:node-modules reset:yarn-lock configure",
"configure": "yarn install --frozen-lockfile --non-interactive && yarn run build:dev:backend",
"configure": "yarn run init-registries && yarn install --frozen-lockfile --non-interactive && yarn run build:dev:backend",
"install-yarn": "npm install --global [email protected]",
"custom-checks": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/custom-checks/run-custom-checks.ts",
"tools:validate-bundle-names": "TS_NODE_PROJECT=./tools/tsconfig.json node --trace-deprecation --experimental-modules --abort-on-uncaught-exception --loader ts-node/esm --experimental-specifier-resolution=node ./tools/validate-bundle-names.js",
Expand Down Expand Up @@ -68,7 +68,8 @@
"version": "npm ci && npm run build:dev && npm run build:prod && npm run test:unit",
"lerna-publish-canary": "npm run run-ci && lerna publish --canary --force-publish --dist-tag $(git branch --show-current) --preid $(git branch --show-current).$(git rev-parse --short HEAD)",
"lerna-publish": "lerna publish --conventional-commits --sign-git-commit --sign-git-tag",
"prepare": "husky install"
"prepare": "husky install",
"init-registries": "npm config set @iroha2:registry=https://nexus.iroha.tech/repository/npm-group/"
},
"devDependencies": {
"@commitlint/cli": "13.1.0",
Expand Down
Loading

0 comments on commit db78969

Please sign in to comment.