Coder Social home page Coder Social logo

Comments (13)

janoside avatar janoside commented on July 23, 2024

@apbendi Can you check what your latest commit is? Trying to reproduce on the demo site I'm not seeing the error for that particular block: https://btc.chaintools.io/block-height/535967

Another question: do you have pruning active on your node?

Glad you're enjoying the tool!

from btc-rpc-explorer.

apbendi avatar apbendi commented on July 23, 2024

Thanks for the fast reply! I cloned master just a few minutes before reporting the issue. The issue seems to occur for all blocks-- I tried with a series of recent blocks, as well as the genesis block, and received the same error. My node is not pruning-- I'm in sync with the full chain and can run curl on any block to get the block data. The rest of the block explorer seems to work fine!

Just in case it matters, my node is not the same machine as the one running the explorer. The node is running Linux and is on the same LAN. The local IP of my Mac (where the explorer is running) is whitelisted in my node's config, and, as mentioned, can make RPC calls via curl w/o issue.

Let me know if theres anything I can do to help debug the issue on my end. Thanks!

from btc-rpc-explorer.

janoside avatar janoside commented on July 23, 2024

Thanks for the additional info. Given the error you're seeing, your setup (linux node, mac explorer) shouldn't be the cause.

Another question: What version is your node? I'm currently running "/Satoshi:0.16.0/" both locally and on the demo server (haven't gotten around to upgrading to 0.16.2 yet)

I just pushed some code that could help in debugging. If you update to at least commit a53e92f and navigate to a block-details page I'm hoping that some of the code changes at least provide some armor against the specific error you're seeing and may give some additional debugging insight.

from btc-rpc-explorer.

janoside avatar janoside commented on July 23, 2024

Hmmm, this has me scratching my head a bit, mostly because I can't think of what could be different between your env and mine. I see some brittle, error-prone code related to the errors you're seeing, but again, I can't tell why you're seeing errors and I'm not. I'd like to improve the error-prone code, but hopefully get you up and running before that.

I have a couple more commits you can try out and let me know. I appreciate your report and your help resolving.

from btc-rpc-explorer.

apbendi avatar apbendi commented on July 23, 2024

I'll try your commits-- but it just occurred to me I'm on a rather old version of node v7.9.0. Any chance this could be part of the problem?

from btc-rpc-explorer.

apbendi avatar apbendi commented on July 23, 2024

So this is very weird! I updated to node 10.x and also pulled down your latest commits. I'm still seeing errors, but now it's about 50% of the time. The rest seem to work.

/Users/redacted/Development/btc-rpc-explorer/views/includes/transaction-io-details.pug:4 2| - var fontawesomeOutputName = "sign-out-alt"; 3| > 4| - var totalIOValues = utils.getTxTotalInputOutputValues(tx, txInputs, blockHeight); 5| 6| div(class="row") 7| div(class="col-md-6") Cannot read property 'length' of undefined

TypeError: /Users/redacted/Development/btc-rpc-explorer/views/includes/transaction-io-details.pug:4
    2| - var fontawesomeOutputName = "sign-out-alt";
    3| 
  > 4| - var totalIOValues = utils.getTxTotalInputOutputValues(tx, txInputs, blockHeight);
    5| 
    6| div(class="row")
    7| 	div(class="col-md-6")

Cannot read property 'length' of undefined
    at Object.getTxTotalInputOutputValues (/Users/redacted/Development/btc-rpc-explorer/app/utils.js:220:29)
    at eval (eval at wrap (/Users/redacted/Development/btc-rpc-explorer/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:1129:27)
    at eval (eval at wrap (/Users/redacted/Development/btc-rpc-explorer/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:2531:4)
    at template (eval at wrap (/Users/redacted/Development/btc-rpc-explorer/node_modules/pug-runtime/wrap.js:6:10), <anonymous>:2948:72)
    at Object.exports.renderFile (/Users/redacted/Development/btc-rpc-explorer/node_modules/pug/lib/index.js:427:38)
    at Object.exports.renderFile (/Users/redacted/Development/btc-rpc-explorer/node_modules/pug/lib/index.js:417:21)
    at exports.__express (/Users/redacted/Development/btc-rpc-explorer/node_modules/pug/lib/index.js:464:11)
    at View.app.engine (/Users/redacted/Development/btc-rpc-explorer/app.js:39:23)
    at View.render (/Users/redacted/Development/btc-rpc-explorer/node_modules/express/lib/view.js:135:8)
    at tryRender (/Users/redacted/Development/btc-rpc-explorer/node_modules/express/lib/application.js:640:10)
    at Function.render (/Users/redacted/Development/btc-rpc-explorer/node_modules/express/lib/application.js:592:3)
    at ServerResponse.render (/Users/redacted/Development/btc-rpc-explorer/node_modules/express/lib/response.js:1008:7)
    at /Users/redacted/Development/btc-rpc-explorer/routes/baseActionsRouter.js:439:7
    at process._tickCallback (internal/process/next_tick.js:68:7)

from btc-rpc-explorer.

janoside avatar janoside commented on July 23, 2024

Interesting. So do you mean that you can refresh the same page and it will work 50% of the time, or that 50% of blocks that you view result in errors? I'm hoping for the latter option, in which case I have a handle on something concrete. There's another commit you can try which I'm hoping could get you most of the way there while I address the remaining issue.

from btc-rpc-explorer.

janoside avatar janoside commented on July 23, 2024

Eh...I'm doubting the idea I had a little bit ago. But still let me know about the latest commits.

from btc-rpc-explorer.

apbendi avatar apbendi commented on July 23, 2024

I should have some time to play with this again tomorrow and I'll let you know. Thanks!

from btc-rpc-explorer.

janoside avatar janoside commented on July 23, 2024

@apbendi Any update on this?

from btc-rpc-explorer.

apbendi avatar apbendi commented on July 23, 2024

Hey @janoside, gonna look into it this afternoon. Thanks for your patience!

from btc-rpc-explorer.

apbendi avatar apbendi commented on July 23, 2024

So, embarrassingly, I had a typo in my bitcoin.conf file such that txindex was not turned on. Currently reindexing my blocks. The reason it worked sometime is that transactions that were still/recently in the mempool would return. When blocks got stale, it would fail.

One useful thing here, for other dummies like me, might be to look for the error message returned by the node when asking for a transaction that is not indexed, and then display something helpful in the UI. Anyway, closing this issue out.

By the way, I wrote up a guide for running a full node as a developer, and included running your explorer as part of it. Thought you might enjoy: https://www.buildblockchain.tech/blog/btc-node-developers-guide

Thanks for an awesome tool! Cheers!

from btc-rpc-explorer.

janoside avatar janoside commented on July 23, 2024

Ah-ha! Thanks for the update. I'm glad we got to the bottom of this. I like your idea concerning the error-message detail and created #50 to track it. Thanks so much for your full-node-with-explorer guide...that's awesome!

from btc-rpc-explorer.

Related Issues (20)

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.