-
Notifications
You must be signed in to change notification settings - Fork 20.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
clef: failing to invoke the UI API after reading the docs #25162
Comments
The
In the internal API, there is a bidirectionality. The I can repro your case though.
But if I tell it to use a
When |
Yeah, it tries to read the master key early on, before registering the RPC/IPC hooks configDir := c.GlobalString(configdirFlag.Name)
if stretchedKey, err := readMasterKey(c, ui); err != nil {
log.Warn("Failed to open master, rules disabled", "err", err)
...
// Establish the bidirectional communication, by creating a new UI backend and registering
// it with the UI.
ui.RegisterUIServer(core.NewUIServerAPI(apiImpl)) So if you don't provide a master key, it will simply be stuck on that. |
@holiman there are some issues with your test above, but it's not relevant anymore. i have found the reason it doesn't work for me: i'm providing a i'm not sure i understand clef's design well enough to judge whether that is intended behavior, or not. is it? this is my rules.js, although it's probably not relevant:
note that, IIUC, i cannot add a new rule for this, because clef needs a password for the new account, and it cannot be provided through the IPC API call. so, i'm back to my original high-level goal: how can i request a running clef to create a new account in a single step (i.e. without getting into a convoluted multi-step interaction that is communicated on two channels, namely 1) on the IPC to request the new account, and 2) the stdio ui for providing the password for the new account)? with my limited understanding, i see the following options to fix/implement this:
any insights on which route i should take? maybe 3) is not as bad as it seems at first sight? with some guidance/help, i'm willing to do 1), too. but grepping the source for random tangential: it took me some time to understand that these are the same thing: the file is called |
FTR, i have reported the above as a new issue at: #25298 |
System information
On Guix (Linux):
Expected behaviour
clef is started like this (as captured from
ps afxu
, see below):then:
echo '{"id": 0, "jsonrpc": "2.0", "method": "clef_listAccounts", "params": []}' >>/var/lib/swarm/mainnet/clef/stdin
to which clef should respond with the account details in a json to its stdout.
Actual behaviour
in the terminal, where clef is running, i see the following:
same happens when using
ui_listAccounts
(the doc is not consistent about the names).My ultimate goal
is to be able to create new accounts as needed (for running a dynamic number of Bee nodes), while clef is already started and running (i.e. i cannot just spawn a new clef process and request the new account creation from the command line... or can i run multiple clef instances using the same
--configdir
and--keystore
? i guess i shouldn't, even if it works.)i also cannot add a rule for new account creation (because it needs a password argument), which leads to a convoluted, multi-step interaction when using the RPC API.
Sidenote on starting clef
the actual starting of the clef process is more convoluted. this may interfere, but i don't suspect it:
The text was updated successfully, but these errors were encountered: