I need more clarification on who user does what for my use case. Install a node - Algorand Developer Portal
When installing algorand node, the main folder is /var/lib/algorand, which has systemctl commands to start stop node.
There are 3 facts when install a node. Trying to state facts first to make this question easy to ask and give context of my confusion.
Facts
- Always run node as user algorand. That’s why there are commands as
(sudo -u algorand -E goal account listpartkey -d /var/lib/algorand) - The node is installed and is run from dir /var/lib/algorand
- Never run node as user root. See fact 1, use -u algorand as arg
Confusion
Well, if I run node as algorand user, how do I login to algorand user? What is the password to algorand user? How do I change the password for user algorand? What is command to switch user from root to algorand at terminal?
My Workaround
Therefore, I decided to create user algodev and run node from /home/algodev/node/
Start and run node as algodev and disable algorand user (sudo systemctl disable algorand.service) because algorand user would start node, I would have algodev start node and it would freeze with top over cpu / memory usage because 2 different users trying to run node is not good. This was before I disabled algorand user. So, I think, I created more problems with node updates and restarts pushed by blockchain to my node. Let’s leave this issue out for now in question, as it maybe created problems but got me further along.
So by having algodev user gave me ability to run my scripts under node in dir testnetdata (/home/algodev/node/testnetdata) and plan to have (/home/algodev/node/prodnetdata) once I roll over to production. I hardcode all -d references in all goal scripts (goal -d /home/algodev/node/testnetdata).
Reasons I use this approach is scripts all use same goal in same dir giving me ability for use of back folder (…/) and forward folder (/nextfolder) functionality and is easy to understand. No need to think about switching from user -u algorand with goal and trying to run scripts as algodev user and permissions changing files, etc.
Please give advice on how I can have my solution of scripts next to goal commands all inside node folder AND, most important part, all with same user. I assume algorand user is what I should be using, but I use algodev.
And if I have some validity to my confusion, could we add a paragraph in the Install a Node doc to clarify. Thanks.