You should use the gettransaction (TXID) command that returns information about a transaction belonging to your wallet. Then just check the confirmations field.
Sample Call: bitcoin-cli -testnet gettransaction 5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589
Sample Response:
{
"amount" : 0.00000000,
"fee" : 0.00000000,
"confirmations" : 106670,
"blockhash" : "000000008b630b3aae99b6fe215548168bed92167c47a2f7ad4df41e571bcb51",
"blockindex" : 1,
"blocktime" : 1396321351,
"txid" : "5a7d24cd665108c66b2d56146f244932edae4e2376b561b3d396d5ae017b9589",
"walletconflicts" : [
],
"time" : 1396321351,
"timereceived" : 1418924711,
"bip125-replaceable" : "no",
"details" : [
{
"account" : "",
"address" : "mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN",
"category" : "send",
"amount" : -0.10000000,
"vout" : 0,
"fee" : 0.00000000
},
{
"account" : "doc test",
"address" : "mjSk1Ny9spzU2fouzYgLqGUD8U41iR35QN",
"category" : "receive",
"amount" : 0.10000000,
"vout" : 0
}
],
"hex" : "0100000001cde58f2e37d000eabbb60d9cf0b79ddf67cede6dba58732539983fa341dd5e6c010000006a47304402201feaf12908260f666ab369bb8753cdc12f78d0c8bdfdef997da17acff502d321022049ba0b80945a7192e631c03bafd5c6dc3c7cb35ac5c1c0ffb9e22fec86dd311c01210321eeeb46fd878ce8e62d5e0f408a0eab41d7c3a7872dc836ce360439536e423dffffffff0180969800000000001976a9142b14950b8d31620c6cc923c5408a701b1ec0a02088ac00000000"
}
Reference: https://bitcoin.org/en/developer-reference#gettransaction
You don't need to do anything. Your lightning client needs to somehow learn about incoming transactions, and it uses the node it's pointed to for that. If that is a full node you trust (because you operate it yourself), you automatically get that trust carried over to your lightning client. – Pieter Wuille – 2019-04-08T19:34:28.423
@PieterWuille yeh i have no issues when i receive/send thru my node. My issue was more related when i do external tx, for example when a friend sends me to an address generated from my hw and the latter isn’t specially used with the full node. – Lebowski – 2019-04-08T19:42:30.047
@Lebwoski If you're talking about another wallet, the answer is the same: make that wallet use your full node for validation (many wallet implementations let you select a trusted full node to connect to). – Pieter Wuille – 2019-04-08T20:47:55.410
@PieterWuille unfortunetly not the ledger live :( ! But soon willl start using it either with bitcoin core or electrum personal server ! Thanks again for the heads up! – Lebowski – 2019-04-08T21:09:53.700