Skip to content

[testnet][web] separate Client from RunningClient to support early calls to ad…#5916

Closed
ma2bd wants to merge 3 commits into
linera-io:testnet_conwayfrom
ma2bd:add_owner
Closed

[testnet][web] separate Client from RunningClient to support early calls to ad…#5916
ma2bd wants to merge 3 commits into
linera-io:testnet_conwayfrom
ma2bd:add_owner

Conversation

@ma2bd
Copy link
Copy Markdown
Contributor

@ma2bd ma2bd commented Apr 5, 2026

Motivation

support early calls to add chain owners

Proposal

  • separate Client from RunningClient
  • Client supports add_owner and start
  • RunningClient supports stop

Test Plan

CI

@ma2bd ma2bd marked this pull request as ready for review April 5, 2026 01:20
@ma2bd ma2bd requested a review from Twey April 5, 2026 01:21
@ma2bd ma2bd changed the title [web] separate Client from RunningClient to support early calls to ad… [testnet][web] separate Client from RunningClient to support early calls to ad… Apr 7, 2026
const owner = signer.address();
const chainId = await faucet.claimChain(wallet, owner);
const client = await new linera.Client(wallet, signer);
const client = await (await new linera.Client(wallet, signer)).start();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While maintaining the Client/RunningClient distinction in the statics on the Rust side is nice, I'm not sure about exposing it to JavaScript where the original object is still accessible. If anything I think a more idiomatic pattern might be for start() to return an object representing the additional capabilities.

Comment on lines +185 to +186
Some(e) => Error::from(e),
None => Error::new("chain listener error (details unavailable)"),
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: unwrap_or_else


if let Err(Some(e)) = self.chain_listener_result.await.map_err(Rc::into_inner) {
return Err(e.into());
if let Err(e) = self.chain_listener_handle.await {
Copy link
Copy Markdown
Contributor

@Twey Twey Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm a bit confused about this: the Storage is carefully threaded all the way back from the chain listener task in linera-client, but then here it's dropped on the floor — maybe a rebase artifact? We assume the storage is Clone everywhere right now, so I'm not sure what the motivation would be for wanting this particular copy of it.

@ma2bd
Copy link
Copy Markdown
Contributor Author

ma2bd commented Apr 7, 2026

closing in favor of #5937

@ma2bd ma2bd closed this Apr 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants