Welcome to the Dash Forum!

Please sign up to discuss the most innovative cryptocurrency!

Testnet: Official Release of Bitcore Libraries and Insight API

Discussion in 'General Discussion' started by snogcel, Sep 29, 2016.

  1. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
    On behalf of the Evolution and Core development teams I'm pleased to announce the release of Bitcore-Dash and Insight API for public testing.

    What is Bitcore?

    Bitcore was released by BitPay in February 2014 and was designed to power blockchain applications and open-sourced to spur blockchain innovation. This project provides a collection of libraries that can be used for either server-side or client-side development, more information about Bitcore is available at www.bitcore.io.

    What is Bitcore-Dash?

    Bitcore-Dash is an example of a naming convention which applies "-dash" to any component of the Bitcore Stack that has been prepared for usage on the dash network. This set of libraries is intended to be the Dash equivalent of Bitcore and is secured by the blockchain-funded X11 hashing library which was completed over the summer.

    Important Notes:

    Please note that Bitcore-Dash requires Dash Core v0.12.1.x. This release has been timed to coincide with "phase two" of 12.1 testing and should only be used on testnet. Also note that it has not yet been released for "livenet" and as such the latest packages have not yet been published to NPM. This allows us the flexibility to default the network settings to "testnet" during this testing phase.

    Insight API Block Explorer

    insight UI (testnet): http://test-insight.dev.dash.org
    insight API (testnet): http://test-insight.dev.dash.org/insight-api-dash/...
    <see insight-api-dash readme for endpoints>

    Bitcore-Dash Repositories:

    bitcore-dash: https://github.com/dashpay/bitcore-dash
    bitcore-lib-dash: https://github.com/dashpay/bitcore-lib-dash
    bitcore-node-dash: https://github.com/dashpay/bitcore-node-dash

    Insight API Repositories:

    insight-api-dash: https://github.com/dashpay/insight-api-dash
    insight-ui-dash: https://github.com/dashpay/insight-ui-dash

    How do I get started?

    Head over to the development branch of Bitcore-Dash: https://github.com/dashpay/bitcore-dash/tree/dev-testnet.

    In summary:

    1) Install Node V4.0.0 using nvm (https://github.com/creationix/nvm)
    2) Install build dependencies: sudo apt-get install build-essential libzmq3-dev
    3) Install bitcore-dash using the "dev-testnet" branch:

    git clone https://github.com/dashpay/bitcore-dash -b dev-testnet
    cd bitcore-dash
    npm install -g
    bitcored

    By default, bitcore-dash will place the dash daemon in ~/.bitcore/data. For this testnet release pre-compiled binaries are being provided through a download script. For more information on the internals of this process please see the "dev-testnet" branch of bitcore-node-dash.

    Disable Automatic Download:

    If you're not using an x86 or x64 Linux operating system (e.g. Raspberry Pi) please note that you'll need to compile the daemon locally and then place it in ~/.bitcore/data. The following commands will download a development branch of Bitcore-Dash which does not automatically download the dash daemon:

    git clone https://github.com/dashpay/bitcore-dash -b dev-nodownload
    cd bitcore-dash
    npm install -g
    bitcored

    Testing:

    Help us find bugs! Help us expand the documentation! Help us expand the feature set! This is a collaborative endeavor so please try it out and post your feedback and questions on this thread.

    Recognitions:

    This work would not have been possible without the contributions of a number of people including but not limited to (and in no particular order):

    @UdjinM6: Dash Core v0.12.1.x modification to support bitcore-node-dash as well as customization to allow for ZMQ InstantSend notifications.
    @QuantumExplorer: Development of x11-hash-js, a 100% native JavaScript X11 hashing library.
    @snogcel: Development of bitcore-dash, bitcore-node-dash, insight-api-dash and others.
    @flare: Repository management, upstream merging and test coverage.
    @moocowmoo: Development of dockerfile-based installation process and management of infrastructure.
     
    #1 snogcel, Sep 29, 2016
    Last edited: Oct 6, 2016
    • Like Like x 16
    • Winner Winner x 1
  2. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
  3. TaoOfSatoshi

    TaoOfSatoshi Grizzled Member
    Linguistic Dash Nation Founder Moderator

    Joined:
    Jul 15, 2014
    Messages:
    2,621
    Likes Received:
    2,585
    Trophy Points:
    1,183
    Great job to all!
     
    • Like Like x 1
  4. kot

    kot Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Mar 17, 2015
    Messages:
    678
    Likes Received:
    1,818
    Trophy Points:
    263
    @snogcel - you rock man!
    Thanks a lot for what you are doing on the backend side of Evolution development!
     
    • Like Like x 2
    • Agree Agree x 1
  5. ec1warc1

    ec1warc1 Active Member

    Joined:
    Jul 26, 2016
    Messages:
    319
    Likes Received:
    169
    Trophy Points:
    113
    This is very exciting news. I am on assignment in Cali, Colombia - very busy until Friday, Oct 7. But, soon, I will be looking at this more deeply! Thanks for the work done! Awesome!
     
    • Like Like x 1
  6. darkzero

    darkzero Member

    Joined:
    Jun 6, 2014
    Messages:
    44
    Likes Received:
    35
    Trophy Points:
    58
    Should have enough time in the few coming days to install it. Thanks!
     
    • Like Like x 1
  7. darkzero

    darkzero Member

    Joined:
    Jun 6, 2014
    Messages:
    44
    Likes Received:
    35
    Trophy Points:
    58
    Well, with latest node bitcored continues to run dashd over and over getting many dashd processes running

    Code:
    $ ./bitcored
    info: Using config: bitcore-node-dash.json
    info: Starting bitcoind
    info: Starting dash process
    Dash Core server starting
    warn: Dash process unexpectedly exited with code: 0
    warn: Restarting dash child process in 5000ms
    info: Starting dash process
    Dash Core server starting
    warn: Dash process unexpectedly exited with code: 0
    warn: Restarting dash child process in 5000ms
    
    with node 5.0 exits with this error

    Code:
    $ ./bitcored
    /.npm/lib/node_modules/bitcore-dash/node_modules/bindings/bindings.js:83
      throw e
      ^
    
    Error: Module version mismatch. Expected 47, got 48.
      at Error (native)
      at Object.Module._extensions..node (module.js:450:18)
      at Module.load (module.js:356:32)
      at Function.Module._load (module.js:311:12)
      at Module.require (module.js:366:17)
      at require (module.js:385:17)
      at bindings (/.npm/lib/node_modules/bitcore-dash/node_modules/bindings/bindings.js:76:44)
      at Object.<anonymous> (/.npm/lib/node_modules/bitcore-dash/node_modules/zmq/lib/index.js:6:30)
      at Module._compile (module.js:425:26)
      at Object.Module._extensions..js (module.js:432:10)
    
    with node 4.0 even worse
    Code:
    Segmentation fault (core dumped)
    
    Quite stuck..
     
  8. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
    @darkzero sorry to hear you're having trouble. A few things to note that I think might help:

    1. bitcored spawns an instance of dashd when it's launched and also monitors it while it's running. Usually that works pretty well, if it trips over itself you can use "top" to view active processes, then use "sudo kill <pid>" (replace <pid> with the process id number).

    2. make sure that you're using nvm - it makes the whole thing much more smoothly and removes OS specific things. Are you using nvm?

    3. when you change node versions you need to rebuild certain things. Along with "npm install" make sure to "npm rebuild".

    In this case, can you try the following?

    nvm install v4.0.0
    nvm use v4.0.0

    log off and log back in to ssh (this enables nvm)

    git clone https://github.com/dashpay/bitcore-dash -b dev-testnet
    cd bitcore-dash
    npm rebuild
    npm install -g
    bitcored

    Let me know if that helps at all. I'm assuming you're using Ubuntu?
     
  9. darkzero

    darkzero Member

    Joined:
    Jun 6, 2014
    Messages:
    44
    Likes Received:
    35
    Trophy Points:
    58
    @snogcel i'm on Ubuntu 16.04.1 LTS
    1. the problem is that it continues to spwan new instances forever if not interrupted
    2. yes using nvm
    3. the rebuild hint helped

    But still not working, see if the log helps to understand why, thanks!

    $ nvm install v4.0.0
    v4.0.0 is already installed.
    Now using node v4.0.0 (npm v2.14.2)

    $ node --version
    v4.0.0

    /bitcore-dash$ npm --version
    2.14.2
    /bitcore-dash$ npm rebuild
    /bitcore-dash$ npm install -g
    -
    > [email protected] preinstall /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash
    > ./scripts/download

    Downloading dash: http://download.slayer.work//
    npm ERR! Linux 4.1.19-v7+
    npm ERR! argv "/home//.nvm/versions/node/v4.0.0/bin/node" "/home//.nvm/versions/node/v4.0.0/bin/npm" "install" "-g"
    npm ERR! node v4.0.0
    npm ERR! npm v2.14.2
    npm ERR! code ELIFECYCLE

    npm ERR! [email protected] preinstall: `./scripts/download`
    npm ERR! Exit status 22
    npm ERR!
    npm ERR! Failed at the [email protected] preinstall script './scripts/download'.
    npm ERR! This is most likely a problem with the bitcore-node-dash package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR! ./scripts/download
    npm ERR! You can get their info via:
    npm ERR! npm owner ls bitcore-node-dash
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR! bitcore-dash/npm-debug.log

    and inside /bitcore-dash/scripts there is not download file
     
  10. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
    Tnx for the log files @darkzero. It looks like it's getting stuck when attempting to download the binaries, I have a feeling that your .bitcore folder was created as root and as a result it's not able to write to it.

    Can you please try the following command?

    sudo rm -rf ~/.bitcore

    After that try installing again -- if it's still having trouble can you please issue this command and let me know what it does?

    /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/scripts/download
     
    • Like Like x 1
  11. darkzero

    darkzero Member

    Joined:
    Jun 6, 2014
    Messages:
    44
    Likes Received:
    35
    Trophy Points:
    58
    @snogcel

    the .bitcore folder is writable

    $ ll ~/
    total 204
    drwxr-xr-x 26 dev dev 4096 Oct 2 15:50 ./
    drwxr-xr-x 3 root root 4096 Jul 17 12:50 ../
    drwxr-xr-x 3 dev dev 4096 Oct 2 12:46 .bitcore/

    the command
    npm install -g
    return the same error.. and the download script

    $ /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/scripts/download
    -bash: /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/scripts/download: No such file or directory
    $


    The path stops at node_modules, somehow nothing has been installed?

    $ ll /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/
    total 12
    drwxr-xr-x 3 dev dev 4096 Oct 3 22:14 ./
    drwxr-xr-x 3 dev dev 4096 Sep 8 2015 ../
    drwxr-xr-x 9 dev dev 4096 Sep 8 2015 npm/
    $

    Question: can i install the whole .nvm .npm and .bitcore on another folder?
    Thanks
     
  12. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
    @darkzero - thanks for sharing that, to narrow this down a little bit further can you please try running "npm install" (instead of npm install -g)? This will install all the files into the folder you'd originally pulled bitcore-dash into and avoid any global weirdnesses which I think might be the culprit here. Please give that a try and let me know how it goes :)
     
  13. darkzero

    darkzero Member

    Joined:
    Jun 6, 2014
    Messages:
    44
    Likes Received:
    35
    Trophy Points:
    58
    @snogcel
    sending install commands again and somehow improved but at last, same error

    $ npm install -g bitcore-dash
    npm WARN deprecated [email protected]: This package is deprecated. Use Array.isArray.
    $ npm install bitcore-lib-dash
    $ npm install -g bitcore-node-dash

    $ npm rebuild
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/bn.js
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/bs58
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/buffer-compare
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/elliptic
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/elliptic/node_modules/brorand
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/elliptic/node_modules/hash.js
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/inherits
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/lodash
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/sha512
    [email protected] /bitcore-dash/node_modules/bitcore-lib-dash/node_modules/x11-hash-js

    $ npm install -g
    \
    > [email protected] preinstall /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash
    > ./scripts/download

    Downloading dash: http://download.slayer.work//
    npm ERR! Linux 4.1.19-v7+
    npm ERR! argv "/home/dev/.nvm/versions/node/v4.0.0/bin/node" "/home/dev/.nvm/versions/node/v4.0.0/bin/npm" "install" "-g"
    npm ERR! node v4.0.0
    npm ERR! npm v2.14.2
    npm ERR! code ELIFECYCLE

    npm ERR! [email protected] preinstall: `./scripts/download`
    npm ERR! Exit status 22
    npm ERR!
    npm ERR! Failed at the [email protected] preinstall script './scripts/download'.
    npm ERR! This is most likely a problem with the bitcore-node-dash package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR! ./scripts/download
    npm ERR! You can get their info via:
    npm ERR! npm owner ls bitcore-node-dash
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR! /bitcore-dash/npm-debug.log
    $

    Sent command as suggested

    $ npm install
    npm WARN deprecated [email protected]: to-iso-string has been deprecated, use @segment/to-iso-string instead.
    npm WARN deprecated [email protected]: Jade has been renamed to pug, please install the latest version of pug instead of jade
    npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
    |
    > [email protected] preinstall /bitcore-dash/node_modules/bitcore-node-dash
    > ./scripts/download

    Downloading dash: http://download.slayer.work//
    npm ERR! Linux 4.1.19-v7+
    npm ERR! argv "/home/dev/.nvm/versions/node/v4.0.0/bin/node" "/home/dev/.nvm/versions/node/v4.0.0/bin/npm" "install"
    npm ERR! node v4.0.0
    npm ERR! npm v2.14.2
    npm ERR! code ELIFECYCLE

    npm ERR! [email protected] preinstall: `./scripts/download`
    npm ERR! Exit status 22
    npm ERR!
    npm ERR! Failed at the [email protected] preinstall script './scripts/download'.
    npm ERR! This is most likely a problem with the bitcore-node-dash package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR! ./scripts/download
    npm ERR! You can get their info via:
    npm ERR! npm owner ls bitcore-node-dash
    npm ERR! There is likely additional logging output above.

    npm ERR! Please include the following file with any support request:
    npm ERR! /bitcore-dash/npm-debug.log
    $




     
  14. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
    • Agree Agree x 1
  15. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
    As a quick update on this: it turns out the automatic download script is unable to properly detect Raspberry Pi which was causing the errors above. I've added the following bit to the original post for scenarios where the daemon should be compiled locally:

    Disable Automatic Download:

    If you're not using an x86 or x64 Linux operating system (e.g. Raspberry Pi) please note that you'll need to compile the daemon locally and then place it in ~/.bitcore/data. The following commands will download a development branch of Bitcore-Dash which does not automatically download the dash daemon:

    git clone https://github.com/dashpay/bitcore-dash -b dev-nodownload
    cd bitcore-dash
    npm install -g
    bitcored
     
  16. darkzero

    darkzero Member

    Joined:
    Jun 6, 2014
    Messages:
    44
    Likes Received:
    35
    Trophy Points:
    58
    Hello, here I am again this time on livenet and Rpi.. :rolleyes:

    Well started install bitcore-dash but fails at download

    $ npm install -g bitcore-dash

    > [email protected] preinstall /home/dev/.nvm/versions/node/v6.7.0/lib/node_modules/.staging/bitcore-node-dash-242c5ca8
    > ./scripts/download

    Downloading dash: https://bamboo.dash.org/browse/DASHL-DEV/latestSuccessful/artifact/JOB1/gitian-linux-dash-dist//
    ./scripts/download: line 46: $tarball_name: ambiguous redirect
    npm ERR! Linux 4.1.19-v7+
    npm ERR! argv "/home/dev/.nvm/versions/node/v6.7.0/bin/node" "/home/dev/.nvm/versions/node/v6.7.0/bin/npm" "install" "-g" "bitcore-dash"
    npm ERR! node v6.7.0
    npm ERR! npm v3.10.3
    npm ERR! code ELIFECYCLE

    npm ERR! [email protected] preinstall: `./scripts/download`
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] preinstall script './scripts/download'.
    npm ERR! Make sure you have the latest version of node.js and npm installed.
    npm ERR! If you do, this is most likely a problem with the bitcore-node-dash package,
    npm ERR! not with npm itself.
    npm ERR! Tell the author that this fails on your system:
    npm ERR! ./scripts/download
    npm ERR! You can get information on how to open an issue for this project with:
    npm ERR! npm bugs bitcore-node-dash
    npm ERR! Or if that isn't available, you can get their info via:
    npm ERR! npm owner ls bitcore-node-dash
    npm ERR! There is likely additional logging output above.


    So, got the nodownload branch

    git clone https://github.com/dashpay/bitcored-dash -b nodownload

    By runnig bitcored the spawned dashd seems to not be able to open the RPC socket (from debug.log)
    2017-02-09 23:03:23 Binding RPC on address 0.0.0.0 port 9998 failed.

    And bitcored fails to call via RPC and tries to restart the dashd process after few seconds, dashd isn't even running yet. And the loop goes on

    $ bitcored
    [2017-02-09T22:31:05.574Z] info: Using config: /home/dev/.bitcore/bitcore-node-dash.json
    [2017-02-09T22:31:05.592Z] info: Using network: livenet
    [2017-02-09T22:31:05.601Z] info: Starting bitcoind
    [2017-02-09T22:31:05.623Z] info: Using bitcoin config file: /home/dev/.bitcore/data/dash.conf
    [2017-02-09T22:31:05.647Z] info: Starting dash process
    Dash Core server starting
    [2017-02-09T22:31:05.814Z] warn: Dash process unexpectedly exited with code: 0
    [2017-02-09T22:31:05.820Z] warn: Restarting dash child process in 5000ms
    [2017-02-09T22:31:10.833Z] info: Using bitcoin config file: /home/dev/.bitcore/data/dash.conf
    [2017-02-09T22:31:10.881Z] warn: Loading block index...
    [2017-02-09T22:31:10.891Z] warn: Stopping existing spawned dash process with pid: 8318
    [2017-02-09T22:31:15.907Z] warn: Loading block index...
    [2017-02-09T22:31:20.901Z] warn: Stopping existing spawned dash process with pid: 8318
    [2017-02-09T22:31:20.920Z] warn: Loading block index...
    [2017-02-09T22:31:25.938Z] warn: Loading block index...
    [2017-02-09T22:31:30.909Z] warn: Stopping existing spawned dash process with pid: 8318
    [2017-02-09T22:31:30.951Z] warn: Loading block index...
    ^C[2017-02-09T22:31:33.132Z] info: Beginning shutdown
    [2017-02-09T22:31:33.136Z] info: Stopping insight-ui-dash (not started)
    [2017-02-09T22:31:33.143Z] info: Stopping insight-api-dash (not started)
    [2017-02-09T22:31:33.145Z] info: Stopping web (not started)
    [2017-02-09T22:31:33.147Z] info: Stopping bitcoind
    [2017-02-09T22:31:33.150Z] info: Halted

    The file bitcore-node-dash.json is as follows

    $ more bitcore-node-dash.json
    {
    "network": "livenet",
    "port": 3001,
    "rpcport": 9998,
    "services": [
    "bitcoind",
    "web",
    "insight-api-dash",
    "insight-ui-dash"
    ],
    "servicesConfig": {
    "bitcoind": {
    "spawn": {
    "datadir": "/home/dev/.bitcore/data",
    "exec": "/home/dev/.bitcore/data/dashd"
    }
    }
    }
    }
    $

    Note that in /home/dev/.bitcore/data/dashd there is a working instance of dashd if run alone

    Then tried to modify spawn in connect, but it fails because bitcored tries to connect to port 8332 o_O
    Can't find in *.js that port..

    {
    "network": "livenet",
    "port": 3001,
    "rpcport": 9998,
    "services": [
    "bitcoind",
    "web",
    "insight-api-dash",
    "insight-ui-dash"
    ],
    "servicesConfig": {
    "bitcoind": {
    "connect": {
    "rpchost": "127.0.0.1",
    "rpcport": 9998,
    "port": 9999,
    "rpcuser": "dash",
    "rpcpassword": "local321",
    "zmqpubrawtx": "tcp://127.0.0.1:28332"
    }
    }
    }
    }

    $ bitcored

    [2017-02-09T22:38:16.004Z] info: Using config: /home/dev/.bitcore/bitcore-node-dash.json
    [2017-02-09T22:38:16.023Z] info: Using network: livenet
    [2017-02-09T22:38:16.035Z] info: Starting bitcoind
    [2017-02-09T22:43:13.023Z] error: Failed to start services
    [2017-02-09T22:43:13.038Z] error: RPCError: Bitcoin JSON-RPC: Request Error: connect ECONNREFUSED 127.0.0.1:8332
    at Bitcoin._wrapRPCError (/home/dev/.nvm/versions/node/v6.7.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js:468:13)
    at /home/dev/.nvm/versions/node/v6.7.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js:820:28
    at ClientRequest.<anonymous> (/home/dev/.nvm/versions/node/v6.7.0/lib/node_modules/bitcore-dash/node_modules/bitcoind-rpc-dash/lib/index.js:116:7)
    at emitOne (events.js:96:13)
    at ClientRequest.emit (events.js:188:7)
    at Socket.socketErrorListener (_http_client.js:308:9)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at emitErrorNT (net.js:1271:8)
    at _combinedTickCallback (internal/process/next_tick.js:74:11)
    [2017-02-09T22:43:13.048Z] info: Beginning shutdown
    [2017-02-09T22:43:13.053Z] info: Stopping insight-ui-dash (not started)
    [2017-02-09T22:43:13.056Z] info: Stopping insight-api-dash (not started)
    [2017-02-09T22:43:13.060Z] info: Stopping web (not started)
    [2017-02-09T22:43:13.061Z] info: Stopping bitcoind
    [2017-02-09T22:43:13.064Z] info: Halted

    Any hint? Thanks
     
  17. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
    hey @darkzero it's been awhile :)

    It looks like this problem is at least partially related to the node version you're using,

    Please try the following:

    Edit: just re-read your message, to avoid the auto download... :)

    nvm install v4.0.0
    nvm use v4.0.0
    git clone https://github.com/dashpay/bitcore-dash -b nodownload
    cd bitcore-dash
    npm install -g

    At that point you should be able to launch the daemon with the following command:

    bitcored

    Please give it a try and let me know how it goes!
     
    #17 snogcel, Feb 9, 2017
    Last edited: Feb 10, 2017
  18. darkzero

    darkzero Member

    Joined:
    Jun 6, 2014
    Messages:
    44
    Likes Received:
    35
    Trophy Points:
    58
    @snogcel well it didn't work. It seems that the config isn't really read :rolleyes:
    In fact I modified the values in some .js and didn't get error at same place

    $ npm install -g
    -
    > [email protected] preinstall /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash
    > ./scripts/download --skip-bitcoin-download

    /
    > [email protected] install /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/utf-8-validate
    > node-gyp rebuild

    make: Entering directory '/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/utf-8-validate/build'
    CXX(target) Release/obj.target/validation/src/validation.o
    SOLINK_MODULE(target) Release/obj.target/validation.node
    COPY Release/validation.node
    make: Leaving directory '/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/utf-8-validate/build'

    > [email protected] install /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/bufferutil
    > node-gyp rebuild

    make: Entering directory '/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/bufferutil/build'
    CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
    SOLINK_MODULE(target) Release/obj.target/bufferutil.node
    COPY Release/bufferutil.node
    make: Leaving directory '/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/bufferutil/build'

    > [email protected] install /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/zmq
    > node-gyp rebuild

    make: Entering directory '/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/zmq/build'
    CXX(target) Release/obj.target/zmq/binding.o
    SOLINK_MODULE(target) Release/obj.target/zmq.node
    COPY Release/zmq.node
    make: Leaving directory '/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/zmq/build'
    /home/dev/.nvm/versions/node/v4.0.0/bin/bitcored -> /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/bin/bitcored
    /home/dev/.nvm/versions/node/v4.0.0/bin/bitcore -> /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/bin/bitcore
    [email protected] /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash
    ├── [email protected]
    ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
    ├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
    └── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

    $ bitcored
    [2017-02-10T11:22:42.156Z] info: Using config: /home/dev/.bitcore/bitcore-node-dash.json
    [2017-02-10T11:22:42.172Z] info: Using network: livenet
    [2017-02-10T11:22:42.182Z] info: Starting bitcoind
    [2017-02-10T11:27:38.470Z] error: Failed to start services
    [2017-02-10T11:27:38.488Z] error: RPCError: Bitcoin JSON-RPC: Request Error: connect ECONNREFUSED 127.0.0.1:8332
    at Bitcoin._wrapRPCError (/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js:466:13)
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js:818:28
    at ClientRequest.<anonymous> (/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/bitcoind-rpc-dash/lib/index.js:116:7)
    at emitOne (events.js:77:13)
    at ClientRequest.emit (events.js:169:7)
    at Socket.socketErrorListener (_http_client.js:259:9)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at emitErrorNT (net.js:1250:8)
    at doNTCallback2 (node.js:429:9)
    [2017-02-10T11:27:38.503Z] info: Beginning shutdown
    [2017-02-10T11:27:38.508Z] info: Stopping insight-ui-dash (not started)
    [2017-02-10T11:27:38.517Z] info: Stopping insight-api-dash (not started)
    [2017-02-10T11:27:38.521Z] info: Stopping web (not started)
    [2017-02-10T11:27:38.522Z] info: Stopping bitcoind
    [2017-02-10T11:27:38.525Z] info: Halted
    $

    Modified user, pass, port here:
    /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/bitcoind-rpc-dash/lib/index.js

    $ bitcored
    [2017-02-10T12:01:25.760Z] info: Stopping insight-ui-dash (not started)
    [2017-02-10T12:01:25.763Z] error: uncaught exception: [TypeError: Address must be a string!]
    [2017-02-10T12:01:25.767Z] error: TypeError: Address must be a string!
    at TypeError (native)
    at Socket.connect (/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/zmq/lib/index.js:501:13)
    at Bitcoin._initZmqSubSocket (/home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js:780:21)
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js:991:10
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:676:51
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:726:13
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:52:16
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:264:21
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:44:16
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:723:17
    [2017-02-10T12:01:25.769Z] info: Beginning shutdown

    Again error, the object that holds config values seems empty, modifying this .js went through
    nano /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js

    $ bitcored
    [2017-02-10T12:23:16.377Z] info: Using config: /home/dev/.bitcore/bitcore-node-dash.json
    [2017-02-10T12:23:16.392Z] info: Using network: livenet
    [2017-02-10T12:23:16.401Z] info: Starting bitcoind
    [2017-02-10T12:23:16.793Z] error: Failed to start services
    [2017-02-10T12:23:16.806Z] error: Error: Bitcoin configuration options "spawn" or "connect" are expected
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js:1040:23
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:726:13
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:52:16
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:269:32
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:44:16
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:723:17
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:167:37
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/lib/services/bitcoind.js:1029:11
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:52:16
    at /home/dev/.nvm/versions/node/v4.0.0/lib/node_modules/bitcore-dash/node_modules/bitcore-node-dash/node_modules/async/lib/async.js:361:13

    Again, config has those values, but aren't they read? o_O

    {
    "network": "livenet",
    "port": 3001,
    "rpcport": 9998,
    "services": [
    "bitcoind",
    "web",
    "insight-api-dash",
    "insight-ui-dash"
    ],
    "servicesConfig": {
    "bitcoind": {
    "connect": {
    "rpchost": "127.0.0.1",
    "rpcport": 9998,
    "rpcuser": "dash",
    "rpcpassword": "local321",
    "zmqpubrawtx": "tcp://127.0.0.1:28332",
    "zmqpubrawtxlock": "tcp://127.0.0.1:28332",
    "zmqpubhashblock": "tcp://127.0.0.1:28332"
    }
    }
    }
    }

    I'm almost there.. :)
     
  19. snogcel

    snogcel Well-known Member
    Dash Core Team Foundation Member

    Joined:
    Jun 11, 2014
    Messages:
    189
    Likes Received:
    210
    Trophy Points:
    203
    So close! I think the issue now relates to your bitcore-node-dash.json file, there's some stuff in there which is typically included in a "default installation". Please see below for a reference copy:

    Code:
    {
      "network": "livenet",
      "port": 3001,
      "services": [
        "bitcoind",
        "web",
        "insight-api-dash",
        "insight-ui-dash"
      ],
      "servicesConfig": {
        "bitcoind": {
          "spawn": {
            "datadir": "/home/dev/.bitcore/data",
            "exec": "/home/dev/.bitcore/data/dashd"
          }
        }
      }
    }
    You may notice that none of the RPC related settings are included in this file, I'd suggest leaving these at their defaults or if you do need to change anything to use the dash.conf that's stored in ~/.bitcore/data/dash.conf. I think once you get this cleared up we should be in good shape, just let me know :)
     
  20. darkzero

    darkzero Member

    Joined:
    Jun 6, 2014
    Messages:
    44
    Likes Received:
    35
    Trophy Points:
    58
    @snogcel well, it's up and running at http://212.47.247.1:3001/
    (API available at default url http://212.47.247.1:3001/api/ )
    It's been setup as a service with a script for systemd but I can't find the log anymore (before it was in the console). Do you know how to configure it? Never mind, I found the logs, forgot that were in the journal..
    I may leave it running if it's useful.
    Cheers

    EDIT: was looking to install also an electrum server but i found that needs many resources, is it true also for dash?
    Does anybody knows about ElectrumX? https://github.com/kyuupichan/electrumx
    Seems to have support for dash also
     
    #20 darkzero, Feb 28, 2017
    Last edited: Mar 4, 2017
    • Like Like x 2
  21. Skrutch

    Skrutch Guest

    1., if I login with SSH (root), I run bitcore-node-dash start , it's start to work, then if close terminal, Node is down. how I can run it correctly..?

    2. If can't run bitcore-node-dash start, see this ouput..., but problem with reboot server... Try to kill process, but can't fix.
    Why?

    [​IMG]


    This is normal?

    [​IMG]

    [​IMG]


    But "insight" is run I think well, but want to fix all critical warning...

    P.S. snogcel https://github.com/dashevo/bitcore-node-dash/issues/21
     

Share This Page