Giter Site home page Giter Site logo

blockchain / service-my-wallet-v3 Goto Github PK

View Code? Open in Web Editor NEW
902.0 164.0 517.0 330 KB

Blockchain Wallet API Service

Home Page: https://blockchain.info/api/blockchain_wallet_api

License: GNU Affero General Public License v3.0

JavaScript 100.00%
blockchain-wallet bitcoin bitcoinrpc api wallet

service-my-wallet-v3's Introduction

Blockchain Wallet API V2

Programmatically interface with your Blockchain.info wallet.

Contents

Getting Started

To use this API, you will need to run small local service which be responsible for managing your Blockchain.info wallet. Your application interacts with this service locally via HTTP API calls.

Start by completing the following steps:

  1. Follow the installation instructions
  2. Start the server: $ blockchain-wallet-service start --port 3000
  3. Reference the documentation and start interacting with your wallet programmatically!

Note that blockchain-wallet-service is designed to be run locally on the same machine as your application and therefore will only accept connections from localhost. If you modify this service to accept external connections, be sure to add the appropriate firewall rules to prevent unauthorized use.

An API code is required for wallet creation and higher request limits. For basic usage, no API code is required. Request an API code here.

Upgrading

If you already have an application that uses Blockchain.info's Wallet API, you will need to complete the steps in the Getting Started section above and then, in your application code, replace calls to blockchain.info/merchant/... with localhost:<port>/merchant/....

API Documentation

View the original documentation.

All endpoints present in the API documentation above are supported in Blockchain Wallet API V2. The differences between two are:

  • The "consolidate addresses" endpoint has been omitted

All endpoints can be called with GET or POST, and can only be accessed from localhost.

Creating a new Blockchain Wallet

Endpoint: /api/v2/create

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (required)
  • priv - private key to import into wallet as first address (optional)
  • label - label to give to the first address generated in the wallet (optional)
  • email - email to associate with the newly created wallet (optional)

Sample Response:

{
  "guid": "05f290be-dbef-4636-a809-868893c51711",
  "address": "13R9dBgKwBP29JKo11zhfi74YuBsMxJ4qY",
  "label": "Main address"
}

Make Payment

Endpoint: /merchant/:guid/payment

Query Parameters:

  • to - bitcoin address to send to (required)
  • amount - amount in satoshi to send (required)
  • password - main wallet password (required)
  • second_password - second wallet password (required, only if second password is enabled)
  • api_code - blockchain.info wallet api code (optional)
  • from - bitcoin address or account index to send from (optional)
  • fee - specify transaction fee in satoshi
  • fee_per_byte - specify transaction fee-per-byte in satoshi

It is recommended that transaction fees are specified using the fee_per_byte parameter, which will compute your final fee based on the size of the transaction. You can also set a static fee using the fee parameter, but doing so may result in a low fee-per-byte, leading to longer confirmation times.

Sample Response:

{
  "to" : ["1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq"],
  "from": ["17p49XUC2fw4Fn53WjZqYAm4APKqhNPEkY"],
  "amounts": [200000],
  "fee": 1000,
  "txid": "f322d01ad784e5deeb25464a5781c3b20971c1863679ca506e702e3e33c18e9c",
  "success": true
}

Send to Many

Endpoint: /merchant/:guid/sendmany

Query Parameters:

  • recipients - a URI encoded JSON object, with bitcoin addresses as keys and the satoshi amounts as values (required, see example below)
  • password - main wallet password (required)
  • second_password - second wallet password (required, only if second password is enabled)
  • api_code - blockchain.info wallet api code (optional)
  • from - bitcoin address or account index to send from (optional)
  • fee - specify transaction fee in satoshi
  • fee_per_byte - specify transaction fee-per-byte in satoshi

It is recommended that transaction fees are specified using the fee_per_byte parameter, which will compute your final fee based on the size of the transaction. You can also set a static fee using the fee parameter, but doing so may result in a low fee-per-byte, leading to longer confirmation times.

URI Encoding a JSON object in JavaScript:

var myObject = { address1: 10000, address2: 50000 };
var myJSONString = JSON.stringify(myObject);
// `encodeURIComponent` is a global function
var myURIEncodedJSONString = encodeURIComponent(myJSONString);
// use `myURIEncodedJSONString` as the `recipients` parameter

Sample Response:

{
  "to" : ["1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq", "18fyqiZzndTxdVo7g9ouRogB4uFj86JJiy"],
  "from": ["17p49XUC2fw4Fn53WjZqYAm4APKqhNPEkY"],
  "amounts": [16000, 5400030],
  "fee": 2000,
  "txid": "f322d01ad784e5deeb25464a5781c3b20971c1863679ca506e702e3e33c18e9c",
  "success": true
}

Fetch Wallet Balance

Endpoint: /merchant/:guid/balance

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (required)

Sample Response:

{ "balance": 10000 }

Enable HD Functionality

Endpoint: /merchant/:guid/enableHD

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

This will upgrade a wallet to an HD (Hierarchical Deterministic) Wallet, which allows the use of accounts. See BIP32 for more information on HD wallets and accounts.

List Active HD Accounts

Endpoint: /merchant/:guid/accounts

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

List HD xPubs

Endpoint: /merchant/:guid/accounts/xpubs

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Create New HD Account

Endpoint: /merchant/:guid/accounts/create

Query Parameters:

  • label - label to assign to the newly created account (optional)
  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Get Single HD Account

Endpoint: /merchant/:guid/accounts/:xpub_or_index

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Get HD Account Receiving Address

Endpoint: /merchant/:guid/accounts/:xpub_or_index/receiveAddress

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Check HD Account Balance

Endpoint: /merchant/:guid/accounts/:xpub_or_index/balance

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Archive HD Account

Endpoint: /merchant/:guid/accounts/:xpub_or_index/archive

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Unarchive HD Account

Endpoint: /merchant/:guid/accounts/:xpub_or_index/unarchive

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

List Addresses (deprecated, use the HD API instead)

Endpoint: /merchant/:guid/list

Query Parameters:

  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Sample Response:

{
  "addresses": [
    {
        "balance": 79434360,
        "address": "1A8JiWcwvpY7tAopUkSnGuEYHmzGYfZPiq",
        "label": "My Wallet",
        "total_received": 453300048335
    },
    {
        "balance": 0,
        "address": "17p49XUC2fw4Fn53WjZqYAm4APKqhNPEkY",
        "total_received": 0
    }
  ]
}

Fetch Address Balance (deprecated, use the HD API instead)

Endpoint: /merchant/:guid/address_balance

Query Parameters:

  • address - address to fetch balance for (required)
  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Note: unlike the hosted API, there is no option of a confirmations parameter for specifying minimum confirmations.

Sample Response:

{ "balance": 129043, "address": "19r7jAbPDtfTKQ9VJpvDzFFxCjUJFKesVZ", "total_received": 53645423 }

Generate Address (deprecated, use the HD API instead)

Endpoint: /merchant/:guid/new_address

Query Parameters:

  • password - main wallet password (required)
  • label - label to give to the address (optional)
  • api_code - blockchain.info wallet api code (optional)

Sample Response:

{ "address" : "18fyqiZzndTxdVo7g9ouRogB4uFj86JJiy" , "label":  "My New Address" }

Archive Address (deprecated, use the HD API instead)

Endpoint: /merchant/:guid/archive_address

Query Parameters:

  • address - address to archive (required)
  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Sample Response:

{ "archived" : "18fyqiZzndTxdVo7g9ouRogB4uFj86JJiy" }

Unarchive Address (deprecated, use the HD API instead)

Endpoint: /merchant/:guid/unarchive_address

Query Parameters:

  • address - address to unarchive (required)
  • password - main wallet password (required)
  • api_code - blockchain.info wallet api code (optional)

Sample Response:

{ "active" : "18fyqiZzndTxdVo7g9ouRogB4uFj86JJiy" }

RPC

Bitcoind compatible RPC API. Full documentation available here.

Starting the RPC server:

$ blockchain-wallet-service start-rpc [options]

View additional options and instructions under Usage.

Differences from server API:

  • Option -rpcssl is not supported
  • Method listsinceblock is not supported
  • Param minConfimations is not supported for methods listreceivedbyaccount and listreceivedbyaddress
  • Param minimumConfirmations is not supported for method getbalance
  • Param confirmations is not supported for method listaccounts
  • Responses representing transactions have a different format

Installation

nodejs and npm are required to install and use this API service. Installation:

$ npm install -g blockchain-wallet-service

For the best stability and performance, make sure you are always using the latest version.

To check your version:

$ blockchain-wallet-service -V

To update to the latest version:

$ npm update -g blockchain-wallet-service

Requires:

  • node >= 6.0.0
  • npm >= 3.0.0

If you have issues with the installation process, see the troubleshooting section below.

Troubleshooting

Installation errors:

  • If you are getting EACCESS or permissions-related errors, it might be necessary to run the install as root, using the sudo command.

  • If you are getting errors concerning node-gyp or python, install with npm install --no-optional

Startup errors:

  • If startup fails with /usr/bin/env: node: No such file or directory, it's possible node is not installed, or was installed with a different name (Ubuntu, for example, installs node as nodejs). If node was installed with a different name, create a symlink to your node binary: sudo ln -s /usr/bin/nodejs /usr/bin/node, or install node through Node Version Manager.

Runtime errors:

  • If you are seeing a TypeError claiming that an object has no method 'compare', it is because you are on a version of Node older than 0.12, before the compare method was added to Buffers. Try upgrading to at least Node version 0.12.

  • If you are getting wallet decryption errors despite having correct credentials, then it's possible that you do not have Java installed, which is required by a dependency of the my-wallet-v3 module. Not having Java installed during the npm install process can result in the inability to decrypt wallets. Download the JDK from here for Mac or by running apt-get install default-jdk on debian-based linux systems.

Timeout Errors:

  • If you are getting a timeout response, additional authorization from your blockchain wallet may be required. This can occur when using an unrecognized browser or IP address. An email authorizing the API access attempt will be sent to the registered user that will require action in order to authorize future requests.

If this section did not help, please open a github issue or visit our support center.

Usage

After installing the service, the command blockchain-wallet-service will be available for use.

Options

  • -h, --help - output usage information
  • -V, --version - output the version number
  • -c, --cwd - use the current directory as the wallet service module (development only)

Commands

start

Usage: blockchain-wallet-service start [options]

This command will start the service, making Blockchain Wallet API V2 available on a specified port.

Command options:

  • -h, --help - output usage information
  • -p, --port - port number to run the server on (defaults to 3000)
  • -b, --bind - bind to a specific ip (defaults to 127.0.0.1, note that binding to an ip other than this can lead to security vulnerabilities)
  • --ssl-key - the path to your ssl key (optional)
  • --ssl-cert - the path to your ssl certificate (optional)

To open the service to all incoming connections, bind to 0.0.0.0.

start-rpc

Usage: blockchain-wallet-service start-rpc [options]

This command will start the JSON RPC server.

Options:

  • -k, --key - api code to use for server requests (required option)
  • -p, --rpcport - rpc server port (default: 8000)
  • -b, --bind - bind to a specific ip (defaults to 127.0.0.1, note that binding to an ip other than this can lead to security vulnerabilities)

Get an API code here.

Examples

To start the Wallet API service on port 3000:

$ blockchain-wallet-service start --port 3000

Development

  1. Clone this repo
  2. Run yarn --ignore-engines
  3. Run yarn start
  4. Dev server is now running on port 3000

If you are developing blockchain-wallet-client alongside this module, it is useful to create a symlink to my-wallet-v3:

$ ln -s ../path/to/my-wallet-v3 node_modules/blockchain-wallet-client

Testing

$ yarn test

Configuration

Optional parameters can be configured in a .env file:

  • PORT - port number for running dev server (default: 3000)
  • BIND - ip address to bind the service to (default: 127.0.0.1)

Deployment

If you want to use blockchain-wallet-service in your UNIX production server, you just have to run:

$ nohup blockchain-wallet-service start --port 3000 &

service-my-wallet-v3's People

Contributors

axelay avatar coinables avatar injitools avatar jtormey avatar kimdhamilton avatar kristovatlas avatar mpfluger avatar thore3 avatar vsychov 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  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

service-my-wallet-v3's Issues

Wallet service loses wallet login

Service v0.17.2, Node v0.12.10

The wallet API service was started in the background via nohup, the login call succeeded, and wallet operations were working. At some point (days later), the API started generating errors that the wallet was not logged in. The service process was still running. Performing another login succeeded, and wallet operatoins worked again.

The nohup.out file contained the following (but it's not clear whether this was the cause of the problem):

...
ERR_WALLET_ID
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: listen EADDRINUSE
    at exports._errnoException (util.js:746:11)
    at Server._listen2 (net.js:1158:14)
    at listen (net.js:1184:10)
    at net.js:1282:9
    at dns.js:85:18
    at process._tickCallback (node.js:355:11)
ERR_WALLET_ID
...

sending payment

trying to do a payment I got this

failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error

but work perfectly for login to the wallet

Problem sending to many - 20 recipients

When I try to sendToMany recipients, I get an error like:

Server error response [url] http://127.0.0.1....

The service reports these errors:
Transaction.prototype.sign is deprecated. Use TransactionBuilder instead. Transaction.prototype.signInput is deprecated. Use TransactionBuilder instead.

The error message cuts off after about the 15th recipient, I've tried with both GET and POST, putting the data as query parameters (is there some way I can put the recipients array in the POST body?).

I'm running it on port 3333 but that shouldn't matter.

documentation lacks "GET" and "POST" labels

[https://github.com/blockchain/service-my-wallet-v3#logging-into-a-wallet](Logging into a wallet) doesn't tell you if it's a GET or POST request. It only states that "parameters" should be passed. I'm guessing it's a POST request and the parameters being passed are the "data", right?

Run error

Hi,
I'm trying to run the blockchain wallet service, command:

blockchain-wallet-service start --port 3000

Result error:

[ReferenceError: navigator is not defined]
[ReferenceError: window is not defined]
Error Decrypting Wallet. Please check your password is correct

What's the problem?
Thanks!

Strange responce to balance call

Hi!
We managed to login to alpha wallet, using API key, we get a proper responce. After that, we were trying to get a balance of a alpha wallet, and we got an error answer, attached in .txt document. Is this a bug or are we doing something wrong?
Regards,
M.

error-report.txt

Add timestamps to log output

Service v0.17.2, Node v0.12.10

Debug/log output from the service goes to standard out. When running the service in the background with nohup, standard output is directed to a nohup.out file by default (or can be redirected). Any generated output (debug messages, stack traces, etc) has no timestamp, so it's hard to reference when an event occurred.

Installation error

I'm using this command:

$ npm install -g https://github.com/blockchain/service-my-wallet-v3.git

Error:

npm http GET https://github.com/blockchain/service-my-wallet-v3.git
npm http 200 https://github.com/blockchain/service-my-wallet-v3.git
npm ERR! not a package /home/user/tmp/npm-8114-XR3gqie4/1451382256747-0.5445718949194998/tmp.tgz
npm ERR! Error: ENOENT, open '/home/user/tmp/npm-8114-XR3gqie4/1451382256747-0.5445718949194998/package/package.json'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Linux 3.13.0-57-generic
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "https://github.com/blockchain/service-my-wallet-v3.git"
npm ERR! cwd /home/user
npm ERR! node -v v0.10.25
npm ERR! npm -v 1.3.10
npm ERR! path /home/user/tmp/npm-8114-XR3gqie4/1451382256747-0.5445718949194998/package/package.json
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /home/user/npm-debug.log
npm ERR! not ok code 0

What the problem?
Thanks

Crashes and lockup when blockchain.info returns a 522

Hello,

we use the blockchain API to provide wallets for our customers on our exchange service, so we are running a fairly busy node. We have found some issues with random crashes, and also a lock issue when blockchain.info returns a 522 error.

We are running version 0.12, and have altered the cli.js file to make the application compatible with the forever node module (provides automatic restart after a crash), and also to add improved logging.

Please see the attached log below

[2016-01-07 00:52:11] Server Time offset 63.875ms - This offset 96
[2016-01-07 01:32:32] Server Time offset 24.75ms - This offset 24.75
[2016-01-07 01:32:32] Server Time offset 47.875ms - This offset 71
[2016-01-07 01:42:22] Server Time offset 23ms - This offset 23
[2016-01-07 01:42:22] Server Time offset 46.5ms - This offset 70
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: unexpected server response (521)
    at ClientRequest.response (/usr/lib/node_modules/blockchain-wallet-service/node_modules/blockchain-wallet-client-prebuilt/node_modules/ws/lib/WebSocket.js:694:15)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:415:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
    at TLSSocket.socketOnData (_http_client.js:305:20)
    at emitOne (events.js:77:13)
    at TLSSocket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at TLSSocket.Readable.push (_stream_readable.js:110:10)
    at TLSWrap.onread (net.js:523:20)
error: Forever detected script exited with code: 1
error: Script restart attempt #1
[2016-01-07 01:56:20] blockchain.info wallet service running on 127.0.0.1:3000
[2016-01-07 07:25:27] Server Time offset 36.75ms - This offset 36.75
[2016-01-07 07:25:27] Server Time offset 60.375ms - This offset 84
[2016-01-07 09:12:53] Server Time offset 24.75ms - This offset 24.75
[2016-01-07 09:12:54] Server Time offset 25.375ms - This offset 26

(parts of the log removed to increase readability)

[2016-01-14 09:48:11] Server Time offset 69.125ms - This offset 91.75
[2016-01-14 09:48:11] Server Time offset 81.3125ms - This offset 93.75
[2016-01-14 10:13:49] Server Time offset 51.75ms - This offset 51.75
[2016-01-14 10:13:49] Server Time offset 39.375ms - This offset 27
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: zlib binding closed
    at DeflateRaw.Zlib._transform (zlib.js:484:15)
    at DeflateRaw.Transform._read (_stream_transform.js:167:10)
    at DeflateRaw.Transform._write (_stream_transform.js:155:12)
    at doWrite (_stream_writable.js:292:12)
    at clearBuffer (_stream_writable.js:396:7)
    at onwrite (_stream_writable.js:331:7)
    at WritableState.onwrite (_stream_writable.js:89:5)
    at afterTransform (_stream_transform.js:79:5)
    at TransformState.afterTransform (_stream_transform.js:54:12)
    at Zlib.callback (zlib.js:613:5)
error: Forever detected script exited with code: 1
error: Script restart attempt #2
[2016-01-14 10:44:58] blockchain.info wallet service running on 127.0.0.1:3000
[2016-01-14 10:55:44] Server Time offset 39.5ms - This offset 39.5
[2016-01-14 10:55:45] Server Time offset 32.125ms - This offset 24.75
[2016-01-14 11:32:58] Server Time offset 27.75ms - This offset 27.75

(parts of the log removed to increase readability)

[2016-01-15 21:58:55] Server Time offset 39.75ms - This offset 39.75
[2016-01-15 21:58:56] Server Time offset 81.375ms - This offset 123
[2016-01-16 05:46:34] Server Time offset 28.75ms - This offset 28.75
[2016-01-16 05:46:34] Server Time offset 26.875ms - This offset 25
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: unexpected server response (522)
    at ClientRequest.response (/usr/lib/node_modules/blockchain-wallet-service/node_modules/blockchain-wallet-client-prebuilt/node_modules/ws/lib/WebSocket.js:694:15)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:415:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
    at TLSSocket.socketOnData (_http_client.js:305:20)
    at emitOne (events.js:77:13)
    at TLSSocket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at TLSSocket.Readable.push (_stream_readable.js:110:10)
    at TLSWrap.onread (net.js:523:20)
error: Forever detected script exited with code: 1
error: Script restart attempt #3
[2016-01-16 08:06:02] blockchain.info wallet service running on 127.0.0.1:3000
[2016-01-16 09:04:29] Server Time offset 40.75ms - This offset 40.75
[2016-01-16 09:04:29] Error Decrypting Wallet. Please check your password is correct.
[2016-01-16 09:04:58] Server Time offset 27.75ms - This offset 27.75

(parts of the log removed to increase readability)

[2016-01-18 09:11:04] Server Time offset 89.9375ms - This offset 79
[2016-01-18 09:11:04] Server Time offset 90.4375ms - This offset 89
[2016-01-18 09:17:11] Server Time offset 65.75ms - This offset 81
[2016-01-18 09:17:11] Server Time offset 78.4375ms - This offset 93
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: unexpected server response (522)
    at ClientRequest.response (/usr/lib/node_modules/blockchain-wallet-service/node_modules/blockchain-wallet-client-prebuilt/node_modules/ws/lib/WebSocket.js:694:15)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:415:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
    at TLSSocket.socketOnData (_http_client.js:305:20)
    at emitOne (events.js:77:13)
    at TLSSocket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at TLSSocket.Readable.push (_stream_readable.js:110:10)
    at TLSWrap.onread (net.js:523:20)
error: Forever detected script exited with code: 1
error: Script restart attempt #4
[2016-01-18 09:20:47] blockchain.info wallet service running on 127.0.0.1:3000
[2016-01-18 09:41:14] <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>


<meta http-equiv="set-cookie" content="cf_use_ob=0; expires=Mon, 18-Jan-16 08:41:44 GMT; path=/">


<title>blockchain.info | 522: Connection timed out</title>


(parts of the log removed to increase readability)

</div><!-- /#cf-wrapper -->

[2016-01-18 09:41:50] ERR_LOGIN_BUSY
[2016-01-18 09:41:56] ERR_LOGIN_BUSY
[2016-01-18 09:42:00] ERR_LOGIN_BUSY
[2016-01-18 09:42:02] ERR_LOGIN_BUSY
[2016-01-18 09:42:06] ERR_LOGIN_BUSY
[2016-01-18 09:42:10] ERR_LOGIN_BUSY
[2016-01-18 09:42:30] ERR_LOGIN_BUSY
[2016-01-18 09:42:39] ERR_LOGIN_BUSY
[2016-01-18 09:42:47] ERR_LOGIN_BUSY
[2016-01-18 09:42:48] ERR_LOGIN_BUSY
[2016-01-18 09:42:52] ERR_LOGIN_BUSY
[2016-01-18 09:42:54] ERR_LOGIN_BUSY
[2016-01-18 09:42:57] ERR_LOGIN_BUSY
[2016-01-18 09:42:58] ERR_LOGIN_BUSY
[2016-01-18 09:43:05] ERR_LOGIN_BUSY
[2016-01-18 09:43:17] ERR_LOGIN_BUSY
[2016-01-18 09:43:20] ERR_LOGIN_BUSY
[2016-01-18 09:43:26] ERR_LOGIN_BUSY
[2016-01-18 09:43:26] ERR_LOGIN_BUSY
[2016-01-18 09:43:34] ERR_LOGIN_BUSY
[2016-01-18 09:43:42] ERR_LOGIN_BUSY
[2016-01-18 09:43:45] ERR_LOGIN_BUSY
[2016-01-18 09:43:50] ERR_LOGIN_BUSY
[2016-01-18 09:43:55] ERR_LOGIN_BUSY
[2016-01-18 09:43:57] ERR_LOGIN_BUSY
[2016-01-18 09:43:58] ERR_LOGIN_BUSY
[2016-01-18 09:43:59] ERR_LOGIN_BUSY
[2016-01-18 09:43:59] ERR_LOGIN_BUSY
[2016-01-18 09:44:00] ERR_LOGIN_BUSY
[2016-01-18 09:44:07] ERR_LOGIN_BUSY


(parts of the log removed to increase readability)

[2016-01-18 14:01:41] ERR_LOGIN_BUSY
[2016-01-18 14:01:46] ERR_LOGIN_BUSY
[2016-01-18 14:02:01] ERR_LOGIN_BUSY
[2016-01-18 14:02:14] ERR_LOGIN_BUSY
[2016-01-18 14:04:43] ERR_LOGIN_BUSY
[2016-01-18 14:04:50] ERR_LOGIN_BUSY
[2016-01-18 14:07:31] ERR_LOGIN_BUSY
(here we manually restarted the service)
[2016-01-18 14:08:29] blockchain.info wallet service running on 127.0.0.1:3000
[2016-01-18 14:09:14] Server Time offset 38.75ms - This offset 38.75
[2016-01-18 14:09:15] Server Time offset 79.875ms - This offset 121
[2016-01-18 14:18:13] Server Time offset 21ms - This offset 21

(parts of the log removed to increase readability)

[2016-01-18 15:22:38] Error Decrypting Wallet. Please check your password is correct.
[2016-01-18 15:22:44] Server Time offset 31ms - This offset 31
[2016-01-18 15:22:44] Error Decrypting Wallet. Please check your password is correct.
[2016-01-18 15:22:49] Server Time offset 25ms - This offset 25
[2016-01-18 15:22:49] Error Decrypting Wallet. Please check your password is correct.
events.js:141
      throw er; // Unhandled 'error' event
      ^

Error: unexpected server response (522)
    at ClientRequest.response (/usr/lib/node_modules/blockchain-wallet-service/node_modules/blockchain-wallet-client-prebuilt/node_modules/ws/lib/WebSocket.js:694:15)
    at ClientRequest.g (events.js:260:16)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:415:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
    at TLSSocket.socketOnData (_http_client.js:305:20)
    at emitOne (events.js:77:13)
    at TLSSocket.emit (events.js:169:7)
    at readableAddChunk (_stream_readable.js:146:16)
    at TLSSocket.Readable.push (_stream_readable.js:110:10)
    at TLSWrap.onread (net.js:523:20)
error: Forever detected script exited with code: 1
error: Script restart attempt #1
[2016-01-18 15:31:03] blockchain.info wallet service running on 127.0.0.1:3000
[2016-01-18 15:31:50] <!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en-US"> <![endif]-->
<!--[if IE 7]>    <html class="no-js ie7 oldie" lang="en-US"> <![endif]-->
<!--[if IE 8]>    <html class="no-js ie8 oldie" lang="en-US"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en-US"> <!--<![endif]-->
<head>


<meta http-equiv="set-cookie" content="cf_use_ob=0; expires=Mon, 18-Jan-16 14:32:20 GMT; path=/">


<title>blockchain.info | 522: Connection timed out</title>

(parts of the log removed to increase readability)

</div><!-- /#cf-wrapper -->

[2016-01-18 15:33:34] ERR_LOGIN_BUSY
[2016-01-18 15:33:46] ERR_LOGIN_BUSY
[2016-01-18 15:33:49] ERR_LOGIN_BUSY
[2016-01-18 15:34:04] ERR_LOGIN_BUSY
[2016-01-18 15:35:55] ERR_LOGIN_BUSY
(here we manually restarted the service)
[2016-01-18 15:36:02] blockchain.info wallet service running on 127.0.0.1:3000
[2016-01-18 15:36:39] <!DOCTYPE HTML>
<html lang="en-US">
<head>
  <meta charset="UTF-8" />
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1" />
  <meta name="robots" content="noindex, nofollow" />
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1" />
  <title>Just a moment...</title>


(parts of the log removed to increase readability)

            Ray ID: 266b088a88f005bb
          </div>
      </td>
    </tr>
  </table>
</body>
</html>

[2016-01-18 15:38:00] ERR_LOGIN_BUSY
[2016-01-18 15:38:01] ERR_LOGIN_BUSY
[2016-01-18 15:38:38] ERR_LOGIN_BUSY
[2016-01-18 15:44:31] ERR_LOGIN_BUSY
(here we manually restarted the service)
[2016-01-18 15:48:53] blockchain.info wallet service running on 127.0.0.1:3000
[2016-01-18 15:50:34] Server Time offset 42.75ms - This offset 42.75
[2016-01-18 15:50:34] Server Time offset 64.75ms - This offset 86.75

Please tag release versions and create a develop branch

Service v0.17.2, Node v0.12.10

Some suggestions for making it easier to follow development of this project:

  • Tag release versions in the master branch. I am running Wallet API v0.17.2 (installed via npm). The code here is newer, but I'm not sure what has changed since this release, nor what is in the next release versus ongoing development. Tags make it easier to refer to documentation/issues/code of the version I have and see what has changed.
  • Develop in a develop branch. Merge to master (and tag) when a stable version is ready. This clarifies what is a work-in-progress versus stable code. This also allows patches/hotfixes to be made to the last tagged version even if the work-in-progress (develop) code is not yet ready for release.

Misleading documentation / inconsistency with API v1

Your wallet API v1 docs page (which you actually refer to in README) suggests that this service is a drop-in replacement for backwards compatiblity. In reality - sendmany endpoint returns completely different JSON object than API v1 (txid vs tx_hash, success boolean instead of message) making previous API clients unusable.

TypeError: Object �|Z���K�ս��r0��̔X��5��8H`� has no method 'compare'

after login, when i call the balance api, i got this error.

myserver# blockchain-wallet-service start -p 3000
blockchain.info wallet service running on 127.0.0.1:3000
Server Time offset -10359.25ms - This offset -10359.25
Server Time offset -10361.125ms - This offset -10363

TypeError: Object �|Z���K�ս��r0��̔X��5��8H`� has no method 'compare'
at validatePassword (/usr/lib/node_modules/service-my-wallet-v3/src/wallet-cache.js:33:64)
at WalletCache.getWallet (/usr/lib/node_modules/service-my-wallet-v3/src/wallet-cache.js:57:17)
at WalletCache.login (/usr/lib/node_modules/service-my-wallet-v3/src/wallet-cache.js:47:8)
at MerchantAPI.login (/usr/lib/node_modules/service-my-wallet-v3/src/api.js:11:16)
at /usr/lib/node_modules/service-my-wallet-v3/src/server.js:96:32
at Layer.handle as handle_request
at next (/usr/lib/node_modules/service-my-wallet-v3/node_modules/express/lib/router/route.js:131:13)
at /usr/lib/node_modules/service-my-wallet-v3/src/server.js:109:5
at Layer.handle as handle_request
at next (/usr/lib/node_modules/service-my-wallet-v3/node_modules/express/lib/router/route.js:131:13)
at Route.dispatch (/usr/lib/node_modules/service-my-wallet-v3/node_modules/express/lib/router/route.js:112:3)
at Layer.handle as handle_request
at /usr/lib/node_modules/service-my-wallet-v3/node_modules/express/lib/router/index.js:277:22
at param (/usr/lib/node_modules/service-my-wallet-v3/node_modules/express/lib/router/index.js:349:14)
at param (/usr/lib/node_modules/service-my-wallet-v3/node_modules/express/lib/router/index.js:365:14)
at Function.process_params (/usr/lib/node_modules/service-my-wallet-v3/node_modules/express/lib/router/index.js:410:3)

Document service upgrade process

Service v0.17.2, Node v0.12.10

Please document the process to safely upgrade the service to the latest version (e.g., via npm). Are there production vs. development releases?

All requests for API keys are ignored

I've applied twice to get API keys and never received any reply after weeks.
What this service is for, if admins ignore API requests?
I am a blockchain.info user and want to automate payments to my contacts. When filling API request, I am asked for a 'website' and 'description of service', where I enter localhost and 'private'. There is nothing else to write? It's for internal use, not an Internet facing service. But my application is always going to the void.

ERR_TIMEOUT when trying to log in

blockchain-wallet-service start --port 3000 &

blockchain.info wallet service v0.15.0 running on 127.0.0.1:3000

wget -O- "http://localhost:3000/merchant/MYGUID/login?password=MYPASSWORD&api_code=MYAPICODE"

returns

Resolving localhost (localhost)... 127.0.0.1, ::1
Connecting to localhost (localhost)|127.0.0.1|:3000... connected.
HTTP request sent, awaiting response... ERR_TIMEOUT
500 Internal Server Error
2016-02-17 11:19:36 ERROR 500: Internal Server Error.

running on Debian Wheezy with nodejs from backports (0.10.29dfsg-1bpo70+1)

How to Start blockchain server in Windows

I am trying to start blockchain-wallet-service in windows machine. Please let me know where I can run command blockchain-wallet-service start --port 3000 in window ?? On Command prompt this command is not working. plz help

Balance not updating correctly

Hi there,

It seems that the /balance method is not updating Bitcoin balance correctly after you have performed /payment.

The only way to get it to update the balance properly is to perform /login again. But currently there is an issue where the service crashed if you try to login if you are already logged in.

This is the exit error message when I am trying to perform /payment if you are logged in twice:

/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/node_modules/hyperquest/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_writable.js:207
  if (state.ended)
           ^
TypeError: Cannot read property 'ended' of undefined
    at DuplexWrapper.Writable.write (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/node_modules/hyperquest/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_writable.js:207:12)
    at DuplexWrapper.Writable.end (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/node_modules/hyperquest/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_writable.js:426:10)
    at API.request (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/api.js:91:30)
    at API.retry (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/api.js:118:12)
    at API.getHistory (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/api.js:207:15)
    at Wallet.getHistory (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/blockchain-wallet.js:391:21)
    at WebSocket.onMessage (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/wallet.js:236:23)
    at WebSocket.emit (events.js:110:17)
    at Receiver.ontext (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/node_modules/ws/lib/WebSocket.js:816:10)
    at /usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/node_modules/ws/lib/Receiver.js:477:18
    at /usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/node_modules/ws/lib/Receiver.js:361:7
    at /usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/node_modules/ws/lib/PerMessageDeflate.js:238:5
    at afterWrite (_stream_writable.js:361:3)
    at onwrite (_stream_writable.js:352:7)
    at WritableState.onwrite (_stream_writable.js:105:5)
    at afterTransform (_stream_transform.js:99:5)

Use of API key

can i use the api key approved for other domain into local system testing, because i am working in my local system and it is unix

i have started service successfully, and need to login into my wallet

Bug with readable-stream?

Hi,
I have installed service-my-wallet-v3 on CentOs. When I start it and call the API, the first call works well with this output:

[ReferenceError: navigator is not defined]
[ReferenceError: window is not defined]
Transaction.prototype.sign is deprecated.  Use TransactionBuilder instead.
Transaction.prototype.signInput is deprecated.  Use TransactionBuilder instead.
published

But for the second call I get this output and the server is terminated:

/usr/lib/node_modules/service-my-wallet-v3/node_modules/readable-stream/lib/_stream_writable.js:202
    encoding = state.defaultEncoding;
                    ^
TypeError: Cannot read property 'defaultEncoding' of undefined
    at DuplexWrapper.Writable.write (/usr/lib/node_modules/service-my-wallet-v3/node_modules/readable-stream/lib/_stream_writable.js:202:21)
    at DuplexWrapper.Writable.end (/usr/lib/node_modules/service-my-wallet-v3/node_modules/readable-stream/lib/_stream_writable.js:426:10)
    at API.request (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/api.js:91:30)
    at API.retry (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/api.js:118:12)
    at API.getHistory (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/api.js:207:15)
    at Wallet.getHistory (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/blockchain-wallet.js:391:21)
    at WebSocket.onMessage (/usr/lib/node_modules/service-my-wallet-v3/node_modules/blockchain-wallet-client/src/wallet.js:236:23)
    at WebSocket.emit (events.js:98:17)
    at Receiver.ontext (/usr/lib/node_modules/service-my-wallet-v3/node_modules/ws/lib/WebSocket.js:816:10)
    at /usr/lib/node_modules/service-my-wallet-v3/node_modules/ws/lib/Receiver.js:477:18
    at /usr/lib/node_modules/service-my-wallet-v3/node_modules/ws/lib/Receiver.js:361:7
    at /usr/lib/node_modules/service-my-wallet-v3/node_modules/ws/lib/PerMessageDeflate.js:238:5
    at afterWrite (_stream_writable.js:278:3)
    at onwrite (_stream_writable.js:270:7)
    at WritableState.onwrite (_stream_writable.js:97:5)
    at afterTransform (_stream_transform.js:99:5)

I this a bug or I should do something?

Kindly please make a stable API

Service v0.17.1, Node v5.5

Hi, I'm just making this issue to release my frustration with the state of "New Blockchain" and culture of Javascript in general. I've been running this service for the past couple of weeks (the time of my last ticket). Then suddenly, today at around 2 GMT this service started failing and throwing ERR_WALLET_ID on stdout and simple container rebuilt / package update to latest version fixed the problem. I suppose it was some sort of incompatiblity between your backend server and service client library, but... kindly please... keep stuff at least backwards compatible for a month or so...

Better Documentation/Explanations on HD Operations

Some examples:

  • It's unclear if the Receiving Address changes/updates when funds are received (i.e to automatically prevent address re-use).
  • What do the responses for all the HD requests look like?

It seems that any new applications should be making use of the HD wallet + account features, as that is the future, but currently it's creating more work for developers to have to debug and reverse-engineer request/responses manually.

Timeout when second login is requested

Hello,

I have installed and started the service successfully. After start, when I send a login request (/merchant/:guid/login) its works fine. But if I send a new login request for a other guid, not works, after a time the service returns a timeout error:
{"error":"Call to /login timed out, please try again"}

and in the command prompt appears "ERR_TIMEOUT"

Can anyone help me?

I can't login to the wallet

this what I'm getting when I try to connect

{
error: "Already trying to login to a wallet. To change wallets, try again in a moment"
}

on console I got this
ERR_LOGIN_BUSY

Timeout when connecting to to Wallet Service

I am running the service on Debian Jessie. and Node v5.7.0

I have tried connecting via wget and via file_get_contents. Both methods time out.

wget outputs:
Connecting to localhost (localhost)|::1|:3000... failed: Connection refused.
Connecting to localhost (localhost)|127.0.0.1|:3000... connected.
HTTP request sent, awaiting response... 500 Internal Server Error
2016-02-28 07:11:44 ERROR 500: Internal Server Error.

Node console outputs:
ERR_TIMEOUT

It seems unrelated to the other tickets with the same issue as my node version is up to date.

Install issue

I'have error during installation:

ubuntu 14.04 with latest updates.

root@b:/# npm -v
3.6.0
root@b:/# node -v
v0.12.9
root@b:/# npm install -g blockchain-wallet-service
/usr/bin/blockchain-wallet-service -> /usr/lib/node_modules/blockchain-wallet-service/bin/cli.js
/usr/lib
└─┬ [email protected]
├─┬ [email protected]
│ └── [email protected]
└─┬ [email protected]
├── UNMET PEER DEPENDENCY continuation-local-storage@~3
└─┬ [email protected]
├─┬ [email protected]
│ └─┬ [email protected]
│ └── [email protected]
└── [email protected]

npm WARN [email protected] requires a peer of continuation-local-storage@~3 but none was installed.
root@b:/#

Can you advice, how to fix the issue?

Request 'status' and 'stop' service entry points

Service v0.17.2, Node v0.12.10

Augment cli.js with status and stop entry points. Status reports whether a service instance is currently running. Stop performs a clean shutdown of a running service instance.

These calls would be useful for integration with typical OS service start/stop scripts (e.g., to start the service on boot and stop cleanly on shutdown). Status is useful in monitoring (e.g., to perform automated restart upon unexpected shutdown).

Service dies on network / protocol issues

Service v0.18.1, Node v0.12.5

As stated in subject - service shouldn't die completely when connection with upstream websocket server is disrupted.

These are last stdout / stderr messages I got. After that process exited with status 1.

events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: unexpected server response (521)
    at ClientRequest.response (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/blockchain-wallet-client-prebuilt/node_modules/ws/lib/WebSocket.js:694:15)
    at ClientRequest.g (events.js:273:16)
    at emitOne (events.js:90:13)
    at ClientRequest.emit (events.js:182:7)
    at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:425:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:88:23)
    at TLSSocket.socketOnData (_http_client.js:315:20)
    at emitOne (events.js:90:13)
    at TLSSocket.emit (events.js:182:7)
    at readableAddChunk (_stream_readable.js:147:16)
    at TLSSocket.Readable.push (_stream_readable.js:111:10)
    at TLSWrap.onread (net.js:523:20)

ERR_TIMEOUT when trying access localhost:3000

Hi there, I seems to have an issue with blockchain installation on a specific server.
on command wgte -O- 'http://localhost:3000/merchant//login?password=&second_password=&api_code=<api_code>' -S

my server is Ubuntu 14.10, using Node v5.6.0, service wallet Service v0.18.1

I always gets the ERR_TIMEOUT on login.

Resolving localhost (localhost)... 127.0.0.1
Connecting to localhost (localhost)|127.0.0.1|:3000... connected.
HTTP request sent, awaiting response...
HTTP/1.1 500 Internal Server Error
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 54
ETag: W/"36-v7XDKMlQr2iDBgxMVphxsQ"
Date: Thu, 03 Mar 2016 06:31:54 GMT
Connection: keep-alive
2016-03-03 17:31:54 ERROR 500: Internal Server Error.

using curl will result the following:

Hostname was NOT found in DNS cache
Trying 127.0.0.1...
Connected to localhost (127.0.0.1) port 3000 (#0)
GET /merchant//login?password=&api_code=<api_code> HTTP/1.1
User-Agent: curl/7.37.1
Host: localhost:3000
Accept: /

HTTP/1.1 500 Internal Server Error
X-Powered-By: Express
Content-Type: application/json; charset=utf-8
Content-Length: 210
ETag: W/"d2-V9XisWlAb+M1EPq/DirdsA"
Date: Thu, 03 Mar 2016 06:48:04 GMT
Connection: keep-alive

Connection #0 to host localhost left intact
{"error":"Wallets that require email authorization are currently not supported in the Wallet API. Please disable this in your wallet settings, or add the IP address of this server to your wallet IP whitelist."}

is there something I missed ?

Cheers

Payment Error. Missing coins to spend

Trying to do a payment I always get:

{"error":"Missing coins to spend"}

In the wallet console I get this:
No free outputs to spend
Missing coins to spend
Missing coins to spend

The wallet balance is 0.00020133
The amount I want to transfer is 0.0001

Maybe there is a minimum amount to send?

Ubuntu server requires nodejs symlink after install

Problem: In Ubuntu server 14.04, sudo apt-get install nodejs installs the executable as /usr/bin/nodejs. Running blockchain-wallet-service start --port 3000 results in /usr/bin/env: node: No such file or directory (it expects the executable to be /usr/bin/node).

Fix: After installing nodejs, create this symlink: sudo ln -s /usr/bin/nodejs /usr/bin/node and the wallet service can start as expected.

Please add this step to the installation instructions (or make sure the nodejs executable can be found at /usr/bin/nodejs on Ubuntu).

V2 is a very bad idea

Hi,

First of all congrats on a great initial API.

I'm really interested on why on earth would you require a REST API to install a local service. The reasons are really beyond me.

My production environment isn't built around node.js. I don't want to install node.js, I don't want to run your local service. HTTP calls wore more than enough.

Please shed some light on this ridiculously architecture change

Kind regards,
Narcis

Very hard time on Windows - still not working...

Hi!

First of all – I like your idea, I like blockchain wallets and your services, especially the API (the “old” one).
This new APIS is a nightmare for Windows / .net developers.
Sounds so easy and ends up in frustrating hours…
Did not use node.js – so I installed that
Got an error on npm, missing GIT – so I installed that as well
Took some time to fix the path problem – next error on node-gyp
So I installed Python as well…
And now I end up with an error telling me that there is a problem with the blockchain-wallet-client package (see trace output below / file attached).

Guys, that is really frustrating – I am a professional developer for years, yes I am mainly on Windows, and yes I do understand that the bitcoin world is not focusing Windows that much…

I really hope that you come back asap, and that you can help.
Additionally the documentation on your website is confusing as well. So I do not understand why you change the API model in that way. The expiring API really was fine.

Anyhow, thanks for your support. By that, I am running Windows 10, Visual Studio Enterprise 2015 (I did not have problems with Python / node-gyp, after installing Python version 2.7.10)

Joachim

14371 error [email protected] postinstall: cd node_modules/sjcl || cd ../sjcl && ./configure --with-sha1 && make
14371 error Exit status 1
14372 error Failed at the [email protected] postinstall script 'cd node_modules/sjcl || cd ../sjcl && ./configure --with-sha1 && make'.
14372 error Make sure you have the latest version of node.js and npm installed.
14372 error If you do, this is most likely a problem with the blockchain-wallet-client package,
14372 error not with npm itself.
14372 error Tell the author that this fails on your system:
14372 error cd node_modules/sjcl || cd ../sjcl && ./configure --with-sha1 && make
14372 error You can get information on how to open an issue for this project with:
14372 error npm bugs blockchain-wallet-client
npm-debug.zip

Response incorrect

  1. Make the request to receive the balance from the wallet, I receive {"balance":0} , but there is money.
  2. Make the request to receive the balance from the address, I receive {"balance":null,"address":"XXaddressXX","total_received":null} , but there is money.

Why is this happening?

Remote server

Hi,

I am unable to run this service on a remote machine. In a distributed environment with several PHP servers, it is inconceivable to install this on every machine (no matter how simple/small this is).

Has anybody got this working? I can easily telnet from the local machine where the service is installed but I cannot do this remotely. There is no active firewall, ports are open and the setup is standard: Ubuntu server to run the service.

No matter what port I try, I always get a "Failed to connect" message.

Thanks for your time

a.

crash when login twice

Hi,

When my app try to login but it's already logged in, it crashes:

events.js:142
      throw er; // Unhandled 'error' event
      ^

Error: socket hang up
    at createHangUpError (_http_client.js:210:15)
    at TLSSocket.socketOnEnd (_http_client.js:295:23)
    at emitNone (events.js:73:20)
    at TLSSocket.emit (events.js:167:7)
    at endReadableNT (_stream_readable.js:906:12)
    at nextTickCallbackWith2Args (node.js:455:9)
    at process._tickCallback (node.js:369:17)

Is this expected behaviour? Is there any method to check if we already logged in, to prevent calling the login request again.

Thanks

I've to install node.js?

Our website is in .NET, and hosted in Windows Server of course.
So, to install this API, I've to install Node.js to our server?

Does not work option "confirmations"

Hi,
Does not work option "confirmations" in the method "/merchant/:guid/address_balance".
I write 3 confirm this method, He return the transaction with 0 confirmations!
Can fix it?

unexpected server response (522)

Hello, my services working fine, but now he was stopped, in the console I see the error below:

events.js:85 throw er; // Unhandled 'error' event ^ Error: unexpected server response (522) at ClientRequest.response (/usr/lib/node_modules/blockchain-wallet-service/node_modules/blockchain-wallet-client-prebuilt/node_modules/ws/lib/WebSocket.js:694:15) at ClientRequest.g (events.js:199:16) at ClientRequest.emit (events.js:107:17) at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:426:21) at HTTPParser.parserOnHeadersComplete (_http_common.js:111:23) at TLSSocket.socketOnData (_http_client.js:317:20) at TLSSocket.emit (events.js:107:17) at readableAddChunk (_stream_readable.js:163:16) at TLSSocket.Readable.push (_stream_readable.js:126:10) at TCP.onread (net.js:540:20)

Error when including note in outgoing payment

Hi,

When I include note query parameter in outgoing payment I get this error:
"[TypeError: Object �o'X�@���st1/��O�v�<2F&�� has no method 'compare']"

I know that note can only be attached when outputs are greater than 0.005 BTC so I'm trying to send more than that. If I remove note query parameter everything works fine.

Can you please help?
Thanks

error: Missing coins to spend

Service v0.19.0, Node v0.12.5

When I try make a transfer and the account has no enough sufficent funds, the API response is:

"error":"Unexpected error, please try again".

By the way, in the log console is printed "error: Missing coins to spend"

I think the console print response should be returned in API response, cause the API response is generic and I can't show the apropriate response to the user.

Always getting errors

"If you are already using our Wallet API, getting started with V2 is as easy as installing the new client service, starting it up, and directing your existing API calls to localhost rather than to blockchain.info."
I can't even install it.
I'm installed npm. Called "npm install -g https://github.com/blockchain/service-my-wallet-v3.git"
Error - no git.
Okay, installed git.
Error - no git.
Okay, changed PATH.
Now it's asking python.

Why, guys? Why I can't just use http get requests? Why there is no just instalation for your new service? Why I have to install tons of things, that I don't need, to use your API?
I don't even know will it works after installing python or will ask something else.
I just sitting here, searching this packages, searching solutions for this errors.
Why you can't just give to users decide which API they want to use.
"Most importantly, the legacy version of our API will be deprecated at the end of the year as part of planned upgrade."
I received e-mail about in in 16 December.
And now I have 2 days to change my app to use your new API.
There is New Year, holidays, and I'm sitting here with this errors...
And why you said that it's easy, just install it?

Most API calls crash by `generatePwHash(maybePw).compare(hash)`

The /login call worked. Then calling /list crashed:

TypeError: Object B� \��?��}�K�(
{�fn�_����ZA �q�P has no method 'compare'
   at validatePassword (/usr/local/lib/node_modules/blockchain-wallet-service/src/wallet-cache.js:128:34)
   at WalletCache.getWallet (/usr/local/lib/node_modules/blockchain-wallet-service/src/wallet-cache.js:98:17)
   at MerchantAPI.getWallet (/usr/local/lib/node_modules/blockchain-wallet-service/src/api.js:15:21)
   at MerchantAPI.listAddresses (/usr/local/lib/node_modules/blockchain-wallet-service/src/api.js:31:15)
   at /usr/local/lib/node_modules/blockchain-wallet-service/src/server.js:176:32
   at Layer.handle [as handle_request] (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/layer.js:95:5)
   at next (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/route.js:131:13)
   at /usr/local/lib/node_modules/blockchain-wallet-service/src/server.js:189:5
   at Layer.handle [as handle_request] (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/layer.js:95:5)
   at next (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/route.js:131:13)
   at Route.dispatch (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/route.js:112:3)
   at Layer.handle [as handle_request] (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/layer.js:95:5)
   at /usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:277:22
   at Function.process_params (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:330:12)
   at next (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:271:10)
   at /usr/local/lib/node_modules/blockchain-wallet-service/src/server.js:201:5
   at Layer.handle [as handle_request] (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/layer.js:95:5)
   at trim_prefix (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:312:13)
   at /usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:280:7
   at Function.process_params (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:330:12)
   at next (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:271:10)
   at urlencodedParser (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/body-parser/lib/types/urlencoded.js:88:40)
   at Layer.handle [as handle_request] (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/layer.js:95:5)
   at trim_prefix (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:312:13)
   at /usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:280:7
   at Function.process_params (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:330:12)
   at next (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/express/lib/router/index.js:271:10)
   at jsonParser (/usr/local/lib/node_modules/blockchain-wallet-service/node_modules/body-parser/lib/types/json.js:100:40) 
function generatePwHash(pw) {
  var iterations = 5000;
  return crypto.pbkdf2Sync(pw, randomBytes, iterations, BYTES_PER_HASH, 'sha256');
}

function validatePassword(hash, maybePw) {
  if (!Buffer.isBuffer(hash) || !maybePw) return false;
  return generatePwHash(maybePw).compare(hash) === 0;
}

This is on Ubuntu Server 14.04 following the install instructions (including the default-jdk). Whatever object is returned from crypto.pbkdf2Sync has no compare method.

Calling /balance has the same result. Password is definitely correct (using a bogus password generates the same result).

Two factor authentication currently not enabled in the Merchant API

Service v0.19.0, Node v0.12.5

Hi, I have a account with two factor authentication, and before update to v.19, I had normal access to this account.

Now when I try access this account I get this error:
"Two factor authentication currently not enabled in the Merchant API"
"ERR_2FA" (In the console)

There are someway to access this account?

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.