Giter Club home page Giter Club logo

js-bigchaindb-driver's Introduction

js-bigchaindb-driver

Official JavaScript driver for BigchainDB to create transactions in Node.js and the browser.

Join the chat at https://gitter.im/bigchaindb/js-bigchaindb-driver npm codecov js ascribe Build Status Greenkeeper badge

Compatibility

BigchainDB Server BigchainDB JavaScript Driver
0.10 0.1.x
1.0.0 0.3.x
1.3.x 3.x.x
>= 2.0.0 4.x.x

Breaking changes

  • Version 4.0 of BigchainDB JavaScript Driver makes the driver compatible with BigchainDB 2.0. There are new functions for sending off transactions along with other changes. Check older versions
  • Version 3.2 of BigchainDB JavaScript Driver introduces a new way of creating transfer transactions. Check older versions

Table of Contents


Installation and Usage

npm install bigchaindb-driver
const driver = require('bigchaindb-driver')
// or ES6+
import driver from 'bigchaindb-driver'

Example: Create a transaction

const driver = require('bigchaindb-driver')
const base58 = require('bs58');
const crypto = require('crypto');
const { Ed25519Sha256 } = require('crypto-conditions');

// BigchainDB server instance (e.g. https://example.com/api/v1/)
const API_PATH = 'http://localhost:9984/api/v1/'

// Create a new keypair.
const alice = new driver.Ed25519Keypair()

// Construct a transaction payload
const tx = driver.Transaction.makeCreateTransaction(
    // Define the asset to store, in this example it is the current temperature
    // (in Celsius) for the city of Berlin.
    { city: 'Berlin, DE', temperature: 22, datetime: new Date().toString() },

    // Metadata contains information about the transaction itself
    // (can be `null` if not needed)
    { what: 'My first BigchainDB transaction' },

    // A transaction needs an output
    [ driver.Transaction.makeOutput(
            driver.Transaction.makeEd25519Condition(alice.publicKey))
    ],
    alice.publicKey
)

// Sign the transaction with private keys
const txSigned = driver.Transaction.signTransaction(tx, alice.privateKey)

// Or use delegateSignTransaction to provide your own signature function
function signTransaction() {
    // get privateKey from somewhere
    const privateKeyBuffer = Buffer.from(base58.decode(alice.privateKey))
    return function sign(serializedTransaction, input, index) {
        const transactionUniqueFulfillment = input.fulfills ? serializedTransaction
                .concat(input.fulfills.transaction_id)
                .concat(input.fulfills.output_index) : serializedTransaction
        const transactionHash = crypto.createHash('sha3-256').update(transactionUniqueFulfillment).digest()
        const ed25519Fulfillment = new Ed25519Sha256();
        ed25519Fulfillment.sign(transactionHash, privateKeyBuffer);
        return ed25519Fulfillment.serializeUri();
    };
}
const txSigned = driver.Transaction.delegateSignTransaction(tx, signTransaction())

// Send the transaction off to BigchainDB
const conn = new driver.Connection(API_PATH)

conn.postTransactionCommit(txSigned)
    .then(retrievedTx => console.log('Transaction', retrievedTx.id, 'successfully posted.'))

Browser usage

<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>BigchainDB boilerplate</title>
        <!-- Adjust version to your needs -->
        <script src="https://unpkg.com/[email protected]/dist/browser/bigchaindb-driver.window.min.js"></script>

        <script>
            // BigchainDB server instance (e.g. https://example.com/api/v1/)
            const API_PATH = 'http://localhost:9984/api/v1/'

            // Create a new keypair.
            const alice = new BigchainDB.Ed25519Keypair()

            // Construct a transaction payload
            const tx = BigchainDB.Transaction.makeCreateTransaction(
                // Define the asset to store, in this example it is the current temperature
                // (in Celsius) for the city of Berlin.
                { city: 'Berlin, DE', temperature: 22, datetime: new Date().toString() },

                // Metadata contains information about the transaction itself
                // (can be `null` if not needed)
                { what: 'My first BigchainDB transaction' },

                // A transaction needs an output
                [ BigchainDB.Transaction.makeOutput(
                        BigchainDB.Transaction.makeEd25519Condition(alice.publicKey))
                ],
                alice.publicKey
            )

            // Sign the transaction with private keys
            const txSigned = BigchainDB.Transaction.signTransaction(tx, alice.privateKey)

            // Send the transaction off to BigchainDB
            let conn = new BigchainDB.Connection(API_PATH)

            conn.postTransactionCommit(txSigned)
                .then(res => {
                    const elem = document.getElementById('lastTransaction')
                    elem.href = API_PATH + 'transactions/' + txSigned.id
                    elem.innerText = txSigned.id
                    console.log('Transaction', txSigned.id, 'accepted')
                })
            // Check console for the transaction's status
        </script>
    </head>
    <body id="home">
        <h1>Hello BigchainDB</h1>
        <p>Your transaction id is: <a id="lastTransaction" target="_blank"><em>processing</em></a></p>
    </body>
</html>

BigchainDB Documentation

Speed Optimizations

This implementation plays "safe" by using JS-native (or downgradable) libraries for its crypto-related functions to keep compatibilities with the browser. If you do want some more speed, feel free to explore the following:

Development

git clone git@github.com:bigchaindb/js-bigchaindb-driver.git
cd js-bigchaindb-driver/

npm i
npm run dev

After updating source files in src/, make sure to update the API documentation. The following command will scan all source files and create the Markdown output into ./API.md:

npm run doc

Release Process

See the file named RELEASE_PROCESS.md.

Authors

Licenses

See LICENSE and LICENSE-docs.

js-bigchaindb-driver's People

Contributors

davidedwards avatar davie0 avatar diminator avatar dmvt avatar eckelj avatar future-is-present avatar getlarge avatar gitter-badger avatar greenkeeper[bot] avatar innopreneur avatar jernejpregelj avatar kremalicious avatar michielmulders avatar nemani avatar sbellem avatar ssadler avatar timdaub avatar tnguyen42 avatar ttmc avatar vrde avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

js-bigchaindb-driver's Issues

ECONNRESET Socket hang up

Hello,
We appear to be having an issue posting to BigchainDB via IPDB while connected to cellular connection on a Raspberry Pi.

Error
[ERROR] [815980KiB] { FetchError: request to https://test.ipdb.io/api/v1/statuses?transaction_id=52f21dd7e14a1707c36dfc1ac701d4ff523a2a7d7abc7ad26ef7cd7c49fb1beb failed, reason: socket hang up at ClientRequest.<anonymous> (/home/acorn/canpipe/node_modules/node-fetch/index.js:133:11) at emitOne (events.js:96:13) at ClientRequest.emit (events.js:188:7) at TLSSocket.socketOnEnd (_http_client.js:346:9) at emitNone (events.js:91:20) at TLSSocket.emit (events.js:185:7) at endReadableNT (_stream_readable.js:974:12) at _combinedTickCallback (internal/process/next_tick.js:80:11) at process._tickDomainCallback (internal/process/next_tick.js:128:9) name: 'FetchError', message: 'request to https://test.ipdb.io/api/v1/statuses?transaction_id=52f21dd7e14a1707c36dfc1ac701d4ff523a2a7d7abc7ad26ef7cd7c49fb1beb failed, reason: socket hang up', type: 'system', errno: 'ECONNRESET', code: 'ECONNRESET' }

Operating System and Name:
acorn@raspberrypi-B:~ $ cat /etc/*-release
PRETTY_NAME="Raspbian GNU/Linux 8 (jessie)"
NAME="Raspbian GNU/Linux"
VERSION_ID="8"
VERSION="8 (jessie)"
ID=raspbian
ID_LIKE=debian

Any details about your local setup that might be helpful in troubleshooting:
Running a Node application using the Javascript Driver.
Connected via cellular network.
The Raspberry Pi is also not stationary so signal will not be consistent.

Detailed steps to reproduce the bug.
Posting transactions at rate around 30 seconds under cellular connection with LTE.

For empty return set, listTransactions is not returning a list

Try on IPDB test net

conn.listTransaction('e77ab9036f4ae5c276502f02c825a8c03349ee1d8be139a44d0cb6ae7a8852f2', 'TRANSFER')

Transaction exists and was never spent. Instead of returning an empty array it's returning some weird internal object:

{"": 3, _state: undefined, _result: undefined, _subscribers: Array(0)}

npm install breaks

If I download the source code and run:

npm install

It crashes during installation, any thoughts about why ? I think that npm is eating all the memory, however if I directly:

npm install bigchaindb-driver
(version 0.3.0)
Then is fine...

Log error:


npm http request GET https://registry.npmjs.org/is-fullwidth-code-point
npm http 304 https://registry.npmjs.org/is-fullwidth-code-point
npm info attempt registry request try #1 at 8:08:57 PM
npm http request GET https://registry.npmjs.org/lcid
npm info attempt registry request try #1 at 8:08:57 PM
npm http request GET https://registry.npmjs.org/mem
npm http 304 https://registry.npmjs.org/lcid
npm http 304 https://registry.npmjs.org/mem
npm info attempt registry request try #1 at 8:08:57 PM
npm http request GET https://registry.npmjs.org/invert-kv
npm http 304 https://registry.npmjs.org/invert-kv
npm info lifecycle [email protected]~preinstall: [email protected]
Killed         ....] - extract:moo-server: sill gunzTarPerm extractEntry lolex.js


Btw if I install them one by one, it does not run out of memory but it is not able to install the following dependencies:

[email protected] /
+-- UNMET PEER DEPENDENCY [email protected]
+-- UNMET PEER DEPENDENCY [email protected]
`-- UNMET PEER DEPENDENCY [email protected]

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN [email protected] requires a peer of webpack@2 but none was installed.
npm WARN [email protected] requires a peer of eslint@^3.19.0 || ^4.5.0 but none was installed.
npm WARN [email protected] requires a peer of eslint-plugin-import@^2.7.0 but none was installed.
npm WARN [email protected] requires a peer of babel-eslint@^7.1.1 but none was installed.
npm WARN [email protected] requires a peer of [email protected] - 3.x but none was installed.

Contact multiple nodes to confirm validity of retrieved results

BigchainDB nodes can behave maliciously and send drivers incorrect results. We therefore generally advise to query only trusted nodes. We also advise to:

If a user wants to ask a BigchainDB cluster about the validity of a transaction, they must ask enough of the nodes to determine what a majority of the nodes think. The non-faulty nodes should all agree on the transaction’s validity. We assume that a majority of nodes are not faulty (i.e. not broken or somehow compromised).

The JS driver currently does not support this, but should be by allowing to query multiple nodes for results such that it asks "enough of the nodes to determine what a majority of the nodes think", meaning a majority decision on the results.

Document supplying credentials

It's only a small thing but I had to look at the python implementation and connection/index.js to realise that Connection takes an optional second argument for supplying credentials as an object. Would be great if this could be documented as well.

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Querying Assets

How do I save separate documents here? How do I retrieve the document using index?

Create sphinx style docs for JS-driver and reconcile with Python docs

As a guide line see docs for BDB-PY-driver: https://docs.bigchaindb.com/projects/py-driver/en/latest/index.html

We do not necessarily want all of that content. What I think would be important however is:

That's all for a first cut.

example code doesn't work against IPDB

Tossing this here, not clear if js driver problem or specific IPDB problem. Just following the usage example with added authentication, API returns a 400 BAD REQUEST. Which sounds like the transaction is not generated correctly

Node.js example code
const driver = require('bigchaindb-driver')

const API_PATH = 'https://test.ipdb.io/api/v1/'
const APP_ID = '...'
const APP_KEY = '...'

const alice = new driver.Ed25519Keypair()

const tx = driver.Transaction.makeCreateTransaction(
    { assetMessage: 'My very own asset...' },
    { metaDataMessage: 'wrapped in a transaction' },
    [ driver.Transaction.makeOutput(
            driver.Transaction.makeEd25519Condition(alice.publicKey))
    ],
    alice.publicKey
)

const txSigned = driver.Transaction.signTransaction(tx, alice.privateKey)

let conn = new driver.Connection(API_PATH, { 
    'Content-Type': 'application/json',
    app_id: APP_ID,
    app_key: APP_KEY
})

conn.postTransaction(txSigned)
    .then(() => conn.getStatus(txSigned.id))
    .then((res) => console.log('Transaction status:', res.status))

allow for flat chaining of request

Smth along the lines of:

let conn = driver.Connection(PATH);
conn
    .postTransaction(txSigned)
    .then(() => conn.getStatus(txSigned.id))
    .then((res) => console.log('Transaction status:', res.status));

no PRNG

When trying to use the driver on macOS 10.12.5 in a Node.js 8.1.0 context:

/bigchaindb-driver/dist/bundle/bundle.js:7876
var randombytes = function(/* x, n */) { throw new Error('no PRNG'); };
                                         ^
Error: no PRNG

This repo is undiscoverable and confusing

Questions completely unanswered in the Readme:

  1. Is this an official client?
  2. Is this written for Node.js?
  3. Why is npm package name not just bigchaindb?

As mentioned here, Node.js devs won't be able to find this repository although they're the main target group for this repo.

bundled browser version example

That's kinda not working right now since it assumes the use of a framework like React or Angular. The goal of the bundled versions for browsers should be to use it as is in any modern browser.

ToDo

  • output additional bundled js file or integrate into bundle.js file, see webpack's output.libraryTarget
  • prefix current output version with *.umd.js in filename
  • remove js- from the exported library name while we're at it
  • add bundled browser version example to readme

Shrink package size

The driver's current package sizes are - though uglified - almost 500KB.

bigchaindb-driver.amd.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.amd.min.js	application/javascript	582.1 kB	2017-07-05T16:26:28.000Z
bigchaindb-driver.amd.min.js.map	application/json	2.34 MB	2017-07-05T16:26:28.000Z
bigchaindb-driver.cjs.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.cjs.min.js	application/javascript	582.08 kB	2017-07-05T16:22:50.000Z
bigchaindb-driver.cjs.min.js.map	application/json	2.34 MB	2017-07-05T16:22:50.000Z
bigchaindb-driver.cjs2.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.cjs2.min.js	application/javascript	582.06 kB	2017-07-05T16:26:28.000Z
bigchaindb-driver.cjs2.min.js.map	application/json	2.34 MB	2017-07-05T16:26:28.000Z
bigchaindb-driver.umd.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.umd.min.js	application/javascript	582.29 kB	2017-07-05T16:22:50.000Z
bigchaindb-driver.umd.min.js.map	application/json	2.35 MB	2017-07-05T16:22:50.000Z
bigchaindb-driver.window.js	application/javascript	1.99 MB	2017-06-26T11:41:52.000Z
bigchaindb-driver.window.min.js	application/javascript	582.07 kB	2017-07-05T16:22:50.000Z
bigchaindb-driver.window.min.js.map	application/json	2.34 MB	2017-07-05T16:22:50.000Z

That's too much. I'm suspecting that we're injecting a bit to many dependencies or are using a bit to many babel shims that have to get included in the uglified bundle.

The goal here is the following:

  • see what options we have to shrink the bundle
  • aim for realistic target
  • play with uglify options to see if package size can be decreased
  • see if there is dependencies that could now be replaced with native browser functionality
  • etc.

I'm sure there's lots of tutorials on the web to shrink package sizes.

makeTransferTransaction can take multiple transactions as inputs

BigchainDB supports multiple inputs and outputs in TRANSFER transactions and multiple outputs in a CREATE transaction.

makeTransferTransaction however, currently doesn't allow a user to pass multiple inputs.

For more documentation on how this works, you may want to take a look at existing documentation:

Problem using bigchaindb-driver with Meteor.js

Simply adding bigchaindb-driver package to Meteor meteor npm install bigchaindb-driver --save doesn't work because one of dependencies is using ES6 spread operator (and meteor doesn't transpile npm modules automatically). Namely it's interledger/five-bells-condition npm module - see our solution here:

Ferris-Solutions/five-bells-condition@f1d69a6

So, in order to use bigchaindb with Meteor we forked js-bigchaindb-driver and modified it to use our local version of five-bells-condition, see here:

Ferris-Solutions@2550f6c

We didn't make a pull request simply because problem is not caused directly by this package (and using local "hacked" version of five-bells-condition is not elegant nor long-term solution), but reporting this in case someone has similar problem or need a quick solution.

So, to use bigchaindb-driver with Meteor, you can use our local "hacked" package:

meteor npm install --save https://github.com/Integration-Alpha/js-bigchaindb-driver.git

Undefined symbol: SHA512

Environment

OS: Ubuntu 14.04 TLS
node: v8.9.2
npm: 5.6.0
bigchaindb-driver: 3.2.0
Electron: 1.7.10
Electron-rebuild: 1.6.0

Error

I use Bigchaindb-driver in my Electron application.

const driver = require('bigchaindb-driver')
const API_PATH = 'http://localhost:9984/api/v1/';
var zila={
		"publicKey": "QhLyduKhqNSaR8e27BzNAsU8hBZzrDEi82t2t34HGfx",
  		"privateKey": "DuvuQjGH6AdKiKyFh6rgx1wBENkuHEUnLxmCfjysPMk5" 
	}
var conn = new driver.Connection(API_PATH);
const assetdata = {
	'test':{
		'serial_number':'dds=26373',
		'manufacturer':'car Tech Inc.'
	},
	'BBset':{
		'manufacturer':'car Tech Inc.'
	}
}

const metadata = { 'planet':'earth'}

try {
	//Asset creation
	const txCreateZilaSimple = driver.Transaction.makeCreateTransaction(
		assetdata,
		metadata,
		[driver.Transaction.makeOutput(
			driver.Transaction.makeEd25519Condition(zila.publicKey))],
		zila.publicKey
	)
	var txCreateZilaSimpleSigned = driver.Transaction.signTransaction(txCreateZilaSimple, zila.privateKey) //Throw Error.
	conn.postTransaction(txCreateZilaSimpleSigned)
	.then(() => conn.pollStatusAndFetchTransaction(txCreateZilaSimpleSigned.id))
	.then(retrievedTx => console.log('Transaction', retrievedTx.id, 'successfully posted.'))

} catch (err) {
	console.log(err);
}

I get an error below: Undefined symbol SHA512

$ npm start

> [email protected] start /home/maggie/Workspace/FirstElectron
> electron .

/home/maggie/Workspace/FirstElectron/node_modules/electron/dist/electron --type=renderer --no-sandbox --primordial-pipe-token=214DB30BF7D0AB30478D6635DEE883B6 --lang=en-US --app-path=/home/maggie/Workspace/FirstElectron --node-integration=true --webview-tag=true --no-sandbox --enable-pinch --num-raster-threads=2 --enable-main-frame-before-activation --content-image-texture-target=0,0,3553;0,1,3553;0,2,3553;0,3,3553;0,4,3553;0,5,3553;0,6,3553;0,7,3553;0,8,3553;0,9,3553;0,10,3553;0,11,3553;0,12,3553;0,13,3553;0,14,3553;0,15,3553;1,0,3553;1,1,3553;1,2,3553;1,3,3553;1,4,3553;1,5,3553;1,6,3553;1,7,3553;1,8,3553;1,9,3553;1,10,3553;1,11,3553;1,12,3553;1,13,3553;1,14,3553;1,15,3553;2,0,3553;2,1,3553;2,2,3553;2,3,3553;2,4,3553;2,5,3553;2,6,3553;2,7,3553;2,8,3553;2,9,3553;2,10,3553;2,11,3553;2,12,3553;2,13,3553;2,14,3553;2,15,3553;3,0,3553;3,1,3553;3,2,3553;3,3,3553;3,4,3553;3,5,3553;3,6,3553;3,7,3553;3,8,3553;3,9,3553;3,10,3553;3,11,3553;3,12,3553;3,13,3553;3,14,3553;3,15,3553;4,0,3553;4,1,3553;4,2,3553;4,3,3553;4,4,3553;4,5,3553;4,6,3553;4,7,3553;4,8,3553;4,9,3553;4,10,3553;4,11,3553;4,12,3553;4,13,3553;4,14,3553;4,15,3553 --disable-accelerated-video-decode --service-request-channel-token=214DB30BF7D0AB30478D6635DEE883B6 --renderer-client-id=4 --shared-files=v8_natives_data:100,v8_snapshot_data:101: symbol lookup error: /home/maggie/Workspace/FirstElectron/node_modules/ed25519/build/Release/ed25519.node: undefined symbol: SHA512
/home/maggie/Workspace/FirstElectron/node_modules/electron/dist/electron .: symbol lookup error: /home/maggie/Workspace/FirstElectron/node_modules/ed25519/build/Release/ed25519.node: undefined symbol: SHA512
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: `electron .`
npm ERR! spawn ENOENT
npm ERR! 
npm ERR! Failed at the [email protected] start 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/maggie/.npm/_logs/2017-12-21T09_21_32_798Z-debug.log

The content in /home/maggie/.npm/_logs/2017-12-21T09_21_32_798Z-debug.log is:

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'start' ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: /usr/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/maggie/Workspace/FirstElectron/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/usr/local/go/bin
9 verbose lifecycle [email protected]~start: CWD: /home/maggie/Workspace/FirstElectron
10 silly lifecycle [email protected]~start: Args: [ '-c', 'electron .' ]
11 info lifecycle [email protected]~start: Failed to exec start script
12 verbose stack Error: [email protected] start: `electron .`
12 verbose stack spawn ENOENT
12 verbose stack     at ChildProcess.<anonymous> (/usr/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack     at emitTwo (events.js:126:13)
12 verbose stack     at ChildProcess.emit (events.js:214:7)
12 verbose stack     at maybeClose (internal/child_process.js:925:16)
12 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
13 verbose pkgid [email protected]
14 verbose cwd /home/maggie/Workspace/FirstElectron
15 verbose Linux 3.13.0-123-generic
16 verbose argv "/usr/bin/node" "/usr/bin/npm" "start"
17 verbose node v8.9.2
18 verbose npm  v5.6.0
19 error file sh
20 error code ELIFECYCLE
21 error errno ENOENT
22 error syscall spawn
23 error [email protected] start: `electron .`
23 error spawn ENOENT
24 error Failed at the [email protected] start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Action required: Greenkeeper could not be activated 🚨

🚨 You need to enable Continuous Integration on all branches of this repository. 🚨

To enable Greenkeeper, you need to make sure that a commit status is reported on all branches. This is required by Greenkeeper because we are using your CI build statuses to figure out when to notify you about breaking changes.

Since we did not receive a CI status on the greenkeeper/initial branch, we assume that you still need to configure it.

If you have already set up a CI for this repository, you might need to check your configuration. Make sure it will run on all new branches. If you don’t want it to run on every branch, you can whitelist branches starting with greenkeeper/.

We recommend using Travis CI, but Greenkeeper will work with every other CI service as well.

Asset amount coerced to string in transaction.makeOutput

When I try to use transaction.makeOutput with a second parameter of 1000, I get the following error from https://test.ipdb.io/api/v1/:

{
  "message": "Invalid transaction schema: '1000' is not of type 'integer'",
  "status": 400
}

The makeOutput method coerces the amount to a string, but it appears that ipdb is expecting an integer.

Which one has the correct schema? The client or the server?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.