Giter VIP home page Giter VIP logo

helium_ansible's Introduction

helium_ansible

ansible playbooks for managing helium hotspots

Computer setup to run ansible

Ubuntu

sudo apt-get install ansible sshpass

Miner Setup

Flash this image to a 32GB or larger microSD card. https://downloads.raspberrypi.org/raspios_lite_arm64/images/raspios_lite_arm64-2021-11-08/

This SD card is recommended: https://amzn.to/340Ut7f

Afer writing out the image, enable ssh access by touching a file named ssh in the root of the SD card. The volume name of the SSD card is 'boot'. On Mac: touch /Volumes/boot/ssh On Linux: touch /ssh

Connect the miner to your network and get its IP address. Test connectivity. The password is raspberry.

ssh pi@<that ip>

Configure ansible

Change the line eu868 to us915 if you are in the US. Enter the ip in to hosts.yml for the ansible_host variable

all:
  children:
    eu868:
      hosts:
        hotspot:
          ansible_host: 192.168.0.12
          ansible_user: pi
          ansible_ssh_pass: raspberry
          ansible_become: true

Configure host_vars/hotspot.yml

target_hostname: "hotspot-animal-name"		# your hotspot name
target_domain: "local"				# 
target_hotspot_vendor: "cotx"			# cotx or pisces or rakv2
target_miner_key: True				# 
target_pf_concentrator_interface: "spi"		# usb
target_pf_concentrator_model: "sx1250"		# only sx1250 for now
# Tailscale subnet to subroute traffic https://tailscale.com/kb/1019/subnets/
#tailscale_subnet_cidr: 192.168.0.1/24

Configure OpenVPN (optional)

Turn openvpn on in group_vars/all.yaml

enable_openvpn: True # Also need to define openvpn_config

Configure Tailscale (optional)

If you wish to use tailscale, please install the dependencies:

ansible-galaxy install -r requirements.yml

Then change enable_tailscale: True in group_vars/all.yml

Run ansible

Install everything on your miner

ansible-playbook -i hosts.yml rpi.yml

Check if miner is running

This gives a lot of interesting information

ssh pi@<ip>
docker exec miner miner info summary

If you want specific things you can see a list of options by running

$ docker exec miner miner info
Usage: miner info commands

  info height            - Get height of the blockchain for this miner.
  info in_consensus      - Show if this miner is in the consensus_group.
  info name              - Shows the name of this miner.
  info block_age         - Get age of the latest block in the chain, in seconds.
  info p2p_status        - Shows key peer connectivity status of this miner.
  info onboarding        - Get manufacturing and staking details for this miner.
  info summary           - Get a collection of key data points for this miner.
  info region            - Get the operatating region for this miner.
pi@my-hot-spot:~ $ docker exec miner miner info summary

Configure wallet

This will ask you to enter your 12 words and then you can use the cli wallet to manage the hotspot HELIUM_WALLET_PASSWORD='wallet password' helium-wallet create basic --seed mobile -o ~/helium/keys/${hotspot}.key

to assert. HELIUM_WALLET_PASSWORD='wallet password' helium-wallet --format json -f ${key_file} hotspots assert --gateway ${hotspot_address} --gain=${gain} --elevation=${elevation} --lat=${lat} --lon=${lon} --commit

Issues

You can join #diy-packet-fowarder on https://discord.com/invite/helium

Docker gave this error and fidgeting with it fixed it

"+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq --no-install-recommends  docker-ce-cli docker-ce >/dev/null", "E: Sub-process /usr/bin/dpkg returned an error code (1)"]
ssh pi@<ip>
sudo systemctl restart systemd-networkd.service
sudo apt remove docker-ce
sudo apt install docker.io
sudo enable docker
sudo reboot now
Run ansible-playbook again

helium_ansible's People

Contributors

rafaribe avatar joecryptotoo avatar gradoj avatar crypto2crapto avatar n5qm avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.