Skip to content
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

Feature Request: Rename nodes #388

Open
kibotrel opened this issue Oct 19, 2020 · 14 comments · May be fixed by #841
Open

Feature Request: Rename nodes #388

kibotrel opened this issue Oct 19, 2020 · 14 comments · May be fixed by #841
Labels
enhancement New feature or request good first issue Good for newcomers up for grabs Anyone can work on this

Comments

@kibotrel
Copy link

It would be nice if we could rename each individual node. Sometimes, Alice, Bob and Carol... are too vague for practical usage.

@kibotrel kibotrel added the enhancement New feature or request label Oct 19, 2020
@kibotrel kibotrel changed the title Feature Request: Feature Request: Rename nodes Oct 19, 2020
@jamaljsr
Copy link
Owner

I agree, this would be a good feature to implement. I don't think there are any downsides to renaming a node. It would just need to update the value stored in the network and restart the node in order for the alias to be updated.

Thanks for the feedback.

@kzu
Copy link

kzu commented May 13, 2021

Would be totally awesome to be able to name nodes. This would make also for a more realistic representation when discussing and brainstorming on the topology things might result in in actual production.

@jamaljsr jamaljsr added the good first issue Good for newcomers label Aug 11, 2021
@Marvel-Ib
Copy link

hi, @jamaljsr I wanted to know if this is still okay to work on. Not sure i can handle it but I would definitely love to try.

@jamaljsr
Copy link
Owner

Thanks for asking. Yes, you can work on it. I am not aware of anyone currently implementing this feature.

@jamaljsr jamaljsr added the up for grabs Anyone can work on this label Dec 19, 2023
@umarluqman
Copy link

I will try to work on this.

I just looked into the Redux store and highlighted the value or key that will need to be changed when the user change the node name. Just to confirm with you, am I missing something?

Screenshot at Jan 17 16-21-50 Screenshot at Jan 17 16-23-51

@jamaljsr
Copy link
Owner

Hey @umarluqman, thanks for taking a shot at this feature.

The data in the store that you found are actually all derived from the node names in the network object. This is the primary source for the name.

image

Once this name is changed, the lightning store will automatically begin using the new name when it fetches data from the node's APIs. However, it may be cleaner to rename the keys in there to avoid needing to refetch data again.

The data in the designer store couple possibly be regenerated using the functions in chart.ts but I'm not 100% certain. You may need to create a new function to specifically do the rename.

The biggest challenge I can think of is handling the renaming of the node directory that's stored on the host machine's file system, like ~/.polar/networks/1/volumes/lnd/alice/. The node must be stopped in order to rename this dir. It may be simpler to just require the whole network to be stopped in order to rename a node so you don't have to deal with processes holding files open, which would prevent renaming the parent dir.

Let me know if you have any more questions.

@umarluqman
Copy link

umarluqman commented Jan 23, 2024

Thanks for the explanation, I have two things in mind.

  1. If we were stopping the whole network probably we can have a button - Rename Node, then when the user click it, it will show a confirmation modal as for the network will be stop for the nodes to be renamed. If use click Yes, then the network will be stopped, all the node name text will become an input with the existing node name as the value and also beside the Rename Node button, there will be two more buttons - X and ✓ button.

After the user rename the node, they can click the ✓ button and X to cancel renaming the node. Probably there's better UX for this, I'm just putting it out here.

  1. Secondly, I was thinking if we could have name node configure during the node creation setup. This one is simpler I guess. This is the proposed design.
Screenshot at Jan 23 08-13-40

We can have a plus icon button, to insert multiple node names instead of specifying the node count. there will be a placeholder - Node name in the inputs for better UX

@Jem256
Copy link

Jem256 commented Feb 27, 2024

Hey @umarluqman are you still working on this? I'd like to take it on in case you're not.

@Jem256
Copy link

Jem256 commented Feb 28, 2024

Hey @jamaljsr I'd like to handle this if that's okay

@jamaljsr
Copy link
Owner

Go for it 👍

@Jem256 Jem256 linked a pull request Mar 1, 2024 that will close this issue
@Jem256
Copy link

Jem256 commented Mar 5, 2024

Hey @jamaljsr I would appreciate some help. I wrote a rename function to update the network store which updates the name of the node as below "Alic"
Screenshot from 2024-03-05 10-06-05

However, the designer store doesn't seem to update with this information as it remains 'alice'
Screenshot from 2024-03-05 10-06-54

The syncChart function in the designer store doesn't seem to do the update and I am not sure whether i should be using the updateChartFromNodes method from chart.ts

@jamaljsr
Copy link
Owner

jamaljsr commented Mar 5, 2024

Hey @Jem256, yes you will have to implement an function in the designer store to rename the node in it's state as well. Take a look at how removeLightningNode is implemented. It removes the node from the network store, then calls getStoreActions().designer.removeNode(node.name);.

@Jem256
Copy link

Jem256 commented Mar 7, 2024

Hey @jamaljsr I would like some clarification on how the onPortPositionChange function in the designer is receiving its props because I am encountering this error when i leave the network view screen and return to it after a rename
Screenshot from 2024-03-07 10-51-27

the network object also has this error that I am having difficulty in tracing. This also affects the retrieval of the node info.
Screenshot from 2024-03-07 10-50-54

@jamaljsr
Copy link
Owner

jamaljsr commented Mar 9, 2024

Hey @Jem256, can you push the code that exhibits this behavior so I can reproduce it and investigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers up for grabs Anyone can work on this
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants