how to setup environment for avalanche's test network - go

I'm new to avalanche and have never used go before. I have been trying to deploy an Avalanche local test network according to the documentation in my ubuntu20.04 but it's not very clear what should exactly be done about the GOPATH.
It is mentioned:
avalanche-network-runner will be installed into $GOPATH/bin, please make sure that $GOPATH/bin is in your $PATH, otherwise, you may not be able to run commands below.
but its not specified what to set the PATH or GOPATH to.
also the documentation mentions:
# replace execPath with the path to AvalancheGo on your machine
# e.g., ${HOME}/go/src/github.com/ava-labs/avalanchego/build/avalanchego
AVALANCHEGO_EXEC_PATH="${HOME}/go/src/github.com/ava-labs/avalanchego/build/avalanchego"
however the avalanchego project was never said to be cloned.
can someone please provide the specific steps needed to get the avalanche local test network up and working?
thanks in advance for your help

I solved it as follows:
From here, download the binary file and give your file path for AVALANCHEGO_EXEC_PATH.
export AVALANCHEGO_EXEC_PATH="PATH_TO_AVALANCHEGO_BINARY"
Steps:
Install the Avalanche CLI, Avalanche Network Node Runner
Download the Avalanche Bin File
Export its path with AVALANCHEGO_EXEC_PATH
export AVALANCHEGO_EXEC_PATH="PATH_TO_AVALANCHEGO_BINARY"
Then, follow instruction here.

Related

Command line too long on maven when building hadoop from source in windows 10

I am trying to build hadoop from source as explained in this article. When building Apache common, everything fails with this error message: command line too long.
So, Here's what I have tried(I will update this when I try more):
As said in this
Stackoverflow answer, the way to overcome this error is to shorten the path as much as possible. So, I cut repository files from C:\user_name\.m2\repository\ to another directory and made an empty drive and have that point to this new directory which i have moved files to, like this
subst M: D:\maven-2.0.8\repository and changed <localRepository>M:</localRepository> tag in "settings.xml" from C:\apache-maven-2.0.8\conf to point to M:. And after doing all this, I restart my system and try to build hadoop again. But, as I can see from the error, maven still downloads packages to C:\Users\user_name\.m2\repository\, not M: and the error of command line too long error persists.
To shorten the path as much as possible, i made a directory in C:\mrepo and have this directory symbolically link to the C:\user_name\.m2\repository\ like this: mklink /J C:\mrepo C:\Users\.m2\repository. And after doing all this, I restart my system and try to build hadoop again. But, as I can see from the error, maven still downloads packages to C:\Users\user_name\.m2\repository\, not M: and the error of command line too long error persists.
EDIT 1:
I have also set an environment variable named M2_HOME with value M:\. And made changes in my \conf\settings.xml: <localRepository>${M2_HOME}</localRepository>. The issue still persisits.
How do I fix this and build hadoop successfully?
Are you using IntelliJ?
Because in IntelliJ you have some options to shorten your command line.
Go to Run/Debug Configurations.
Shorten command line, you can try the classpath file option.
You can find more information about it in this blog post.
If you want to set the .m2 directory to something explicit, you do can so by overriding the default.
All Users:
Edit the \conf\settings.xml global configuration file. Change the value of the localRepository key to the absolute path of the local repository cache.
Your user: I think you should be able to set the M2_HOME environment variable in your user settings.

Ros Environment in root

I have a ros (kinetic) environment set up on a raspberry pi 3 and am trying to get ros to execute upon startup via a simple bash script which calls roslaunch. Ros works in the user domain but fails when called from root.
Here is my launch_ros.sh script:
#!/bin/bash
source /home/pi/ros_catkin_ws/devel/setup.bash
export PYTHONPATH=/opt/ros/kinetic/lib/python2.7/dist-packages
roslaunch my_pkg pkg_launch.launch
When I run sudo /home/pi/Desktop/ros_launch.sh the roscore crashes with
ERROR: cannot launch node of type [rosout/rosout]: can't locate node
[rosout] in package [rosout] failed to start core service [/rosout]
The traceback for the exception was written to the log file
But, if I comment out
source /home/pi/ros_catkin_ws/devel/setup.bash
and execute /home/pi/Desktop/ros_launch.sh, ros works fine.
Also worthy of noting is if I leave the above source line uncommented when running in the user domain I get the same error as I do in the root. I think this might be pointing me to the solution but I am still very new to ros.
Has anyone come across this issue and found a solution?
In order to run a node as root after changing your shell to root using commands like sudo -i, You can source your current bash profile thats located inside your normal user .bashrc and use it inside root shell.
Try the following code:
#!/bin/bash
source /opt/ros/kinetic/setup.bash
source /home/pi/ros_catkin_ws/devel/setup.bash
export PYTHONPATH=/opt/ros/kinetic/lib/python2.7/dist-packages
roslaunch my_pkg pkg_launch.launch
You need to source your workspace devel to be able to find your own package.
But, you need to source ROS devel to be able to use roscd, roslaunch, ...
In the code below I added:
source /opt/ros/kinetic/setup.bash
to source ROS and be able to use it.
PS: If it's still not working you should try a short delay before running roslaunch.
I was accidentally in a conda environment (base only) and it was messing up big-time. Try disabling any Python virtual environments.
It really worked and it inspired me to report that I didn't have rosnode as a program when I was planning to call ROS scripts in my own applications. Calling source .bashrc directly from the Raspberry Pi's system would refresh the terminal, but there was no way for my program to take over. The solution was to place the required ROS environment scripts in a separate script like name init_env.sh and then call source init_env.sh before any other ROS scripts were executed.

how to configure cygwin Local Package Directory

I have to change my cygwin Local Package Directory, which happen to be earlier as C:\Users\username\Downloads.
Folders like http%3a%2f%2fcygwin.mirror.constant.com%2f are all in place in my new directory for Local Package Directory.
How to do that? (I cannot find, where cygwin stores the config.)
Running setup from new location tries to install all over again instead from continue using earlier packages from the internet.
The information is on /etc/setup/setup.rc
$ head setup.rc
last-cache
e:\downloads\cygwin_cache
last-mirror
http://mirrors.kernel.org/sourceware/cygwin/
net-method
Direct
last-action
Download,Install
mirrors-lst
....
Please note that setup just propose the settings based on last run but you can always change typing new values.

How do I configure Composer to use a different path on Windows when my Application Data folder is remote?

When I install composer on Windows 10, with active directory (meaning some of my user files live off on a server elsewhere), I get the following error when attempting to install:
Installation failed, deleting ./composer.json.
[InvalidArgumentException]
$from (\AD.LOCAL\SYSTEM\Users[path]\Application Data\Composer\ad.local\system\Users[path]\Applicat
ion Data\Composer\vendor\bin/boris) and $to (\AD.LOCAL\SYSTEM\Users[path]\Application Data\Composer\vendor
[path]\boris\bin\boris) must be absolute paths.
...very likely because my "Application Data" folder is not on my local machine.
How can I get around this. Windows composer install doesn't give me much in the way of options.
(Or, alternately, if I'm misinterpreting the cause of the problem, what is actually going on and how do I fix it?)
If your issue was during the installation there is a flag that allows you to set the installation directory.
The bin file from the path in the error message vendor/bin/boris doesn't look familiar to me and I am going to assume you completed an installation and a command had failed. There is a COMPOSER_HOME environment variable that impacts where a number of items are stored. This defaults to ${APPDATA}/Composer, if there are issues writing under that path for any reason, you can change the path by setting the COMPOSER_HOME variable for your user.
Created a local windows admin account, installed the functions from that account, and then put the local admins roaming folder in my PATH. Ugly, but effective.

ec2: elb-create-lb-listeners fails

Has anyone gotten amazon's elastic load balancing command: elb-create-lb-listeners to work?
Is this the right site for ec2 questions: would serverfault be better? Amazon's forums seem slow...
I get:
PROMPT:~ acct$ elb-create-lb-listeners <MYLBNAME> --listener "protocol=http,lb-port=80,instance-port=80"
Unable to find a $JAVA_HOME at "/usr", continuing with system-provided Java...
elb-create-lb-listeners: Malformed input-Unknown command: 'CreateLoadBalancerListeners'.
Use '--help' to see a list of valid commands.
...sup with that? Do I need to download something else? My ELB cli is 1.0.10.0, and AWS_ELB_HOME is set correctly.
thanks!
Colin
Generally, you're running the latest version and that command should work.
I'd really fix your $JAVA_HOME environment. That can screw things up. Also, did you make sure $AWS_ELB_HOME and $AWS_CREDENTIAL_FILE are set in your environment?
Ok, so this was long long back. But here's the solution:
Download Elastic Load Balancing API Tool from http://aws.amazon.com/developertools/2536 and unzip it.
Set the path as below:
export AWS_ELB_HOME=/root/james/ElasticLoadBalancing-1.0.15.1/
export PATH=$PATH:$AWS_ELB_HOME/bin
Set JAVA_HOME path as below:
export JAVA_HOME=/usr/java/jdk1.7.0_02/
Place your certification and private keys to some folder and point to it as below:
export EC2_CERT=/root/key/certfilename.pem
export EC2_PRIVATE_KEY=/root/key/pkfilename.pem
Now elb-create-lb would work :)

Resources