mx-chain-go icon indicating copy to clipboard operation
mx-chain-go copied to clipboard

rename node binary to avoid collisions in path

Open huttarichard opened this issue 3 years ago • 6 comments

at this point nodejs is very much popular and most people have nodejs in their path as node. After go install node will be in go/bin which is usually in PATH as well.

My suggestion is to rename cmd/node to something like cmd/erdnode. At this point it is still doable. Moreover it is best practice to have all executables with prefix.

Later on it will become pain in the ass for newcomers.

Two arguments here:

  1. to avoid collisions as mentioned
  2. shells (such as bash, fish, zsh) generally allows autocompletion, if binary is found in path it is possible possible to autocomple. This gives you ability to type erd hit tab and see all binaries related to elrond (assumption here is erd prefix for all executables in cmd/)

huttarichard avatar Apr 28 '21 14:04 huttarichard

@huttarichard I have never had this collision you speak of. I just checked my testnet system, and there is no node binary found on the PATH. I tried both of the following commands and there is no output which shows that node is not on the PATH:

$ command -v node
$ which node

As a best practice, Linux sysadmins always create dedicated local accounts for the running of application services. For the Elrond node, there should be a dedicated account. Developers should have their own accounts if they plan to develop on the same system. Additionally, if applications are being run (regardless of whether they are using nodejs or not), then they too should each have their own dedicated account.

By following this operational best practice, each user account maintains its own PATH setting so there is no risk of binary name collision such as you describe.

frankf1957 avatar May 01 '21 19:05 frankf1957

so fresh installation of linux 20.10 ubuntu

$ apt-get install nodejs
$ which node
/usr/bin/node

If Im not mistaken doesn't really matter which account you are using. Nobody will on osx, nor linux make dedicated accounts to contribute this project.

And also if which node returns nothing means you did not install elrond node binary in go path or you dont have go bin path in your $PATH.

huttarichard avatar May 01 '21 20:05 huttarichard

Right, we might rename the node binary to something else like elrond-node as to avoid confusions. We will have to change all our scripts for this change and all of us will need to reinstall our nodes on devnet/testnet/mainnet. Will investigate the feasibility of this change.

iulianpascalau avatar May 07 '21 15:05 iulianpascalau

Will rename to something else but a little bit later as it is a pending operation that will affect this.

iulianpascalau avatar Nov 10 '21 14:11 iulianpascalau

Still not accomplished due to the impact on existing setups. Will try to figure out a solution, thus.

iulianpascalau avatar Feb 08 '23 11:02 iulianpascalau

My suggestion is to rename cmd/node to something like cmd/erdnode.

An absolute must-have

We will have to change all our scripts for this change and all of us will need to reinstall our nodes on devnet/testnet/mainnet. Will investigate the feasibility of this change.

You must, this is clearly a high-severity high-priority naming bug issue.

ghost avatar Mar 10 '23 06:03 ghost