dvandal / cryptonote-nodejs-pool

Mining pool for all CryptoNote based coins using Cryptonight, Cryptonight Light and Cryptonight Heavy algorithms
GNU General Public License v2.0
367 stars 612 forks source link

Unable to build cryptonote-nodejs-pool #731

Open shanhashcah opened 1 year ago

shanhashcah commented 1 year ago

Hi:

Does node-crypto-pool support node s 16 or higher as I am unable to run npm update command. It is throwing below error

make: *** [cryptonight-hashing.target.mk:226: Release/obj.target/cryptonight-hashing/multihashing.o] Error 1

Pls help.

Anaphylaxis commented 1 year ago

Building a Docker container fails for me as well, I am using https://github.com/dvandal/cryptonote-nodejs-pool/pull/727/commits/860bb2bcdceb28f0b66cb1d30ea1ec1c7cceb8cb

➜  cryptonote-nodejs-pool docker build .
Sending build context to Docker daemon  12.92MB
Step 1/12 : FROM node:14-slim
 ---> 7671819c5461
Step 2/12 : RUN apt-get update   && DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs git libboost-all-dev libssl-dev make gcc g++ libsodium-dev  && rm -rf /var/lib/apt/lists/*
 ---> Using cache
 ---> 9cf1c1397d88
Step 3/12 : ADD . /pool/
 ---> 76153da82df2
Step 4/12 : WORKDIR /pool/
 ---> Running in 857792c74584
Removing intermediate container 857792c74584
 ---> 9893611e5e51
Step 5/12 : RUN npm update
 ---> Running in 8d3394d27305
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated uuid@3.4.0: Please upgrade  to version 7 or higher.  Older versions may use Math.random() in certain circumstances, which is known to be problematic.  See https://v8.dev/blog/math-random for details.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported

> bigint-buffer@1.1.5 install /pool/node_modules/bigint-buffer
> npm run rebuild || echo "Couldn't build bindings. Non-native version used."

> bigint-buffer@1.1.5 rebuild /pool/node_modules/bigint-buffer
> node-gyp rebuild

make: Entering directory '/pool/node_modules/bigint-buffer/build'
  CC(target) Release/obj.target/bigint_buffer/src/bigint-buffer.o
  SOLINK_MODULE(target) Release/obj.target/bigint_buffer.node
  COPY Release/bigint_buffer.node
make: Leaving directory '/pool/node_modules/bigint-buffer/build'

> bignum@0.13.1 install /pool/node_modules/bignum
> node-gyp rebuild

make: Entering directory '/pool/node_modules/bignum/build'
  CXX(target) Release/obj.target/bignum/bignum.o
In file included from ../../nan/nan.h:62,
                 from ../bignum.cc:8:
/root/.cache/node-gyp/14.21.3/include/node/node.h:793:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/root/.cache/node-gyp/14.21.3/include/node/node.h:827:3: note: in expansion of macro 'NODE_MODULE_X'
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../bignum.cc:1134:1: note: in expansion of macro 'NODE_MODULE'
 NODE_MODULE(bignum, init)
 ^~~~~~~~~~~
  SOLINK_MODULE(target) Release/obj.target/bignum.node
  COPY Release/bignum.node
make: Leaving directory '/pool/node_modules/bignum/build'

> blake2@4.1.1 install /pool/node_modules/blake2
> node-gyp rebuild

make: Entering directory '/pool/node_modules/blake2/build'
  CXX(target) Release/obj.target/binding/src/binding.o
../src/binding.cpp: In static member function 'static void Hash::Init(v8::Local<v8::Object>)':
../src/binding.cpp:41:114: warning: ignoring return value of 'v8::Maybe<bool> v8::Object::Set(v8::Local<v8::Context>, v8::Local<v8::Value>, v8::Local<v8::Value>)', declared with attribute warn_unused_result [-Wunused-result]
   target->Set(Nan::GetCurrentContext(), Nan::New("Hash").ToLocalChecked(), Nan::GetFunction(tpl).ToLocalChecked());
                                                                                                                  ^
In file included from /root/.cache/node-gyp/14.21.3/include/node/node.h:67,
                 from ../src/binding.cpp:1:
/root/.cache/node-gyp/14.21.3/include/node/v8.h:3670:37: note: declared here
   V8_WARN_UNUSED_RESULT Maybe<bool> Set(Local<Context> context,
                                     ^~~
../src/binding.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE Hash::New(Nan::NAN_METHOD_ARGS_TYPE)':
../src/binding.cpp:19:69: warning: cast between incompatible function types from 'int (*)(blake2b_state*, const void*, size_t)' {aka 'int (*)(blake2b_state__*, const void*, long unsigned int)'} to 'uintptr_t (*)(void*, const uint8_t*, uint64_t)' {aka 'long unsigned int (*)(void*, const unsigned char*, long unsigned int)'} [-Wcast-function-type]
  reinterpret_cast<uintptr_t (*)(void*, const uint8_t*, uint64_t)>(fn)
                                                                     ^
../src/binding.cpp:99:29: note: in expansion of macro 'BLAKE_FN_CAST'
    obj->any_blake2_update = BLAKE_FN_CAST(blake2b_update);
                             ^~~~~~~~~~~~~
../src/binding.cpp:19:69: warning: cast between incompatible function types from 'int (*)(blake2b_state*, void*, size_t)' {aka 'int (*)(blake2b_state__*, void*, long unsigned int)'} to 'uintptr_t (*)(void*, const uint8_t*, uint64_t)' {aka 'long unsigned int (*)(void*, const unsigned char*, long unsigned int)'} [-Wcast-function-type]
  reinterpret_cast<uintptr_t (*)(void*, const uint8_t*, uint64_t)>(fn)
                                                                     ^
../src/binding.cpp:100:28: note: in expansion of macro 'BLAKE_FN_CAST'
    obj->any_blake2_final = BLAKE_FN_CAST(blake2b_final);
                            ^~~~~~~~~~~~~
../src/binding.cpp:19:69: warning: cast between incompatible function types from 'int (*)(blake2bp_state*, const void*, size_t)' {aka 'int (*)(blake2bp_state__*, const void*, long unsigned int)'} to 'uintptr_t (*)(void*, const uint8_t*, uint64_t)' {aka 'long unsigned int (*)(void*, const unsigned char*, long unsigned int)'} [-Wcast-function-type]
  reinterpret_cast<uintptr_t (*)(void*, const uint8_t*, uint64_t)>(fn)
                                                                     ^
../src/binding.cpp:122:29: note: in expansion of macro 'BLAKE_FN_CAST'
    obj->any_blake2_update = BLAKE_FN_CAST(blake2bp_update);
                             ^~~~~~~~~~~~~
../src/binding.cpp:19:69: warning: cast between incompatible function types from 'int (*)(blake2bp_state*, void*, size_t)' {aka 'int (*)(blake2bp_state__*, void*, long unsigned int)'} to 'uintptr_t (*)(void*, const uint8_t*, uint64_t)' {aka 'long unsigned int (*)(void*, const unsigned char*, long unsigned int)'} [-Wcast-function-type]
  reinterpret_cast<uintptr_t (*)(void*, const uint8_t*, uint64_t)>(fn)
                                                                     ^
../src/binding.cpp:123:28: note: in expansion of macro 'BLAKE_FN_CAST'
    obj->any_blake2_final = BLAKE_FN_CAST(blake2bp_final);
                            ^~~~~~~~~~~~~
../src/binding.cpp:19:69: warning: cast between incompatible function types from 'int (*)(blake2s_state*, const void*, size_t)' {aka 'int (*)(blake2s_state__*, const void*, long unsigned int)'} to 'uintptr_t (*)(void*, const uint8_t*, uint64_t)' {aka 'long unsigned int (*)(void*, const unsigned char*, long unsigned int)'} [-Wcast-function-type]
  reinterpret_cast<uintptr_t (*)(void*, const uint8_t*, uint64_t)>(fn)
                                                                     ^
../src/binding.cpp:145:29: note: in expansion of macro 'BLAKE_FN_CAST'
    obj->any_blake2_update = BLAKE_FN_CAST(blake2s_update);
                             ^~~~~~~~~~~~~
../src/binding.cpp:19:69: warning: cast between incompatible function types from 'int (*)(blake2s_state*, void*, size_t)' {aka 'int (*)(blake2s_state__*, void*, long unsigned int)'} to 'uintptr_t (*)(void*, const uint8_t*, uint64_t)' {aka 'long unsigned int (*)(void*, const unsigned char*, long unsigned int)'} [-Wcast-function-type]
  reinterpret_cast<uintptr_t (*)(void*, const uint8_t*, uint64_t)>(fn)
                                                                     ^
../src/binding.cpp:146:28: note: in expansion of macro 'BLAKE_FN_CAST'
    obj->any_blake2_final = BLAKE_FN_CAST(blake2s_final);
                            ^~~~~~~~~~~~~
../src/binding.cpp:19:69: warning: cast between incompatible function types from 'int (*)(blake2sp_state*, const void*, size_t)' {aka 'int (*)(blake2sp_state__*, const void*, long unsigned int)'} to 'uintptr_t (*)(void*, const uint8_t*, uint64_t)' {aka 'long unsigned int (*)(void*, const unsigned char*, long unsigned int)'} [-Wcast-function-type]
  reinterpret_cast<uintptr_t (*)(void*, const uint8_t*, uint64_t)>(fn)
                                                                     ^
../src/binding.cpp:168:29: note: in expansion of macro 'BLAKE_FN_CAST'
    obj->any_blake2_update = BLAKE_FN_CAST(blake2sp_update);
                             ^~~~~~~~~~~~~
../src/binding.cpp:19:69: warning: cast between incompatible function types from 'int (*)(blake2sp_state*, void*, size_t)' {aka 'int (*)(blake2sp_state__*, void*, long unsigned int)'} to 'uintptr_t (*)(void*, const uint8_t*, uint64_t)' {aka 'long unsigned int (*)(void*, const unsigned char*, long unsigned int)'} [-Wcast-function-type]
  reinterpret_cast<uintptr_t (*)(void*, const uint8_t*, uint64_t)>(fn)
                                                                     ^
../src/binding.cpp:169:28: note: in expansion of macro 'BLAKE_FN_CAST'
    obj->any_blake2_final = BLAKE_FN_CAST(blake2sp_final);
                            ^~~~~~~~~~~~~
In file included from ../src/binding.cpp:1:
../src/binding.cpp: At global scope:
/root/.cache/node-gyp/14.21.3/include/node/node.h:793:43: warning: cast between incompatible function types from 'void (*)(v8::Local<v8::Object>)' to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/root/.cache/node-gyp/14.21.3/include/node/node.h:827:3: note: in expansion of macro 'NODE_MODULE_X'
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../src/binding.cpp:259:1: note: in expansion of macro 'NODE_MODULE'
 NODE_MODULE(binding, init)
 ^~~~~~~~~~~
../src/binding.cpp: In static member function 'static Nan::NAN_METHOD_RETURN_TYPE Hash::New(Nan::NAN_METHOD_ARGS_TYPE)':
../src/binding.cpp:163:26: warning: 'key_length' may be used uninitialized in this function [-Wmaybe-uninitialized]
     if (blake2sp_init_key(reinterpret_cast<blake2sp_state*>(&obj->state), digest_length, key_data, key_length) != 0) {
         ~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  CC(target) Release/obj.target/binding/src/BLAKE2/sse/blake2b.o
  CC(target) Release/obj.target/binding/src/BLAKE2/sse/blake2bp.o
  CC(target) Release/obj.target/binding/src/BLAKE2/sse/blake2s.o
  CC(target) Release/obj.target/binding/src/BLAKE2/sse/blake2sp.o
  SOLINK_MODULE(target) Release/obj.target/binding.node
  COPY Release/binding.node
make: Leaving directory '/pool/node_modules/blake2/build'

> multi-hashing@0.0.10 install /pool/node_modules/multi-hashing
> node-gyp rebuild

make: Entering directory '/pool/node_modules/multi-hashing/build'
  CXX(target) Release/obj.target/multihashing/multihashing.o
../multihashing.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE cryptonight(Nan::NAN_METHOD_ARGS_TYPE)':
../multihashing.cc:33:35: error: no matching function for call to 'v8::Value::ToBoolean()'
         fast = info[1]->ToBoolean()->BooleanValue();
                                   ^
In file included from /root/.cache/node-gyp/14.21.3/include/node/node.h:67,
                 from ../multihashing.cc:1:
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2848:18: note: candidate: 'v8::Local<v8::Boolean> v8::Value::ToBoolean(v8::Isolate*) const'
   Local<Boolean> ToBoolean(Isolate* isolate) const;
                  ^~~~~~~~~
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2848:18: note:   candidate expects 1 argument, 0 provided
../multihashing.cc:36:46: error: no matching function for call to 'v8::Value::ToObject()'
     Local<Object> target = info[0]->ToObject();
                                              ^
In file included from /root/.cache/node-gyp/14.21.3/include/node/node.h:67,
                 from ../multihashing.cc:1:
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2822:44: note: candidate: 'v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const'
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2822:44: note:   candidate expects 1 argument, 0 provided
../multihashing.cc: In constructor 'CNAsyncWorker::CNAsyncWorker(Nan::Callback*, char*, uint32_t)':
../multihashing.cc:80:16: warning: 'CNAsyncWorker::input' will be initialized after [-Wreorder]
         char * input;
                ^~~~~
../multihashing.cc:79:18: warning:   'uint32_t CNAsyncWorker::input_len' [-Wreorder]
         uint32_t input_len;
                  ^~~~~~~~~
../multihashing.cc:59:9: warning:   when initialized here [-Wreorder]
         CNAsyncWorker(Nan::Callback *callback, char * input, uint32_t input_len)
         ^~~~~~~~~~~~~
../multihashing.cc: In member function 'virtual void CNAsyncWorker::HandleOKCallback()':
../multihashing.cc:75:31: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
         callback->Call(2, argv);
                               ^
In file included from ../multihashing.cc:5:
../../nan/nan.h:1748:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
../multihashing.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE CNAsync(Nan::NAN_METHOD_ARGS_TYPE)':
../multihashing.cc:89:46: error: no matching function for call to 'v8::Value::ToObject()'
     Local<Object> target = info[0]->ToObject();
                                              ^
In file included from /root/.cache/node-gyp/14.21.3/include/node/node.h:67,
                 from ../multihashing.cc:1:
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2822:44: note: candidate: 'v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const'
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2822:44: note:   candidate expects 1 argument, 0 provided
../multihashing.cc: In constructor 'CNLAsyncWorker::CNLAsyncWorker(Nan::Callback*, char*, uint32_t)':
../multihashing.cc:121:16: warning: 'CNLAsyncWorker::input' will be initialized after [-Wreorder]
         char * input;
                ^~~~~
../multihashing.cc:120:18: warning:   'uint32_t CNLAsyncWorker::input_len' [-Wreorder]
         uint32_t input_len;
                  ^~~~~~~~~
../multihashing.cc:100:9: warning:   when initialized here [-Wreorder]
         CNLAsyncWorker(Nan::Callback *callback, char * input, uint32_t input_len)
         ^~~~~~~~~~~~~~
../multihashing.cc: In member function 'virtual void CNLAsyncWorker::HandleOKCallback()':
../multihashing.cc:116:31: warning: 'v8::Local<v8::Value> Nan::Callback::Call(int, v8::Local<v8::Value>*) const' is deprecated [-Wdeprecated-declarations]
         callback->Call(2, argv);
                               ^
In file included from ../multihashing.cc:5:
../../nan/nan.h:1748:3: note: declared here
   Call(int argc, v8::Local<v8::Value> argv[]) const {
   ^~~~
../multihashing.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE CNLAsync(Nan::NAN_METHOD_ARGS_TYPE)':
../multihashing.cc:130:46: error: no matching function for call to 'v8::Value::ToObject()'
     Local<Object> target = info[0]->ToObject();
                                              ^
In file included from /root/.cache/node-gyp/14.21.3/include/node/node.h:67,
                 from ../multihashing.cc:1:
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2822:44: note: candidate: 'v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const'
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2822:44: note:   candidate expects 1 argument, 0 provided
../multihashing.cc: In function 'Nan::NAN_METHOD_RETURN_TYPE cryptonight_light(Nan::NAN_METHOD_ARGS_TYPE)':
../multihashing.cc:149:35: error: no matching function for call to 'v8::Value::ToBoolean()'
         fast = info[1]->ToBoolean()->BooleanValue();
                                   ^
In file included from /root/.cache/node-gyp/14.21.3/include/node/node.h:67,
                 from ../multihashing.cc:1:
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2848:18: note: candidate: 'v8::Local<v8::Boolean> v8::Value::ToBoolean(v8::Isolate*) const'
   Local<Boolean> ToBoolean(Isolate* isolate) const;
                  ^~~~~~~~~
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2848:18: note:   candidate expects 1 argument, 0 provided
../multihashing.cc:152:46: error: no matching function for call to 'v8::Value::ToObject()'
     Local<Object> target = info[0]->ToObject();
                                              ^
In file included from /root/.cache/node-gyp/14.21.3/include/node/node.h:67,
                 from ../multihashing.cc:1:
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2822:44: note: candidate: 'v8::MaybeLocal<v8::Object> v8::Value::ToObject(v8::Local<v8::Context>) const'
   V8_WARN_UNUSED_RESULT MaybeLocal<Object> ToObject(
                                            ^~~~~~~~
/root/.cache/node-gyp/14.21.3/include/node/v8.h:2822:44: note:   candidate expects 1 argument, 0 provided
In file included from ../multihashing.cc:1:
../multihashing.cc: At global scope:
/root/.cache/node-gyp/14.21.3/include/node/node.h:793:43: warning: cast between incompatible function types from 'void (*)(Nan::ADDON_REGISTER_FUNCTION_ARGS_TYPE)' {aka 'void (*)(v8::Local<v8::Object>)'} to 'node::addon_register_func' {aka 'void (*)(v8::Local<v8::Object>, v8::Local<v8::Value>, void*)'} [-Wcast-function-type]
       (node::addon_register_func) (regfunc),                          \
                                           ^
/root/.cache/node-gyp/14.21.3/include/node/node.h:827:3: note: in expansion of macro 'NODE_MODULE_X'
   NODE_MODULE_X(modname, regfunc, NULL, 0)  // NOLINT (readability/null_usage)
   ^~~~~~~~~~~~~
../multihashing.cc:181:1: note: in expansion of macro 'NODE_MODULE'
 NODE_MODULE(multihashing, init)
 ^~~~~~~~~~~
make: *** [multihashing.target.mk:128: Release/obj.target/multihashing/multihashing.o] Error 1
make: Leaving directory '/pool/node_modules/multi-hashing/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:194:23)
gyp ERR! stack     at ChildProcess.emit (events.js:400:28)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:285:12)
gyp ERR! System Linux 6.0.19-edge
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /pool/node_modules/multi-hashing
gyp ERR! node -v v14.21.3
gyp ERR! node-gyp -v v5.1.1
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! multi-hashing@0.0.10 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the multi-hashing@0.0.10 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!     /root/.npm/_logs/2023-11-17T05_11_42_248Z-debug.log
The command '/bin/sh -c npm update' returned a non-zero code: 1
minershaven commented 11 months ago

Think mine uses node 11. Anything higher than that causes compatibility issues with the node modules.