Guest User

Untitled

a guest
Sep 15th, 2018
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.79 KB | None | 0 0
  1. import Client from 'bitcoin-core'
  2. let client = new Client( { username: 'xxx', password: 'yyy', port: 8332})
  3. client.getBlockchainInformation().then( res => console.log("res: ", res))
  4.  
  5. W20180915-09:18:15.768(2)? (STDERR) Unhandled rejection RpcError: 404 Not Found
  6. W20180915-09:18:15.768(2)? (STDERR) at Client.rest (/home/r2d2/vue/bapp/node_modules/bitcoin-core/dist/src/parser.js:117:13)
  7. W20180915-09:18:15.769(2)? (STDERR) at apply (/home/r2d2/vue/bapp/node_modules/lodash/lodash.js:475:27)
  8. W20180915-09:18:15.769(2)? (STDERR) at Client.wrapper (/home/r2d2/vue/bapp/node_modules/lodash/lodash.js:5337:16)
  9. W20180915-09:18:15.769(2)? (STDERR) at Request.self.callback (/home/r2d2/vue/bapp/node_modules/request/request.js:185:22)
  10. W20180915-09:18:15.769(2)? (STDERR) at emitTwo (events.js:131:20)
  11. W20180915-09:18:15.769(2)? (STDERR) at Request.emit (events.js:214:7)
  12. W20180915-09:18:15.769(2)? (STDERR) at Request.<anonymous> (/home/r2d2/vue/bapp/node_modules/request/request.js:1161:10)
  13. W20180915-09:18:15.769(2)? (STDERR) at emitOne (events.js:116:13)
  14. W20180915-09:18:15.769(2)? (STDERR) at Request.emit (events.js:211:7)
  15. W20180915-09:18:15.770(2)? (STDERR) at IncomingMessage.<anonymous> (/home/r2d2/vue/bapp/node_modules/request/request.js:1083:12)
  16. W20180915-09:18:15.770(2)? (STDERR) at Object.onceWrapper (events.js:313:30)
  17. W20180915-09:18:15.770(2)? (STDERR) at emitNone (events.js:111:20)
  18. W20180915-09:18:15.770(2)? (STDERR) at IncomingMessage.emit (events.js:208:7)
  19. W20180915-09:18:15.770(2)? (STDERR) at endReadableNT (_stream_readable.js:1064:12)
  20. W20180915-09:18:15.770(2)? (STDERR) at _combinedTickCallback (internal/process/next_tick.js:138:11)
  21. W20180915-09:18:15.770(2)? (STDERR) From previous event:
  22. W20180915-09:18:15.770(2)? (STDERR) at Client.getBlockchainInformation (/home/r2d2/vue/bapp/node_modules/bitcoin-core/dist/src/index.js:238:69)
  23. W20180915-09:18:15.770(2)? (STDERR) at Promise.asyncApply (server/jobs.js:24:10)
  24. W20180915-09:18:15.771(2)? (STDERR) at /home/r2d2/.meteor/packages/promise/.0.11.1.1vczms8.mxi5++os+web.browser+web.browser.legacy+web.cordova/npm/node_modules/meteor-promise/fiber_pool.js:43:40
  25.  
  26. ##
  27. ## bitcoin.conf configuration file. Lines beginning with # are comments.
  28. ##
  29.  
  30. # Network-related settings:
  31.  
  32. # Run on the test network instead of the real bitcoin network.
  33. #testnet=0
  34.  
  35. # Run a regression test network
  36. #regtest=1
  37. # when we don't need it to run as a daemon.
  38. daemon=1
  39.  
  40. # Connect via a SOCKS5 proxy
  41. #proxy=127.0.0.1:9050
  42.  
  43. # Bind to given address and always listen on it. Use [host]:port notation for IPv6
  44. #bind=<addr>
  45.  
  46. # Bind to given address and whitelist peers connecting to it. Use [host]:port notation for IPv6
  47. #whitebind=<addr>
  48.  
  49. txindex = 1
  50.  
  51. # Use as many addnode= settings as you like to connect to specific peers
  52. #addnode=69.164.218.197
  53. #addnode=10.0.0.2:8333
  54.  
  55. # Alternatively use as many connect= settings as you like to connect ONLY to specific peers
  56. #connect=69.164.218.197
  57. #connect=10.0.0.1:8333
  58.  
  59. # Listening mode, enabled by default except when 'connect' is being used
  60. #listen=1
  61.  
  62. # Maximum number of inbound+outbound connections.
  63. #maxconnections=
  64.  
  65. #
  66. # JSON-RPC options (for controlling a running Bitcoin/bitcoind process)
  67. #
  68.  
  69. # server=1 tells Bitcoin-Qt and bitcoind to accept JSON-RPC commands
  70. server=1
  71.  
  72. # Bind to given address to listen for JSON-RPC connections. Use [host]:port notation for IPv6.
  73. # This option can be specified multiple times (default: bind to all interfaces)
  74. #rpcbind=<addr>
  75. rpcbind=127.0.0.1
  76.  
  77. # If no rpcpassword is set, rpc cookie auth is sought. The default `-rpccookiefile` name
  78. # is .cookie and found in the `-datadir` being used for bitcoind. This option is typically used
  79. # when the server and client are run as the same user.
  80. #
  81. # If not, you must set rpcuser and rpcpassword to secure the JSON-RPC api. The first
  82. # method(DEPRECATED) is to set this pair for the server and client:
  83. rpcuser=xxx
  84. rpcpassword=yyy
  85. #
  86. # The second method `rpcauth` can be added to server startup argument. It is set at intialization time
  87. # using the output from the script in share/rpcuser/rpcuser.py after providing a username:
  88. #
  89. # ./share/rpcuser/rpcuser.py alice
  90. # String to be appended to bitcoin.conf:
  91. # rpcauth=alice:f7efda5c189b999524f151318c0c86$d5b51b3beffbc02b724e5d095828e0bc8b2456e9ac8757ae3211a5d9b16a22ae
  92. # Your password:
  93. # DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=
  94. #
  95. # On client-side, you add the normal user/password pair to send commands:
  96. #rpcuser=alice
  97. #rpcpassword=DONT_USE_THIS_YOU_WILL_GET_ROBBED_8ak1gI25KFTvjovL3gAM967mies3E=
  98. #
  99. # You can even add multiple entries of these to the server conf file, and client can use any of them:
  100. # rpcauth=bob:b2dd077cb54591a2f3139e69a897ac$4e71f08d48b4347cf8eff3815c0e25ae2e9a4340474079f55705f40574f4ec99
  101.  
  102. # How many seconds bitcoin will wait for a complete RPC HTTP request.
  103. # after the HTTP connection is established.
  104. #rpcclienttimeout=30
  105.  
  106. # By default, only RPC connections from localhost are allowed.
  107. # Specify as many rpcallowip= settings as you like to allow connections from other hosts,
  108. # either as a single IPv4/IPv6 or with a subnet specification.
  109.  
  110. # NOTE: opening up the RPC port to hosts outside your local trusted network is NOT RECOMMENDED,
  111. # because the rpcpassword is transmitted over the network unencrypted.
  112.  
  113. # server=1 tells Bitcoin-Qt to accept JSON-RPC commands.
  114. # it is also read by bitcoind to determine if RPC should be enabled
  115. #rpcallowip=10.1.1.34/255.255.255.0
  116. #rpcallowip=1.2.3.4/24
  117. #rpcallowip=2001:db8:85a3:0:0:8a2e:370:7334/96
  118. rpcallowip=127.0.0.1
  119.  
  120. # as seen in https://bitcoin.stackexchange.com/questions/71800/bitcoin-rpc-econnrefused:
  121. port=8444
  122.  
  123. # Listen for RPC connections on this TCP port:
  124. rpcport=8332
  125.  
  126. # You can use Bitcoin or bitcoind to send commands to Bitcoin/bitcoind
  127. # running on another host using this option:
  128. #rpcconnect=127.0.0.1
  129.  
  130. # Create transactions that have enough fees so they are likely to begin confirmation within n blocks (default: 6).
  131. # This setting is over-ridden by the -paytxfee option.
  132. #txconfirmtarget=n
  133.  
  134. # Miscellaneous options
  135.  
  136. # Pre-generate this many public/private key pairs, so wallet backups will be valid for
  137. # both prior transactions and several dozen future transactions.
  138. #keypool=100
  139.  
  140. # Pay an optional transaction fee every time you send bitcoins. Transactions with fees
  141. # are more likely than free transactions to be included in generated blocks, so may
  142. # be validated sooner.
  143. #paytxfee=0.00
  144.  
  145. # Enable pruning to reduce storage requirements by deleting old blocks.
  146. # This mode is incompatible with -txindex and -rescan.
  147. # 0 = default (no pruning).
  148. # 1 = allows manual pruning via RPC.
  149. # >=550 = target to stay under in MiB.
  150. #prune=550
  151.  
  152. # User interface options
  153.  
  154. # Start Bitcoin minimized
  155. #min=1
  156.  
  157. # Minimize to the system tray
  158. #minimizetotray=1
  159.  
  160. # receiving raw transactions.
  161. zmqpubrawblock=tcp://127.0.0.1:28332
  162. zmqpubrawtx=tcp://127.0.0.1:28333
Add Comment
Please, Sign In to add comment