Why getblockhash is not a function


#1

I try to connect to litecoin core and I have this error msg:

clientLTC.getBlockHash is not a function

I asked my question here but no answer yet:

Any suggestion ?

Thanks
JF


#2

what program are you using? that is not a core wallet command that looks like a pytohn command or something

I think its getblocktemplate under console in core

Open your wallet and click command line options…


#3

I use litecoin library from npm with nodejs:
var litecoin = require(‘litecoin’);


#4

I don’t use a wallet: I use litecoin to access the node and make my own wallet.


#5

Ic… I can’t help there them…i only know core wallets myself and havnt built my own wallet yet…are u using Java or c++?


#6

I use nodejs


#7

Finally I found a package that seems to work: node-litecoin
https://www.npmjs.com/package/node-litecoin


#8

There is a few YouTube video on node.js for bitcoin…not too sure how much it will help u though

What exactly are u trying to do?

I would look up the node.js github page and see what the equivalent is for getblockhash…like I said I am pretty sure you have to get the format or template first then get the last blockhash …

U could try getblocktemplate(TX id)

If you are trying to get the block hash containing a transaction…
In core wallet its decodetransaction (TX id)
And that returns the block hash the transaction is in