bitcore icon indicating copy to clipboard operation
bitcore copied to clipboard

unable to `npm run node`

Open Rohithzr opened this issue 4 years ago • 1 comments

I am trying to run insight server but the npm run node fails.

error

Unhandled Rejection at: Error: Chain BTC doesn't have a ChainStateProvider registered

bitcore.config.json

{
    "bitcoreNode": {
        "modules": [
            "./bitcoin", "./bitcoin-cash"
        ],
        "services": {
            "api": {
                "wallets": {
                    "allowCreationBeforeCompleteSync": true
                }
            }
        },
        "chains": {
            "BTC": {
                "mainnet": {
                    "chainSource": "p2p",
                    "rpc": {
                        "host": "127.0.0.1",
                        "port": 8181,
                        "username": "username",
                        "password": "password"
                    }
                }
            },
            "BCH": {
                "mainnet": {
                    "parentChain": "BTC",
                    "forkHeight": 478558,
                    "trustedPeers": [
                        {
                            "host": "127.0.0.1",
                            "port": 8585
                        }
                    ],
                    "rpc": {
                        "host": "127.0.0.1",
                        "port": 8383,
                        "username": "username",
                        "password": "password"
                    }
                }
            }
        }
    }
}

npm run node

npm run node

> @8.23.1 node /home/rohithzr01/bitcore
> cd packages/bitcore-node && npm start


> [email protected] start /home/rohithzr01/bitcore/packages/bitcore-node
> npm run tsc && node build/src/server.js


> [email protected] tsc /home/rohithzr01/bitcore/packages/bitcore-node
> npm run clean && tsc


> [email protected] clean /home/rohithzr01/bitcore/packages/bitcore-node
> rm -rf build

(node:21801) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
{"message":"Starting Event Service","level":"info"}
{"message":"Starting P2P Manager","level":"info"}
{"message":"Starting BCH p2p worker","level":"info"}
{"message":"2021-02-25 14:20:04.794 UTC | Connected to peer: 127.0.0.1:8335  | Chain: BCH | Network: mainnet","level":"info"}
{"message":"2021-02-25 14:20:04.800 UTC | Connected to peer: 127.0.0.1:8335  | Chain: BCH | Network: mainnet","level":"info"}
{"message":"This worker is now the syncing node for BCH mainnet","level":"info"}
Unhandled Rejection at: Error: Chain BTC doesn't have a ChainStateProvider registered
    at ChainStateProxy.get (/home/rohithzr01/bitcore/packages/bitcore-node/src/providers/chain-state/index.ts:32:13)
    at ChainStateProxy.<anonymous> (/home/rohithzr01/bitcore/packages/bitcore-node/src/providers/chain-state/index.ts:130:17)
    at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:32:23)
    at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:13:53)
    at /home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:3:12)
    at ChainStateProxy.getLocalTip (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:163:16)
    at BitcoinP2PWorker.<anonymous> (/home/rohithzr01/bitcore/packages/bitcore-node/src/modules/bitcoin/p2p.ts:267:48)
    at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/modules/bitcoin/p2p.js:45:23)
    at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/modules/bitcoin/p2p.js:26:53)
    at fulfilled (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/modules/bitcoin/p2p.js:17:58)
    at process._tickCallback (internal/process/next_tick.js:68:7)
Shutting down 21801
{"message":"Stopping P2P Manager","level":"info"}
(node:21842) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21857) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21836) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
{"message":"Stopping Event Service","level":"info"}
{"message":"Stopping Storage Service","level":"info"}
(node:21846) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21866) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21817) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21828) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21881) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21859) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21809) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21877) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(node:21815) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
{"message":"Starting Event Service","level":"info"}
{"message":"Starting Event Service","level":"info"}
{"message":"Starting Event Service","level":"info"}
rohithzr01@rohithzr:~/bitcore$ Error: write EPIPE
    at process.target._send (internal/child_process.js:762:20)
    at process.target.send (internal/child_process.js:634:19)
    at sendHelper (internal/cluster/utils.js:24:15)
    at send (internal/cluster/child.js:187:10)
    at EventEmitter.cluster._getServer (internal/cluster/child.js:86:3)
    at listenInCluster (net.js:1341:11)
    at Server.listen (net.js:1415:7)
    at ApiService.<anonymous> (/home/rohithzr01/bitcore/packages/bitcore-node/src/services/api.ts:49:23)
    at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:38:23)
    at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:19:53)
    at /home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:13:71
    at new Promise (<anonymous>)
    at __awaiter (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:9:12)
    at ApiService.start (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:75:16)
    at Object.<anonymous> (/home/rohithzr01/bitcore/packages/bitcore-node/src/workers/all.ts:38:19)
    at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/workers/all.js:32:23)
Error: write EPIPE
    at process.target._send (internal/child_process.js:762:20)
    at process.target.send (internal/child_process.js:634:19)
    at sendHelper (internal/cluster/utils.js:24:15)
    at send (internal/cluster/child.js:187:10)
    at EventEmitter.cluster._getServer (internal/cluster/child.js:86:3)
    at listenInCluster (net.js:1341:11)
    at Server.listen (net.js:1415:7)
    at ApiService.<anonymous> (/home/rohithzr01/bitcore/packages/bitcore-node/src/services/api.ts:49:23)
    at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:38:23)
    at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:19:53)
    at /home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:13:71
    at new Promise (<anonymous>)
    at __awaiter (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:9:12)
    at ApiService.start (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:75:16)
    at Object.<anonymous> (/home/rohithzr01/bitcore/packages/bitcore-node/src/workers/all.ts:38:19)
    at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/workers/all.js:32:23)
Error: write EPIPE
    at process.target._send (internal/child_process.js:762:20)
    at process.target.send (internal/child_process.js:634:19)
    at sendHelper (internal/cluster/utils.js:24:15)
    at send (internal/cluster/child.js:187:10)
    at EventEmitter.cluster._getServer (internal/cluster/child.js:86:3)
    at listenInCluster (net.js:1341:11)
    at Server.listen (net.js:1415:7)
    at ApiService.<anonymous> (/home/rohithzr01/bitcore/packages/bitcore-node/src/services/api.ts:49:23)
    at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:38:23)
    at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:19:53)
    at /home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:13:71
    at new Promise (<anonymous>)
    at __awaiter (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:9:12)
    at ApiService.start (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:75:16)
    at Object.<anonymous> (/home/rohithzr01/bitcore/packages/bitcore-node/src/workers/all.ts:38:19)
    at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/workers/all.js:32:23)
ls

Rohithzr avatar Feb 25 '21 14:02 Rohithzr

{ "bitcoreNode": { "modules": [ "./bitcoin", "./bitcoin-cash" ], "services": { "api": { "wallets": { "allowCreationBeforeCompleteSync": true } } }, "chains": { "BTC": { "mainnet": { "chainSource": "p2p", "rpc": { "host": "127.0.0.1", "port": 8181, "username": "username", "password": "password" } } }, "BCH": { "mainnet": { "parentChain": "BTC", "forkHeight": 478558, "trustedPeers": [ { "host": "127.0.0.1", "port": 8585 } ], "rpc": { "host": "127.0.0.1", "port": 8383, "username": "username", "password": "password" } } } } } } npm run node

npm run node

@8.23.1 node /home/rohithzr01/bitcore cd packages/bitcore-node && npm start

[email protected] start /home/rohithzr01/bitcore/packages/bitcore-node npm run tsc && node build/src/server.js

[email protected] tsc /home/rohithzr01/bitcore/packages/bitcore-node npm run clean && tsc

[email protected] clean /home/rohithzr01/bitcore/packages/bitcore-node rm -rf build

(node:21801) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. {"message":"Starting Event Service","level":"info"} {"message":"Starting P2P Manager","level":"info"} {"message":"Starting BCH p2p worker","level":"info"} {"message":"2021-02-25 14:20:04.794 UTC | Connected to peer: 127.0.0.1:8335 | Chain: BCH | Network: mainnet","level":"info"} {"message":"2021-02-25 14:20:04.800 UTC | Connected to peer: 127.0.0.1:8335 | Chain: BCH | Network: mainnet","level":"info"} {"message":"This worker is now the syncing node for BCH mainnet","level":"info"} Unhandled Rejection at: Error: Chain BTC doesn't have a ChainStateProvider registered at ChainStateProxy.get (/home/rohithzr01/bitcore/packages/bitcore-node/src/providers/chain-state/index.ts:32:13) at ChainStateProxy. (/home/rohithzr01/bitcore/packages/bitcore-node/src/providers/chain-state/index.ts:130:17) at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:32:23) at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:13:53) at /home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:7:71 at new Promise () at __awaiter (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:3:12) at ChainStateProxy.getLocalTip (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/providers/chain-state/index.js:163:16) at BitcoinP2PWorker. (/home/rohithzr01/bitcore/packages/bitcore-node/src/modules/bitcoin/p2p.ts:267:48) at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/modules/bitcoin/p2p.js:45:23) at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/modules/bitcoin/p2p.js:26:53) at fulfilled (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/modules/bitcoin/p2p.js:17:58) at process._tickCallback (internal/process/next_tick.js:68:7) Shutting down 21801 {"message":"Stopping P2P Manager","level":"info"} (node:21842) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21857) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21836) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. {"message":"Stopping Event Service","level":"info"} {"message":"Stopping Storage Service","level":"info"} (node:21846) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21866) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21817) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21828) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21881) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21859) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21809) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21877) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. (node:21815) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead. {"message":"Starting Event Service","level":"info"} {"message":"Starting Event Service","level":"info"} {"message":"Starting Event Service","level":"info"} rohithzr01@rohithzr:~/bitcore$ Error: write EPIPE at process.target._send (internal/child_process.js:762:20) at process.target.send (internal/child_process.js:634:19) at sendHelper (internal/cluster/utils.js:24:15) at send (internal/cluster/child.js:187:10) at EventEmitter.cluster._getServer (internal/cluster/child.js:86:3) at listenInCluster (net.js:1341:11) at Server.listen (net.js:1415:7) at ApiService. (/home/rohithzr01/bitcore/packages/bitcore-node/src/services/api.ts:49:23) at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:38:23) at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:19:53) at /home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:13:71 at new Promise () at __awaiter (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:9:12) at ApiService.start (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:75:16) at Object. (/home/rohithzr01/bitcore/packages/bitcore-node/src/workers/all.ts:38:19) at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/workers/all.js:32:23) Error: write EPIPE at process.target._send (internal/child_process.js:762:20) at process.target.send (internal/child_process.js:634:19) at sendHelper (internal/cluster/utils.js:24:15) at send (internal/cluster/child.js:187:10) at EventEmitter.cluster._getServer (internal/cluster/child.js:86:3) at listenInCluster (net.js:1341:11) at Server.listen (net.js:1415:7) at ApiService. (/home/rohithzr01/bitcore/packages/bitcore-node/src/services/api.ts:49:23) at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:38:23) at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:19:53) at /home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:13:71 at new Promise () at __awaiter (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:9:12) at ApiService.start (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:75:16) at Object. (/home/rohithzr01/bitcore/packages/bitcore-node/src/workers/all.ts:38:19) at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/workers/all.js:32:23) Error: write EPIPE at process.target._send (internal/child_process.js:762:20) at process.target.send (internal/child_process.js:634:19) at sendHelper (internal/cluster/utils.js:24:15) at send (internal/cluster/child.js:187:10) at EventEmitter.cluster._getServer (internal/cluster/child.js:86:3) at listenInCluster (net.js:1341:11) at Server.listen (net.js:1415:7) at ApiService. (/home/rohithzr01/bitcore/packages/bitcore-node/src/services/api.ts:49:23) at step (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:38:23) at Object.next (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:19:53) at /home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:13:71 at new Promise () at __awaiter (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:9:12) at ApiService.start (/home/rohithzr01/bitcore/packages/bitcore-node/build/src/services/api.js:75:16) at Object. (/home/rohithzr01/bitcore/packages/bitcore-node/src/workers/all.ts:38:19)

yantiang13 avatar Apr 19 '21 17:04 yantiang13