mx-chain-go
mx-chain-go copied to clipboard
rename node binary to avoid collisions in path
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:
- to avoid collisions as mentioned
- 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 iserd
prefix for all executables incmd/
)
@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.
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.
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.
Will rename to something else but a little bit later as it is a pending operation that will affect this.
Still not accomplished due to the impact on existing setups. Will try to figure out a solution, thus.
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.