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
note: for more details see https://doc.rust-lang.org/cargo/reference/resolver.html#resolver-versions
Compiling spl-associated-token-account v2.3.0
Compiling solana-account-decoder v1.18.23
Compiling lava-config v0.1.0 (/home/vincent/github/work/lava/lava-mono/lava-config)
Compiling loans-core v0.1.0 (/home/vincent/github/work/lava/lava-mono/loans-core/core)
error[E0277]: the trait bound `MultiOracleTrieWithDiff: _::_serde::Serialize` is not satisfied
--> /home/vincent/github/work/lava/lava-mono/loans-core/core/src/oracle_engine.rs:24:42
|
24 | #[cfg_attr(feature = "use-serde", derive(Serialize, Deserialize))]
| ^^^^^^^^^ the trait `_::_serde::Serialize` is not implemented for `MultiOracleTrieWithDiff`, which is required by `Vec<MultiOracleTrieWithDiff>: _::_serde::Serialize`
This file has been truncated, but you can view the full file.
2024-08-20 15:45:51 INFO [ldk_node::builder:925] Successfully migrated OutputSweeper data.
2024-08-20 15:45:51 INFO [ldk_node:238] Starting up LDK Node with node ID 02e78d2a8dd545f4eb2f48d90aa06207eb4001cd4efd1d282aff3a9babcfd1a1a9 on network: bitcoin
2024-08-20 15:45:56 ERROR [ldk_node::fee_estimator:46] Updating fee rate estimates timed out: deadline has elapsed
2024-08-20 15:45:56 ERROR [ldk_node:267] Initial fee rate cache update failed: Updating fee rate estimates timed out.
2024-08-20 15:46:35 INFO [ldk_node::builder:925] Successfully migrated OutputSweeper data.
2024-08-20 15:46:35 INFO [ldk_node:238] Starting up LDK Node with node ID 02e78d2a8dd545f4eb2f48d90aa06207eb4001cd4efd1d282aff3a9babcfd1a1a9 on network: bitcoin
2024-08-20 15:46:40 ERROR [ldk_node::fee_estimator:46] Updating fee rate estimates timed out: deadline has elapsed
2024-08-20 15:46:40 ERROR [ldk_node:267] Initial fee rate cache update failed: Updating fee rate estimates timed out.
2024-08-20 15:46:53 INFO [ldk_node::builder:925]
2024-08-19 17:27:20 INFO [ldk_node::builder:925] Successfully migrated OutputSweeper data.
2024-08-19 17:27:20 INFO [ldk_node:238] Starting up LDK Node with node ID 03f10e1b18a6d3e034ff4cec935ef24fe8410960302043d304aa72916e9d1c9111 on network: bitcoin
2024-08-19 17:27:22 TRACE [ldk_node::fee_estimator:109] Fee rate estimation updated for OnChainSweep: 1053 sats/kwu
2024-08-19 17:27:22 TRACE [ldk_node::fee_estimator:109] Fee rate estimation updated for MinAllowedAnchorChannelRemoteFee: 622 sats/kwu
2024-08-19 17:27:22 TRACE [ldk_node::fee_estimator:109] Fee rate estimation updated for MinAllowedNonAnchorChannelRemoteFee: 372 sats/kwu
2024-08-19 17:27:22 TRACE [ldk_node::fee_estimator:109] Fee rate estimation updated for AnchorChannelFee: 622 sats/kwu
2024-08-19 17:27:22 TRACE [ldk_node::fee_estimator:109] Fee rate estimation updated for NonAnchorChannelFee: 962 sats/kwu
2024-08-19 17:27:22 TRACE [ldk_node::fee_estimator:109] Fee rate estimation updated for ChannelCloseMinimum: 622 sats/kwu
2024-08-19 17:27:2
➜ 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