andrewfhart/openassets

Problem installing openassets with buffertools and bignum

Closed this issue · 6 comments

Hello

I have a problem installing and building openassets module

after npm install openassets I get this:

buffertools@2.1.2 install /home/mario/projects/git/tuminium/node_modules/openassets/node_modules/bitcore/node_modules/buffertools
node-gyp rebuild

make: Entering directory /home/mario/projects/git/tuminium/node_modules/openassets/node_modules/bitcore/node_modules/buffertools/build' CXX(target) Release/obj.target/buffertools/buffertools.o ../buffertools.cc: In function ‘v8::Local<v8::Value> {anonymous}::decodeHex(const uint8_t*, size_t, const v8::FunctionCallbackInfo<v8::Value>&, uint32_t)’: ../buffertools.cc:42:46: error: conversion from ‘v8::MaybeLocal<v8::Object>’ to non-scalar type ‘v8::Local<v8::Object>’ requested node::Buffer::New(args.GetIsolate(), size) ^ ../buffertools.cc:367:26: note: in expansion of macro ‘UNI_BUFFER_NEW’ Local<Object> buffer = UNI_BUFFER_NEW(size / 2); ^ ../buffertools.cc: In function ‘void {anonymous}::Concat(const v8::FunctionCallbackInfo<v8::Value>&)’: ../buffertools.cc:42:46: error: conversion from ‘v8::MaybeLocal<v8::Object>’ to non-scalar type ‘v8::Local<v8::Object>’ requested node::Buffer::New(args.GetIsolate(), size) ^ ../buffertools.cc:459:26: note: in expansion of macro ‘UNI_BUFFER_NEW’ Local<Object> buffer = UNI_BUFFER_NEW(size); ^ make: *** [Release/obj.target/buffertools/buffertools.o] Error 1 make: Leaving directory/home/mario/projects/git/tuminium/node_modules/openassets/node_modules/bitcore/node_modules/buffertools/build'

and with bignum

node-gyp configure build

make: Entering directory `/home/mario/projects/git/tuminium/node_modules/openassets/node_modules/bitcore/node_modules/bignum/build'
CXX(target) Release/obj.target/bignum/bignum.o
../bignum.cc:172:27: error: expected class-name before ‘{’ token
class BigNum : ObjectWrap {
^
../bignum.cc:189:34: error: ‘Arguments’ does not name a type
static Handle New(const Arguments& args);
^
../bignum.cc:189:45: error: ISO C++ forbids declaration of ‘args’ with no type [-fpermissive]
static Handle New(const Arguments& args);

Hi @medisoft, thanks for the report!

I've was able to confirm your problem on a fresh checkout when using node 0.12 (specifically 0.12.7). I noticed it also happens when using node 0.11 (I tested 0.11.16).

I was able to get it to compile successfully using node 0.10.x (specifically 0.10.35). If you can, please let me know if using an 0.10x version of node works for you. Meanwhile, I will try to investigate how to get 0.11 and 0.12 versions working.

Also, I plan to update the version in the npm repository as soon as I can merge the contributions from @hughmadden (#3), which make the code compatible with the latest bitcore.

Tested with 0.10.40, and it worked the installation. But when running it I get this error:

module.js:340
throw err;
^
Error: Cannot find module './build/Debug/buffertools.node'
at Function.Module._resolveFilename (module.js:338:15)
at Function.Module._load (module.js:280:25)
at Module.require (module.js:364:17)
at require (module.js:380:17)
at Object. (/home/mario/projects/git/tuminium/node_modules/buffertools/buffertools.js:26:20)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)

I installed buffertools manually and now it loads. Let me test with testnet to see if it works generating a colored coin transaction

Great - glad you were able to get it working! I'm testing some improvements today to get it going with later versions of nodejs.

By the way, per the "To Do" section on the README - this library can not yet generate colored coin transactions... the TransactionBuilder component is simply not yet complete. That's where the active development is at this point. I would love it if you felt you could help out!

It can be used for colored coin transaction browsing and/or validating, just not as a generator... yet!

In case you're interested in taking a closer look... here, specifically is where the remaining work needs to be done: https://github.com/andrewfhart/openassets/blob/master/lib/protocol/TransactionBuilder.js#L60-L76.

The implementation will be based on the reference implementation (in python) available here: https://github.com/OpenAssets/openassets

@medisoft - the 0.2.0 release should resolve the installation issues you were encountering. I've tested using node 0.10x, 0.11x, 0.12x, and 1.4x.

Feel free to comment/reopen this issue if you still encounter problems.