Algorand Environment on Mac - General - Algorand
Algorand Environment on Mac
Post by zeeshanmazhar on Oct 13, 2020
Hi,
I am new to Algorand. I am trying to set up an environment for development; I started a node, but I am not able to install the devTools. I don’t know what I am missing. I tried to go through all the documentation again, but didn’t find anything helpful.
Any help will be appreciated.
Thanks.
Post by ryanRfox on Oct 13, 2020
Welcome @zeeshanmazhar, glad you are here! Let’s get you sorted!
Please help me understand the documentation you followed already, so I can make changes to improve going forward. Did you read within the README.md of the GitHub repo or a page(s) within the Developer Portal? It seems you have algod running by now. It’s not clear if your node is in sync yet, so can you try goal node status and post back the results? You will need to be in sync prior to broadcasting your first transaction.
Post by zeeshanmazhar on Oct 13, 2020
Hey Ryan,
Thanks for your reply.
I think I am missing something; I followed the instructions from Here.
When I run the goal node status, it shows me an error “zsh: command not found: goal.”
Post by ryanRfox on Oct 13, 2020
Seems like goal is not in your PATH. The installer should take care to add it. What do you find in your ~/node directory?
$ ls -la ~/node
Post by zeeshanmazhar on Oct 13, 2020
You can see the node directory files in the attached screenshot:
Post by ryanRfox on Oct 13, 2020
Good news: you have everything installed as expected. I see tealdbg and other devTools. So, this folder must not be in your PATH. Confirm by reviewing the results from:
$ echo $PATH
It needs to include ~/node in that string. It’s possible you can resolve this by closing your established terminal session and starting a new one, as the $PATH is established when the session begins (not updated by the installer).
Post by zeeshanmazhar on Oct 13, 2020
This shows me:
/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
Can you please check this?
Post by ryanRfox on Oct 13, 2020
Right, I see the install script for Mac is not setting the $PATH as expected. Therefore, you must set it manually for now (I’ll raise a ticket to correct this behavior).
$ export PATH=$PATH:~/node
That will add the ~/node directory to your $PATH environment variable for this session. If you want to make this permanent, please review the appropriate documentation for your OS version and shell:
Post by zeeshanmazhar on Oct 13, 2020
Yeah, now it’s working.
Thanks a lot, Ryan, really appreciated.
Post by zeeshanmazhar on Oct 13, 2020
Also, one more thing, for fast catchup, I have to run ./goal node start -d ~/node/datafastcatchup, but I don’t have any datafastcatchup folder in the node. Should I create it?
Can you please instruct me on this?
Thanks.
Post by ryanRfox on Oct 13, 2020
You may execute the goal node start and goal node catchup commands based on any directories you choose as instructed here. It’s no problem to do the catchup in the ~/node directory.
Post by zeeshanmazhar on Oct 13, 2020
Also, I tried this:
./goal node catchup 9630000#TC7G63KVOYPB3V5X2GU6WVIRKIWKYFNY6RYTAG7DLLC5PQKZG5IQ -d ~/node/datafastcatchup
But it’s giving me an error:
could not make cachedir: mkdir /Users/zeeshanmazhar/node/datafastcatchup/goal.cache: no such file or directory
Thanks, Zeeshan.
Post by ryanRfox on Oct 13, 2020
Give this a try:
./goal node catchup 9630000#TC7G63KVOYPB3V5X2GU6WVIRKIWKYFNY6RYTAG7DLLC5PQKZG5IQ -d ~/node
Post by zeeshanmazhar on Oct 13, 2020
It’s giving me this error:
Cannot contact Algorand node: open /Users/zeeshanmazhar/node/algod.token: no such file or directory.
Post by ryanRfox on Oct 13, 2020
Please ensure the node is running prior to performing the catchup. Use goal node status to verify.
DATA="~/node"
CATCHUP="9630000#TC7G63KVOYPB3V5X2GU6WVIRKIWKYFNY6RYTAG7DLLC5PQKZG5IQ"
./goal node start -d $DATA
./goal node status -d $DATA
./goal node catchup $CATCHUP -d $DATA
Post by zeeshanmazhar on Oct 15, 2020
Hey Ryan,
These commands are also not working. Can you please check the screenshot:
Post by zeeshanmazhar on Oct 15, 2020
Also after extracting the binary, where to run algorand-indexer daemon -h?
Post by ryanRfox on Oct 15, 2020
From your goal node status -d data output, I see that algod is running (although it looks stuck because the “Last committed block” is old and “Sync time” is not increasing). Also, this node is connected to the MainNet as indicated by “Genesis ID” and “Genesis hash.” If you want to connect to TestNet or BetaNet, please review Switching Networks documentation.
Let’s restart your node:
goal node restart -d data
Next, let’s execute goal node status -d data a couple of times about 5 seconds apart. We expect to see the “Sync Time” value increasing. Then, let’s perform the fast catchup:
goal node catchup $CATCHUP -d data
Notice that you are executing goal from the ~/node directory. Your MainNet data folder is actually at ~/node/data.
Post by zeeshanmazhar on Oct 15, 2020
Yeah, now I understand more. Can you please guide me on indexers? After extracting the binary, where to run algorand-indexer daemon -h?
Post by ryanRfox on Oct 15, 2020
Yes, @zeeshanmazhar, happy to help with algorand-indexer as well. However, I’m going to suggest you open a new thread for that, as this one feels “done” related to setting up the algod node.
I’ll wrap it up with an important note about the relationship between algod and algorand-indexer:
An indexer is incompatible with a node synced using Fast Catchup. Indexer requires access to an archival node to query all block history in order to build out its local indexed copy of blockchain data.
Post by zeeshanmazhar on Oct 15, 2020
Alright, I understand a bit more, but I hope I will understand more.
I am going to close this topic here.
Thanks again.