mDNS is used for discovering devices on the local network by their hostname. Please ensure it is working on your machine.
- MacOS: dns-sd is preinstalled
- Linux: Ensure avahi-daemon & libnss-mdns is preinstalled
- Windows 10: mDNS is supported out of the box
- Older Windows versions: Download and install https://support.apple.com/kb/DL999
MacOS:
dns-sd -B _ssh._tcp
#dns-sd -B _ssh._tcp | awk '{ print $7 ".local" }'
dns-sd -G v4v6 ae1c71f.local
Linux:
sudo apt install -y libnss-mdns
cat /etc/nsswitch.conf
# Ensure that mdns4_minimal [NOTFOUND=return] is inserted into `hosts:` after `file`
# hosts: files mdns4_minimal [NOTFOUND=return] dns
avahi-browse _ssh._tcp
avahi-resolve-host-name ae1c71f.local
Windows:
nslookup ae1c71f.local
ssh root@0ab8085.local
ls /data/zoobc-core
stop main # Stop main node
start main # Start main node
stop n2 # Stop n2 node
start n2 # Start n2 node
stop n3 # Stop n3 node
start n3 # Start n3 node
# Single device
export RSYNC_RSH='ssh -p 22222'
rsync -av zoobc-core/resource_cluster/ root@0ab8085.local:/docker/volumes/2_resin-data/_data/zoobc-core/
#rsync -av --delete zoobc-core/resource_cluster/ root@0ab8085.local:/docker/volumes/2_resin-data/_data/zoobc-core/
# All devices
export RSYNC_RSH='ssh -p 22 -o StrictHostKeyChecking=no'
balena devices | awk '{print $2}' | tail -n +2 | xargs -I{} rsync -av resource_cluster/ root@{}.local:/data/zoobc-core/
#balena devices | awk '{print $2}' | tail -n +2 | xargs -I{} rsync -av --delete resource_cluster/ root@{}.local:/data/zoobc-core/
balena devices | awk '{print $2}' | tail -n +2 | xargs -I{} ssh -o StrictHostKeyChecking=no root@{}.local "source .profile && stop main && rm -rf /data/zoobc-core/main && cat /data/zoobc-core/config_main.toml && start main"
balena devices | awk '{print $2}' | tail -n +2 | xargs -I{} ssh -o StrictHostKeyChecking=no root@{}.local "source .profile && stop n2 && rm -rf /data/zoobc-core/n2 && cat /data/zoobc-core/config_n2.toml && start n2"
Note: Balena CLI is only required for device bootstrapping, and fetching remote logs.
-
Windows or Mac:
Run installer from https://github.com/balena-io/balena-cli/blob/master/INSTALL.md
-
Linux: (Also applies to Mac or Windows with no admin-level access)
- Download the latest zip file from the balena-cli releases page.
Look for a file name that ends with the word "standalone", for example:
balena-cli-v10.13.6-linux-x64-standalone.zip
balena-cli-v10.13.6-macOS-x64-standalone.zip
balena-cli-v10.13.6-windows-x64-standalone.zip
- Extract the zip file contents to
/opt/balena-cli
. - Add the
balena-cli
folder to the system'sPATH
environment variable.
cat <<-EOF >> ~/.bash_profile export PATH="$PATH:/opt/balena-cli" EOF
See PATH instructions for: Linux | macOS | Windows
If you are using macOS Catalina (10.15), check this known issue and workaround.
- Download the latest zip file from the balena-cli releases page.
Look for a file name that ends with the word "standalone", for example:
-
Other OS:
sudo apt install g++ make git curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash nvm install v10 bash npm install balena-cli -g --production --unsafe-perm
Configure balena-cli to point towards the local openBalena instance (instead of the balena cloud).
If you would like to use the free balena cloud service, you can skip this step.
wget -O ~/.balena.crt https://raw.githubusercontent.com/zoobc/zoobc-labnet/master/balena-ca.crt
#echo 'balenaUrl: "raspi.zoobc.org"' > ~/.balenarc.yml
cat <<-EOF >> ~/.bash_profile
export BALENARC_BALENA_URL="raspi.zoobc.org"
export NODE_EXTRA_CA_CERTS="$HOME/.balena.crt"
EOF
Note: Only required if building new docker images locally, instead of using the build server.
Allows docker daemon to connect to the local docker registry (instead of dockerhub).
sudo mkdir -p /etc/docker/certs.d/registry.raspi.zoobc.org
sudo cp ~/balena-ca.crt /etc/docker/certs.d/registry.raspi.zoobc.org/ca.crt
#sudo cp ~/balena-ca.crt /usr/local/share/ca-certificates/ca.crt && sudo update-ca-certificates
sudo systemctl restart docker
docker version
export BALENARC_BALENA_URL="raspi.zoobc.org"
export NODE_EXTRA_CA_CERTS="$HOME/balena-ca.crt"
balena login # Choose Credentials (raspi@blockchainzoo.com:login123)
balena devices
balena devices | tail -n +2 | awk '{ print $2 ".local" }'
git clone https://github.com/zoobc/zoobc-labnet.git
cd zoobc-labnet
./deploy.sh
git pull
git submodule update --init --remote
balena apps
balena deploy zbcDev --build --logs
# Build without deploy (for raspberrypi3)
balena build --deviceType raspberrypi3 --arch armv7hf --logs
# Build without deploy (for intel)
balena build --deviceType intel-nuc --arch amd64 --logs
# More architectures here: https://www.balena.io/docs/reference/base-images/devicetypes/
Download a development image for your embedded device from here: https://www.balena.io/os/#download
balena apps
balena os configure ~/Downloads/balenaos.img --app zbcDev
Use balenaEtcher (https://www.balena.io/etcher/) to flash balena.img
to an SD-card or Boot Flashdisk.
We will be supporting standalone non-managed devices in the future (if you do not want to use the free balena cloud or openBalena service).
See BUILD-SERVER.md for instructions.