kaleido-cli 0.1.2__tar.gz → 0.1.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/PKG-INFO +1 -1
  2. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/__init__.py +1 -1
  3. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/node.py +58 -37
  4. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/config.py +0 -4
  5. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/pyproject.toml +1 -1
  6. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_cmd_node.py +36 -10
  7. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/uv.lock +1 -1
  8. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/.github/workflows/ci.yml +0 -0
  9. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/.github/workflows/publish.yml +0 -0
  10. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/.gitignore +0 -0
  11. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/LICENSE +0 -0
  12. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/Makefile +0 -0
  13. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/README.md +0 -0
  14. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/install.py +0 -0
  15. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/install.sh +0 -0
  16. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/__main__.py +0 -0
  17. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/app.py +0 -0
  18. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/__init__.py +0 -0
  19. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/asset.py +0 -0
  20. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/channel.py +0 -0
  21. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/config_cmd.py +0 -0
  22. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/market.py +0 -0
  23. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/node_swap.py +0 -0
  24. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/payment.py +0 -0
  25. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/peer.py +0 -0
  26. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/swap.py +0 -0
  27. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/commands/wallet.py +0 -0
  28. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/context.py +0 -0
  29. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/docker_manager.py +0 -0
  30. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/onboarding.py +0 -0
  31. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/output.py +0 -0
  32. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/utils/__init__.py +0 -0
  33. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/utils/assets.py +0 -0
  34. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/utils/channel_orders.py +0 -0
  35. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/utils/errors.py +0 -0
  36. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/utils/pairs.py +0 -0
  37. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/utils/prompts.py +0 -0
  38. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/utils/quotes.py +0 -0
  39. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/kaleido_cli/utils/swaps.py +0 -0
  40. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/__init__.py +0 -0
  41. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/conftest.py +0 -0
  42. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_cmd_asset_payment.py +0 -0
  43. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_cmd_config.py +0 -0
  44. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_cmd_market.py +0 -0
  45. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_cmd_swap.py +0 -0
  46. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_cmd_wallet.py +0 -0
  47. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_config.py +0 -0
  48. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_docker_manager.py +0 -0
  49. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_output.py +0 -0
  50. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_utils_assets.py +0 -0
  51. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_utils_errors.py +0 -0
  52. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_utils_prompts.py +0 -0
  53. {kaleido_cli-0.1.2 → kaleido_cli-0.1.3}/tests/test_utils_swaps.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: kaleido-cli
3
- Version: 0.1.2
3
+ Version: 0.1.3
4
4
  Summary: CLI for managing RGB Lightning Nodes and interacting with Kaleidoswap
5
5
  Project-URL: Homepage, https://kaleidoswap.com
6
6
  Project-URL: Repository, https://github.com/kaleidoswap/kaleido-cli
@@ -1,3 +1,3 @@
1
1
  """Kaleido CLI - manage RGB Lightning Nodes and interact with Kaleidoswap."""
2
2
 
3
- __version__ = "0.1.2"
3
+ __version__ = "0.1.3"
@@ -11,10 +11,6 @@ import typer
11
11
 
12
12
  from kaleido_cli.commands.node_swap import node_swap_app
13
13
  from kaleido_cli.config import (
14
- DEFAULT_BITCOIND_RPC_HOST,
15
- DEFAULT_BITCOIND_RPC_PASSWORD,
16
- DEFAULT_BITCOIND_RPC_PORT,
17
- DEFAULT_BITCOIND_RPC_USERNAME,
18
14
  DEFAULT_INDEXER_URL,
19
15
  DEFAULT_NETWORK,
20
16
  DEFAULT_PROXY_ENDPOINT,
@@ -650,19 +646,15 @@ async def _node_init(password: str, mnemonic: str | None) -> None:
650
646
  "[bold]Examples[/bold]\n\n"
651
647
  " Simple unlock (choose signet, regtest, or custom services):\n"
652
648
  " [cyan]kaleido node unlock[/cyan]\n\n"
653
- " Non-interactive signet defaults:\n"
649
+ " Non-interactive signet defaults (chain followed through the indexer):\n"
654
650
  " [cyan]kaleido --agent node unlock --password mysecret[/cyan]\n\n"
655
- " Sync from the indexer, without a bitcoind:\n"
656
- " [cyan]kaleido node unlock --chain-sync transaction \\\n"
657
- " --indexer-url electrum.example.com:50001[/cyan]\n\n"
658
- " Regtest defaults:\n"
659
- " [cyan]kaleido node unlock --bitcoind-user user --bitcoind-pass password \\\n"
651
+ " Regtest, following the chain through bitcoind:\n"
652
+ " [cyan]kaleido node unlock --chain-sync block \\\n"
653
+ " --bitcoind-user user --bitcoind-pass password \\\n"
660
654
  " --bitcoind-host regtest-bitcoind.rgbtools.org --bitcoind-port 80 \\\n"
661
655
  " --indexer-url electrum.rgbtools.org:50041[/cyan]\n\n"
662
- " Override bitcoind credentials:\n"
663
- " [cyan]kaleido node unlock --bitcoind-user alice --bitcoind-pass hunter2[/cyan]\n\n"
664
- " Full custom override:\n"
665
- " [cyan]kaleido node unlock \\\n"
656
+ " Full custom override with your own bitcoind:\n"
657
+ " [cyan]kaleido node unlock --chain-sync block \\\n"
666
658
  " --bitcoind-host 192.168.1.100 --bitcoind-port 18443 \\\n"
667
659
  " --bitcoind-user alice --bitcoind-pass hunter2 \\\n"
668
660
  " --indexer-url tcp://192.168.1.100:50001 \\\n"
@@ -685,29 +677,34 @@ def node_unlock(
685
677
  ChainSyncMode,
686
678
  typer.Option(
687
679
  "--chain-sync",
688
- help="How LDK follows the chain: 'block' via bitcoind, 'transaction' via the indexer.",
680
+ help=(
681
+ "How LDK follows the chain: 'transaction' via the indexer (default), "
682
+ "'block' via your own bitcoind (needs the --bitcoind-* options)."
683
+ ),
689
684
  ),
690
- ] = ChainSyncMode.BLOCK,
685
+ ] = ChainSyncMode.TRANSACTION,
691
686
  bitcoind_pass: Annotated[
692
- str,
687
+ str | None,
693
688
  typer.Option(
694
689
  "--bitcoind-pass",
695
- help="bitcoind RPC password. Ignored with --chain-sync transaction.",
690
+ help="bitcoind RPC password. Only with --chain-sync block.",
696
691
  hide_input=True,
697
692
  ),
698
- ] = DEFAULT_BITCOIND_RPC_PASSWORD,
693
+ ] = None,
699
694
  bitcoind_user: Annotated[
700
- str,
701
- typer.Option("--bitcoind-user", help="bitcoind RPC username."),
702
- ] = DEFAULT_BITCOIND_RPC_USERNAME,
695
+ str | None,
696
+ typer.Option(
697
+ "--bitcoind-user", help="bitcoind RPC username. Only with --chain-sync block."
698
+ ),
699
+ ] = None,
703
700
  bitcoind_host: Annotated[
704
- str,
705
- typer.Option("--bitcoind-host", help="bitcoind RPC host."),
706
- ] = DEFAULT_BITCOIND_RPC_HOST,
701
+ str | None,
702
+ typer.Option("--bitcoind-host", help="bitcoind RPC host. Only with --chain-sync block."),
703
+ ] = None,
707
704
  bitcoind_port: Annotated[
708
- int,
709
- typer.Option("--bitcoind-port", help="bitcoind RPC port."),
710
- ] = DEFAULT_BITCOIND_RPC_PORT,
705
+ int | None,
706
+ typer.Option("--bitcoind-port", help="bitcoind RPC port. Only with --chain-sync block."),
707
+ ] = None,
711
708
  indexer_url: Annotated[
712
709
  str,
713
710
  typer.Option(
@@ -740,15 +737,14 @@ def node_unlock(
740
737
 
741
738
  if is_interactive():
742
739
  profile = _prompt_unlock_service_profile()
743
- chain_sync = _prompt_chain_sync_mode(chain_sync)
744
740
  if profile == "signet":
745
- bitcoind_user = DEFAULT_BITCOIND_RPC_USERNAME
746
- bitcoind_pass = DEFAULT_BITCOIND_RPC_PASSWORD
747
- bitcoind_host = DEFAULT_BITCOIND_RPC_HOST
748
- bitcoind_port = DEFAULT_BITCOIND_RPC_PORT
741
+ # The signet defaults have no public bitcoind: the node follows the
742
+ # chain through the Esplora indexer.
743
+ chain_sync = ChainSyncMode.TRANSACTION
749
744
  indexer_url = DEFAULT_INDEXER_URL
750
745
  proxy_endpoint = DEFAULT_PROXY_ENDPOINT
751
746
  elif profile == "regtest":
747
+ chain_sync = _prompt_chain_sync_mode(ChainSyncMode.BLOCK)
752
748
  bitcoind_user = DEFAULT_REGTEST_BITCOIND_RPC_USERNAME
753
749
  bitcoind_pass = DEFAULT_REGTEST_BITCOIND_RPC_PASSWORD
754
750
  bitcoind_host = DEFAULT_REGTEST_BITCOIND_RPC_HOST
@@ -756,6 +752,7 @@ def node_unlock(
756
752
  indexer_url = DEFAULT_REGTEST_INDEXER_URL
757
753
  proxy_endpoint = DEFAULT_REGTEST_PROXY_ENDPOINT
758
754
  else:
755
+ chain_sync = _prompt_chain_sync_mode(chain_sync)
759
756
  if chain_sync is ChainSyncMode.BLOCK:
760
757
  bitcoind_user = typer.prompt("bitcoind RPC username", default=bitcoind_user)
761
758
  bitcoind_pass = typer.prompt(
@@ -774,6 +771,23 @@ def node_unlock(
774
771
  if raw.strip():
775
772
  announce_address = [raw.strip()]
776
773
 
774
+ if chain_sync is ChainSyncMode.BLOCK:
775
+ missing = [
776
+ flag
777
+ for flag, value in (
778
+ ("--bitcoind-host", bitcoind_host),
779
+ ("--bitcoind-port", bitcoind_port),
780
+ ("--bitcoind-user", bitcoind_user),
781
+ ("--bitcoind-pass", bitcoind_pass),
782
+ )
783
+ if value in (None, "")
784
+ ]
785
+ if missing:
786
+ print_error(
787
+ "--chain-sync block needs your own bitcoind: set " + ", ".join(missing) + "."
788
+ )
789
+ raise typer.Exit(1)
790
+
777
791
  asyncio.run(
778
792
  _node_unlock(
779
793
  password=resolved_password,
@@ -793,10 +807,10 @@ def node_unlock(
793
807
  async def _node_unlock(
794
808
  password: str,
795
809
  chain_sync: ChainSyncMode,
796
- bitcoind_user: str,
797
- bitcoind_pass: str,
798
- bitcoind_host: str,
799
- bitcoind_port: int,
810
+ bitcoind_user: str | None,
811
+ bitcoind_pass: str | None,
812
+ bitcoind_host: str | None,
813
+ bitcoind_port: int | None,
800
814
  indexer_url: str,
801
815
  proxy_endpoint: str,
802
816
  announce_alias: str,
@@ -817,6 +831,13 @@ async def _node_unlock(
817
831
  config=LdkTransactionSyncConfig(indexer_url=indexer_url),
818
832
  )
819
833
  else:
834
+ if (
835
+ bitcoind_user is None
836
+ or bitcoind_pass is None
837
+ or bitcoind_host is None
838
+ or bitcoind_port is None
839
+ ):
840
+ raise ValueError("BlockSync needs the bitcoind RPC settings")
820
841
  ldk_chain_sync = LdkChainSyncBlockSync(
821
842
  mode="BlockSync",
822
843
  config=LdkBlockSyncConfig(
@@ -16,10 +16,6 @@ DEFAULT_NETWORK = "mutinynet"
16
16
  RLN_SIGNET_CUSTOM_NETWORK = "signetcustom"
17
17
  MUTINYNET_ALIASES = {"mutinynet", "signetcustom", "customsignet"}
18
18
 
19
- DEFAULT_BITCOIND_RPC_USERNAME = "user"
20
- DEFAULT_BITCOIND_RPC_PASSWORD = "default_password"
21
- DEFAULT_BITCOIND_RPC_HOST = "bitcoind.signet.kaleidoswap.com"
22
- DEFAULT_BITCOIND_RPC_PORT = 38332
23
19
  DEFAULT_INDEXER_URL = "https://esplora.signet.kaleidoswap.com"
24
20
  DEFAULT_PROXY_ENDPOINT = "rpcs://proxy.iriswallet.com/0.2/json-rpc"
25
21
 
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "kaleido-cli"
7
- version = "0.1.2"
7
+ version = "0.1.3"
8
8
  description = "CLI for managing RGB Lightning Nodes and interacting with Kaleidoswap"
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -4,10 +4,6 @@ from __future__ import annotations
4
4
 
5
5
  from kaleido_cli.app import app
6
6
  from kaleido_cli.config import (
7
- DEFAULT_BITCOIND_RPC_HOST,
8
- DEFAULT_BITCOIND_RPC_PASSWORD,
9
- DEFAULT_BITCOIND_RPC_PORT,
10
- DEFAULT_BITCOIND_RPC_USERNAME,
11
7
  DEFAULT_INDEXER_URL,
12
8
  DEFAULT_REGTEST_BITCOIND_RPC_HOST,
13
9
  DEFAULT_REGTEST_BITCOIND_RPC_PASSWORD,
@@ -29,16 +25,13 @@ def _block_sync_config(req):
29
25
  def test_node_unlock_interactive_signet_defaults(runner, mocker, mock_client):
30
26
  mocker.patch("kaleido_cli.commands.node.is_interactive", return_value=True)
31
27
 
32
- result = runner.invoke(app, ["node", "unlock"], input="walletpw\ns\nb\n\n\n")
28
+ result = runner.invoke(app, ["node", "unlock"], input="walletpw\ns\n\n\n")
33
29
 
34
30
  assert result.exit_code == 0
35
31
  req = _unlock_request(mock_client)
36
32
  assert req.password == "walletpw"
37
- config = _block_sync_config(req)
38
- assert config.bitcoind_rpc_username == DEFAULT_BITCOIND_RPC_USERNAME
39
- assert config.bitcoind_rpc_password == DEFAULT_BITCOIND_RPC_PASSWORD
40
- assert config.bitcoind_rpc_host == DEFAULT_BITCOIND_RPC_HOST
41
- assert config.bitcoind_rpc_port == DEFAULT_BITCOIND_RPC_PORT
33
+ assert req.ldk_chain_sync.mode == "TransactionSync"
34
+ assert req.ldk_chain_sync.config.indexer_url == DEFAULT_INDEXER_URL
42
35
  assert req.indexer_url == DEFAULT_INDEXER_URL
43
36
 
44
37
 
@@ -129,3 +122,36 @@ def test_node_unlock_non_interactive_transaction_sync(runner, mocker, mock_clien
129
122
  req = _unlock_request(mock_client)
130
123
  assert req.ldk_chain_sync.mode == "TransactionSync"
131
124
  assert req.ldk_chain_sync.config.indexer_url == "electrum.example.com:50001"
125
+
126
+
127
+ def test_node_unlock_non_interactive_defaults_to_transaction_sync(runner, mocker, mock_client):
128
+ mocker.patch("kaleido_cli.commands.node.is_interactive", return_value=False)
129
+
130
+ result = runner.invoke(app, ["node", "unlock", "--password", "walletpw"])
131
+
132
+ assert result.exit_code == 0
133
+ req = _unlock_request(mock_client)
134
+ assert req.ldk_chain_sync.mode == "TransactionSync"
135
+ assert req.ldk_chain_sync.config.indexer_url == DEFAULT_INDEXER_URL
136
+
137
+
138
+ def test_node_unlock_block_sync_requires_bitcoind(runner, mocker, mock_client):
139
+ mocker.patch("kaleido_cli.commands.node.is_interactive", return_value=False)
140
+
141
+ result = runner.invoke(
142
+ app,
143
+ [
144
+ "node",
145
+ "unlock",
146
+ "--password",
147
+ "walletpw",
148
+ "--chain-sync",
149
+ "block",
150
+ "--bitcoind-host",
151
+ "h",
152
+ ],
153
+ )
154
+
155
+ assert result.exit_code == 1
156
+ assert "--bitcoind-port" in result.output
157
+ mock_client.rln.unlock_wallet.assert_not_awaited()
@@ -142,7 +142,7 @@ wheels = [
142
142
 
143
143
  [[package]]
144
144
  name = "kaleido-cli"
145
- version = "0.1.2"
145
+ version = "0.1.3"
146
146
  source = { editable = "." }
147
147
  dependencies = [
148
148
  { name = "kaleido-sdk" },
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes