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

Added official Iroha Library package compatible with Iroha 1.0 beta-2 #35

Merged
merged 20 commits into from
Jun 4, 2018

Conversation

stinger112
Copy link
Contributor

Description

Iroha contributors have created NPM package with Iroha Connector Library, so this PR adds iroha-lib into Caliper and update Iroha's docker container to latest develop version.

Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
… in the second round

Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
iroha_node0:
image: hyperledger/iroha-docker@sha256:b82a24eee7cc4215bf70d9f79acab8b817e4cf36cc9f87c1c63202dca552cf0f
iroha-node0:
image: hyperledger/iroha:x86_64-develop-latest
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We (Iroha team) plan to change Iroha's docker naming in the nearest future, so now this PR uses image hyperledger/iroha:x86_64-develop-latest without any sha256.

When we rename it I'll do commit in this branch with the new name of container on dockerhub.

@haojun
Copy link
Contributor

haojun commented Apr 26, 2018

Error occurred when installing iroha-lib, any idea??

> iroha-lib@0.0.5 install /home/haojun/project/caliper/node_modules/iroha-lib
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(404): https://github.com/hyperledger/iroha-javascript/releases/download/0.0.5/node-v57-linux-x64-glibc.tar.gz 
node-pre-gyp ERR! Pre-built binaries not found for iroha-lib@0.0.5 and node@8.10.0 (node-v57 ABI, glibc) (falling back to source compile with node-gyp) 
make: Entering directory '/home/haojun/project/caliper/node_modules/iroha-lib/build'
make: *** No rule to make target '../../../../shared_model/bindings/CMakeLists.txt', needed by 'Release/obj/gen/shared_model/bindings/Makefile'.  Stop.
make: Leaving directory '/home/haojun/project/caliper/node_modules/iroha-lib/build'
gyp ERR! build error 
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:258:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Linux 4.4.0-121-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "build" "--fallback-to-build" "--module=/home/haojun/pr
oject/caliper/node_modules/iroha-lib/lib/node-v57-linux-x64-glibc/iroha_lib.node" "--module_name=iroha_lib" "--module_path=/home/haojun/project/caliper/node_modules/i
roha-lib/lib/node-v57-linux-x64-glibc"
gyp ERR! cwd /home/haojun/project/caliper/node_modules/iroha-lib
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
node-pre-gyp ERR! build error 
node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build 
--module=/home/haojun/project/caliper/node_modules/iroha-lib/lib/node-v57-linux-x64-glibc/iroha_lib.node --module_name=iroha_lib --module_path=/home/haojun/project/ca
liper/node_modules/iroha-lib/lib/node-v57-linux-x64-glibc' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/home/haojun/project/caliper/node_modules/iroha-lib/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack   at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Linux 4.4.0-121-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/haojun/project/caliper/node_modules/iroha-lib/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /home/haojun/project/caliper/node_modules/iroha-lib
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok 
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js build --fallback-to-build --module=/home/haojun/project/c
aliper/node_modules/iroha-lib/lib/node-v57-linux-x64-glibc/iroha_lib.node --module_name=iroha_lib --module_path=/home/haojun/project/caliper/node_modules/iroha-lib/li
b/node-v57-linux-x64-glibc' (1)
npm WARN ajv-keywords@3.1.0 requires a peer of ajv@^6.0.0 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! iroha-lib@0.0.5 install: `node-pre-gyp install --fallback-to-build`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the iroha-lib@0.0.5 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/haojun/.npm/_logs/2018-04-26T01_44_12_075Z-debug.log

Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
@haojun
Copy link
Contributor

haojun commented May 3, 2018

@stinger112 , can you help solve the problem??

@stinger112
Copy link
Contributor Author

stinger112 commented May 3, 2018

@haojun please try to use iroha-lib 0.0.6. It seems required ABI in 0.0.5 is missing.

@stinger112
Copy link
Contributor Author

I'm sorry for late response.
I need to fix a couple of things in this PR according to new changes in Iroha.

@stinger112 stinger112 changed the title Added contemporary official Iroha Library [WIP] Added contemporary official Iroha Library May 3, 2018
@lebdron
Copy link

lebdron commented May 7, 2018

Please also apply this diff for genesis block and txCounter fixes https://gist.github.com/victordrobny/02cbeeed165bb7226e67f57e8712c6a0

Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
@neewy
Copy link

neewy commented May 16, 2018

@haojun please review and approve so that we can use Caliper for our CI routine :)

@stinger112
Copy link
Contributor Author

stinger112 commented May 16, 2018

Dear @haojun sorry for this mess up!

We no need to merge this PR because I have to wait new release version of Iroha.
In the nutshell: we have no version's comprehension between Iroha and iroha-lib. I can't fix on current develop container by hash as you do because I build iroha-lib just for release versions of Iroha.
If I build iroha-lib for develop, users can have weird bugs because of interfaces incompatibility without any warnings. Also I can't use old available release of Iroha, because it contains some bugs itself.

So I suggest to wait when new version will be released (it's very very soon) and fix library and Iroha container on such version.

@haojun
Copy link
Contributor

haojun commented May 17, 2018

@stinger112 OK, got it

@neewy
Copy link

neewy commented May 24, 2018

@haojun @stinger112 let's merge since we have released? Arsenii, please confirm and fix conflicts

@haojun
Copy link
Contributor

haojun commented May 25, 2018

@neewy Great! And please run eslint to check if the code follows current linting rules (remove iroha folder from the .eslintignore file and run npm run lint).

Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
@stinger112 stinger112 changed the title [WIP] Added contemporary official Iroha Library Added official Iroha Library package compatible with Iroha 1.0 beta-2 May 28, 2018
@stinger112
Copy link
Contributor Author

@haojun, I updated the code.
Please review PR.

Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
@haojun
Copy link
Contributor

haojun commented May 30, 2018

A node-pre-gyp error happened when installing grpc@1.12.2, any idea how to fix it?

haojun@ecs-haojun:~/project/caliper$ npm install iroha-lib

> grpc@1.12.2 install /home/haojun/project/caliper/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Completion callback never invoked! 
node-pre-gyp ERR! System Linux 4.4.0-124-generic
node-pre-gyp ERR! command "/usr/local/bin/node" "/home/haojun/project/caliper/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--lib
rary=static_library"
node-pre-gyp ERR! cwd /home/haojun/project/caliper/node_modules/grpc
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.10.0
node-pre-gyp ERR! This is a bug in `node-pre-gyp`.
node-pre-gyp ERR! Try to update node-pre-gyp and file an issue if it does not help:
node-pre-gyp ERR!     <https://github.com/mapbox/node-pre-gyp/issues>
npm ERR! code ELIFECYCLE
npm ERR! errno 6
npm ERR! grpc@1.12.2 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 6
npm ERR! 
npm ERR! Failed at the grpc@1.12.2 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/haojun/.npm/_logs/2018-05-30T08_47_26_764Z-debug.log

@stinger112
Copy link
Contributor Author

I can install Caliper with dependencies from scratch in empty docker containers.

Checked systems:
ubuntu:16.04
node v8.11.2
npm 5.6.0
node-pre-gyp v0.10.0

ubuntu:18.04
node v10.3.0
npm 6.1.0
node-pre-gyp v0.10.0

So, I can't reproduce the bug. Please check your environment.

@@ -0,0 +1,4627 @@
{
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file should not be commited.

@@ -24,7 +24,8 @@
"commander": "^2.11.0",
"dockerode": "^2.5.0",
"fs-extra": "^4.0.2",
"grpc": "1.10.1",
"grpc": "^1.12.2",
"iroha-lib": "^0.1.1",
Copy link
Contributor

@haojun haojun Jun 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. what's the purpose of add npx?
  2. Is grpc > 1.12 MUST be used for iroha. If not, please keep the version as 1.10.1 (we found the new version of grpc is somehow incompatible with fabric-sdk )
  3. This package is for common use, so please don't add iroha's dependencies here.

Copy link
Contributor Author

@stinger112 stinger112 Jun 1, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. According to the philosophy of NPM all apps should be self-contained. If I have no globally installed ESLint or version of my installed ESLint another than specified in the package for some reason (e.g. in a case of CI), npm test and npm run-script lint may have strange behavior or even don't work at all.
    So I add npx as script wrapper to return such functionality.
    If you want to I can replace it with directly calling ./node_modules/.bin/eslint . or even return it to the previous state.
  2. grpc must not be used by Iroha, I returned it to the 1.10.1
  3. IMPORTANT! We definitely need to add some mechanism to fix versions of used connector packages for different ledgers in order to ensure the stability of the current version of Caliper.
    Exactly like we did use docker images and hashes/tags.
    I think just description in Readme not enough to solve this issue, therefore I decided to fix version in the common package.json until the future improvements.
    I know this not the best solution, but it is something.
    If you have any ideas how to gracefully solve this problem, it would be nice!

By the way, is grpc in package.json not a ledger-related dependency too?

@haojun
Copy link
Contributor

haojun commented Jun 1, 2018

@stinger112
It somehow works today, I think it was a problem of npmjs.

*/

/* eslint-disable no-console */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now you can use log function from src/comm/util.js to resolve the eslint error instead of disable it.
We may extend this function later.

Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
Signed-off-by: Arseniy Fokin <stinger112@gmail.com>
@haojun haojun merged commit 65c1759 into hyperledger-caliper:master Jun 4, 2018
@stinger112
Copy link
Contributor Author

@haojun Please add the following line in the package.json

"grpc": "^1.10.1",
"iroha-lib": "^0.1.4"

It has not been pushed, I forget!

@haojun
Copy link
Contributor

haojun commented Jun 5, 2018

@stinger112 Got it. I didn't notice it either.

faustovanin pushed a commit to faustovanin/caliper that referenced this pull request Oct 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants