contract alias ls can't be used from a script

Đang mở
#2,879 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
35/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

The work is in cmd/soroban-cli/src/commands/contract/alias/ls.rs: the networks are collected into a HashMap around lines 56-58 and printed with headers around lines 114-128. Read that file alongside alias show, and check how the Output system (#2635) is used by other commands. Done when one network's aliases can be requested as data, two runs give identical output, and the default listing still reads well.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

What's wrong:
stellar contract alias ls lists every configured network at once, prints an "ℹ️ Aliases available for network '...'" header on stdout for each (also with -q), and has no way to pick a network or get the result as data (v28.1.0 alias/ls.rs#L114-L128). The networks also come out in a different order on every run, because they're collected in a HashMap (v28.1.0 alias/ls.rs#L56-L58); four runs with the 28.1.0 binary gave four different orders. contract alias show <name> --network <net> already returns a single ID.

Impact:
Anything that needs the list of contracts deployed on a network (a frontend build, CI, an agent, or the JS SDK's bindings plugin, which can't take aliases today, stellar/js-stellar-sdk#1755) has to parse text meant for people, and can't diff two runs.

How we found it:
HackMeridian 2026 tooling research (147 public hackathon repos): 18 of the 66 repos with CLI scripts used aliases, and several still copied contract IDs into env files by hand because their app needed them at build time. Reproduced with the 28.1.0 release binary on 1 November 2026. In #1971, maintainers suggested structured output for this command and chose to wait until someone asked for it; this is that ask.

Outcome we're after:
A script can get one network's aliases as data, the same way on every run. How to get there is up to the implementer.

Compatibility: People reading the default output keep a readable listing.

How to check:

  • Two runs in a row give identical output.
  • A script can get the aliases for one network without stripping headers or other networks' entries.
  • The default output still reads well for a person.

Related: #1971 (closed; the same command's output on stdout), #2622 (structured output), #2635 (the Output system), stellar/js-stellar-sdk#1755.

Ngôn ngữ chính
Rust
Star
129
Fork
153
Merge trung bình
1 ngày 14 giờ
Pull request đã merge (30 ngày)
11

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của stellar/stellar-cli

Tất cả issue của stellar/stellar-cli

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.