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.
- Two OpenAPI endpoints are implemented: `transact` and `query`. Both endpoints support
  critical subset of instructions and queries supported by the upstream javascript iroha sdk.
- One SocketIO endpoint can be used to monitor new blocks from the ledger.
- New connector can be used through a verifier-client interface.
- All added functions are tested in functional test suites and documented.
- Added execution of Iroha2 tests to the CI.

Additional notes:
- Connector doesn't work well with cactus module system, the issue has been reported and described
  in README. PR is not merge-ready until this is fixed (the CI should fail now).
- 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 hyperledger-cacti#2138
Depends on hyperledger-cacti#2140

Signed-off-by: Michal Bajer <michal.bajer@fujitsu.com>
  • Loading branch information
outSH committed Aug 31, 2022
1 parent b4d5970 commit 5cf4175
Show file tree
Hide file tree
Showing 41 changed files with 6,127 additions and 10 deletions.
1 change: 1 addition & 0 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@
"wasm",
"Xdai",
"goquorum",
"hada",
"outsh"
],
"dictionaries": [
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -821,6 +821,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/setup-node@v2.1.2
with:
node-version: v16.14.2
- uses: actions/checkout@v2.3.4
- 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/cache@v3.0.4
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
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ bin/
lerna-debug.log
cactus-openapi-spec.json
cactus-openapi-spec-*.json
.npmrc
*.log
build/
.gradle/
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
@iroha2:registry=https://nexus.iroha.tech/repository/npm-group/
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@ export interface ISocketApiClient<BlockType> {
args: any,
): Promise<any>;

watchBlocksV1?(
monitorOptions?: Record<string, unknown>,
): Observable<BlockType>;
watchBlocksV1?(monitorOptions?: any): Observable<BlockType>;

watchBlocksAsyncV1?(
monitorOptions?: Record<string, unknown>,
): Promise<Observable<BlockType>>;
watchBlocksAsyncV1?(monitorOptions?: any): Promise<Observable<BlockType>>;
}
Loading

0 comments on commit 5cf4175

Please sign in to comment.