Skip to content

Instantly share code, notes, and snippets.

View vincenzopalazzo's full-sized avatar
:octocat:
The commit can contain poetry

Vincenzo Palazzo vincenzopalazzo

:octocat:
The commit can contain poetry
View GitHub Profile
➜ VincentSSD clightning decode lno1qsgxeghagrrs3fygrz74wxpskwfpsyxvqttftvqu0f5sneckep3lkwdut7mmhhpcyjmlmnjn4hze8ed7pq88xqs35u5wdnnnhpw53ntuems6qs8hggqac250urm6dl9vlpq9f2q2ucpq9kpa4r734cduc7lkt7gl0dcqn0ku648u9q9v643jsl6ec2kkgge4qqemsc8plk5hd96ljealz9cs9d3exlxw8jg876k2sv25kyk2dgyw7r3ry7fnn4f32d4g5lqy8n3qtqfr7zcecqm4ur8msqhfkuw0a3t75njaksj22ch9zhr43j6fjfntzqmgyacl6gqpq5lxewmaz5v5ktqww0qlv7m25kckyyp5zf4cqk35j2mfa23t9c8ukmtpu66vjca5d8xvp6zu3wuup7y28ss
{
"type": "bolt12 offer",
"offer_id": "bb68a56239383eeb06f1301fc6e6102486fcb4bf2fac05b2d22c67d7b2e9e2c0",
"offer_metadata": "6ca2fd40c708a48818bd571830b39218",
"warning_missing_offer_description": "offers without a description are invalid",
"offer_paths": [
{
"first_node_id": "02d695b01c7a6909e716c863fb39bc5fb7bbdc3824b7fdce53adc593e5be080e73",
"blinding": "0211a728e6ce73b85d48cd7ccee1a040f74201dc2a8fe0f7a6fcacf84054a80ae6",
➜ sdk-cli git:(main) ✗ cargo run
Compiling gl-client v0.2.0 (https://github.com/Blockstream/greenlight.git?rev=e38a37613da7558c853f24be700c193f194a6bc9#e38a3761)
error[E0412]: cannot find type `DelexpiredinvoiceRequest` in module `cln`
--> /home/vincent/.cargo/git/checkouts/greenlight-e41cf58dbd255ee0/e38a376/libs/gl-client/src/signer/model/mod.rs:41:28
|
41 | DelExpiredInvoice(cln::DelexpiredinvoiceRequest),
| ^^^^^^^^^^^^^^^^^^^^^^^^ help: a struct with a similar name exists: `DelinvoiceRequest`
|
::: /home/vincent/github/work/breez-sdk/tools/sdk-cli/target/debug/build/cln-grpc-7a25774ebd2ceb74/out/cln.rs:1800:1
|
@vincenzopalazzo
vincenzopalazzo / lampo_sdk.rs
Last active June 11, 2024 15:14
A example of the lampo SDK usage
let mut lampo_conf = LampoConf::new(/* path */, /* network */, /* port */)?;
/* Creating the wallet */
let (wallet, mnemonic) = CoreWalletManager::new(Arc::new(lampo_conf.clone()))?;
let wallet = Arc::new(wallet);
/* Create the deamon */
let mut lampo = LampoDaemon::new(lampo_conf.clone(), wallet.clone());
/* Create the bitcoin backend */
let node = BitcoinCore::new(
&format!("127.0.0.1:{}", btc.port),
2024-05-08T13:02:05-07:00 2024-05-08T20:02:05.827Z INFO lightningd: Sending 1950639900msat in onion to deliver 1950634000msat
2024-05-08T13:02:09-07:00 2024-05-08T20:02:09.226Z INFO 03cde60a6323f7122d5178255766e38114b4722ede08f7c9e0c5df9b912cc201d6-chan#4: htlc 50 failed from 1th node with code 0x1007 (WIRE_TEMPORARY_CHANNEL_FAILURE)
2024-05-08T13:02:09-07:00 2024-05-08T20:02:09.260Z INFO plugin-pay: cmd 34 partid 2: failed: WIRE_TEMPORARY_CHANNEL_FAILURE (reply from remote)
2024-05-08T13:02:09-07:00 2024-05-08T20:02:09.315Z INFO plugin-pay: cmd 34 partid 3: Failing a partial payment due to a failed RPC call: {\"code\":204,\"message\":\"No connection to first peer found\",\"data\":{\"erring_index\":0,\"failcode\":16394,\"failcodename\":\"WIRE_UNKNOWN_NEXT_PEER\",\"erring_node\":\"03584b470de02725bf315afd6d9742a7986da300e144c0c77c8392fd336150e196\"}}
2024-05-08T13:02:09-07:00 2024-05-08T20:02:09.379Z INFO plugin-pay: cmd 34 partid 4: Failing a partial payment due to a failed RPC call: {\"co
➜ VincentSSD clightning --signet invoice 5000sat "lampo-test-7" "this is an invoice payed by lampo"
{
"payment_hash": "5729b4345dbec9d14afa20e4368401a085788ed0d4448fa12f5ddc3875a83427",
"expires_at": 1712434584,
"bolt11": "lntbs50u1pnqsuccsp5jmzm2d28sfcmwrlxhd5lvhnmzmr739u227pey64fycu7t2atacfqpp52u5mgdzahmyazjh6yrjrdpqp5zzh3rks63zglgf0thwrsadgxsnsdp4w35xjueqd9ejqctwyp5kuan0d93k2grsv9uk2epqvfujqmrpd4cx7xqyjw5qcqp29qx3qysgqhw9w5c40ty5xatezwnjhqtc8s28ehy6ykgh9fhs0s43pdslygvd4uemd9u7vw0tyrle8j45p9gp9ax90e7usn3r0jn6w8mnq9v5wwrcpkw9avz",
"payment_secret": "96c5b535478271b70fe6bb69f65e7b16c7e8978a5783926aa92639e5ababee12",
"created_index": 11,
"warning_deadends": "Insufficient incoming capacity, once dead-end peers were excluded"
}
➜ VincentSSD lampo-cli --network signet pay --invoice_str lntbs50u1pnqsuccsp5jmzm2d28sfcmwrlxhd5lvhnmzmr739u227pey64fycu7t2atacfqpp52u5mgdzahmyazjh6yrjrdpqp5zzh3rks63zglgf0thwrsadgxsnsdp4w35xjueqd9ejqctwyp5kuan0d93k2grsv9uk2epqvfujqmrpd4cx7xqyjw5qcqp29qx3qysgqhw9w5c40t
➜ ~ hal tx decode 02000000000103d52702d3b4750de9020d3c06bf3f9072c0c9aac7e16f7ad1a50d184eecf251de0000000000fdffffff132cf0d8e9fe562ad44795c54b6b577d92c36e85d116aed7a319e31e038473300000000000fdffffff671732d17fa123466902570f27b52d66d445fa490fe3791dd2e674b1085a7e950000000000fdffffff0280841e0000000000160014810d9272e9d0667da860c7f62635b57c3f1d080552270200000000002251202d745b9d03756215621ee109b2374176bcb525f296785832905de16102503ce502473044022003aefa0cf026f208dbffae91d3d6a6659cb55f94e62df8aec53cfa71b15a681302202a5b4261e78a48c848523174cbfbd92bcd4177a6b04d6acbbdb7eee06700f4c40121028c1ac4c38717ca6b2bd4b9d07aa8b5a4f7cc1bf062f633f9545ef89486bab4ee02473044022079a798ba41ebd92deb51d6978e7c02bf769816e01f713cdb2b703b6bc1173de602206a04a2ae0855a009b9fb5c0fe4c2133a1caaa41198daaf32d31afc8ad246bd5a012102a9fa96b2fb2d17e735526f2c5cf6e5a92d6b11a67a8556ad6e8bfae0924eb1cc024730440220415088e41558f13598e8bc56b8ef628dd2755155f32fa53adb3ae93b701f772e022019fcf5ada0db0c10a0f2867bb43bcf512f2fe1247d6afbcc45a17114822530a9012103c0102d5d292ea285f
➜ ~ lightning-cli withdraw bc1qsyxeyuhf6pn8m2rqclmzvdd40sl36zq9jn77n2 all
{
"tx": "02000000626667c4622028f855c35698c18541df952bfe7b7297f106f4835f2f409c66d0620100000000fdffffff83280373570d300660da44f780ef06b4eb9bffd43d12a9415a6696940a295df80100000000fdffffffc9c3f0845f368c00a857774ce96204fd22709b3d24de1847550d1161ea67cff30100000000fdffffff5552586f8e59ea1611bfabde9a83718c496e34ce1de35f48dad2d89f86aca1430000000000fdffffffd2ac6ddfde69a02da39eb8ad6b11a7c43b3050ca9eb254a91079ddb9b6aee8a30000000000fdffffff5bb9b3aaa281d0e8759db42da2f029e0ec4f84fa725c5b220137e30bd90ed3520000000000fdffffffb188900d8ac82ae5d3875744c765c9f8c374cd090b8d6029d551a13884c21eb00000000000fdffffff671732d17fa123466902570f27b52d66d445fa490fe3791dd2e674b1085a7e950000000000fdffffff951ca00b853f85f7cd942d269a4772aae6dda469ff2160109a5b46f0d17d1a3f0000000000fdffffff5f5dcf8f3faa794c744085ac4d6e9abe5e93b85f374c301bc2c5a75c113f23800000000000fdffffffe02c99511e9995388c91ae5b46a9baa42327386c8852063e8d1b9e27515693670100000000fdffffff655734e5396fffafeeed1e6d3
2023-10-27T18:17:57.015Z TRACE lampo_channel_manager event received ConfirmedTransaction(txid: e0cfeebb1ab5cc889eca5c6316b4b63b4f0de2513e3dc626bd506ce56172521b, idx 1, block: BlockHeader { version: 536870912, prev_blockhash: 33ae0403da6c219069cc059ecbba7ae9ef7cb7adb3f35c7c7aa356b4b864a37f, merkle_root: 20e3543509f2023693d4e0997888bb0c74327862f65fa146d62358913bd2e5da, time: 1698430686, bits: 545259519, nonce: 0 }, height: 102). [lampod/src/ln/channe_manager.rs:150]
2023-10-27T18:17:57.015Z DEBUG lampo_channel_manager confirmed transaction with txid `e0cfeebb1ab5cc889eca5c6316b4b63b4f0de2513e3dc626bd506ce56172521b` at height `102`. [lampod/src/ln/channe_manager.rs:160]
2023-10-27T18:17:57.015Z DEBUG ldk lightning::chain::chainmonitor:666 DEBUG 1 provided transactions confirmed at height 102 in block 056112c97b4caf14f3479bd70d9efa8424d8214d52ebf42d2f0668557b959586. [lampod/src/utils/logger.rs:46]
2023-10-27T18:17:57.015Z TRACE ldk lightning::chain::channelmonitor:3567 TRACE Processing 0 matched transactions for
test -f config.h || (rm -f stamp-h1 && make stamp-h1)
g++ -std=c++11 -I../../../../gittea/open-source/gcc/libcpp -I. -I../../../../gittea/open-source/gcc/libcpp/../include -I../../../../gittea/open-source/gcc/libcpp/include -g -O2 -W -Wall -Wno-narrowing -Wwrite-strings -Wmissing-format-attribute -pedantic -Wno-long-long -fno-exceptions -fno-rtti -I../../../../gittea/open-source/gcc/libcpp -I. -I../../../../gittea/open-source/gcc/libcpp/../include -I../../../../gittea/open-source/gcc/libcpp/include -c -o expr.o -MT expr.o -MMD -MP -MF .deps/expr.Tpo ../../../../gittea/open-source/gcc/libcpp/expr.cc
../../../../gittea/open-source/gcc/libcpp/expr.cc: In function 'unsigned int cpp_classify_number(cpp_reader*, const cpp_token*, const char**, location_t)':
../../../../gittea/open-source/gcc/libcpp/expr.cc:842:35: error: format not a string literal and no format arguments [-Werror=format-security]
842 | cpp_warning_with_line (pfile, CPP_W_LONG_LONG, virtual_location,
| ~~
[nix-shell:~/gittea/poke]$ cat config.log | grep readline
PATH: /nix/store/p42fvwnx9pcp5ijrj5n5qqqfbqimhrkv-readline-8.2p1/bin/
configure:59137: checking for readline
configure:59163: gcc -o conftest -g -O2 conftest.c -lreadline >&5
configure:59193: checking how to link with libreadline
configure:59195: result: -lreadline
configure:59205: checking for readline/readline.h
configure:59211: checking for readline/history.h
ac_cv_header_readline_history_h=yes
ac_cv_header_readline_readline_h=yes