0.1.0-alpha.2 • Published 10 months ago
rgb-lib v0.1.0-alpha.2
rgb-lib node.js bindings
Build
In order to build Node.js bindings, from the project root follow the Local or In docker instructions.
Both instructions will generate the files librgblibnodejs.so
in
rgb-lib-nodejs/target/release/
and rgblib.node
in
rgb-lib-nodejs/build/Release/
.
Local
- Install dependencies: Node.js v18, node-gyp, swig 4.1
- From the project root run:
cd rgb-lib-nodejs
npm install
In docker
docker build -f rgb-lib-nodejs/Dockerfile -t rgb-lib-nodejs .
docker run --rm -v $(pwd):/opt/mount --entrypoint bash \
rgb-lib-nodejs \
-c 'mkdir -p /opt/mount/rgb-lib-nodejs/build/Release /opt/mount/rgb-lib-nodejs/target/release \
&& cp /bindings/rgb-lib-nodejs/build/Release/rgblib.node /opt/mount/rgb-lib-nodejs/build/Release/ \
&& cp /bindings/rgb-lib-nodejs/target/release/librgblibnodejs.so /opt/mount/rgb-lib-nodejs/target/release/'
Usage
To try the generated library, from the project root run:
node rgb-lib-nodejs/example.js
0.1.0-alpha.2
10 months ago
0.1.0-alpha.1
10 months ago