Skip to content

Instantly share code, notes, and snippets.

@magicstone1412
Forked from pinheadmz/hns-pi.md
Created December 31, 2020 13:32
Show Gist options
  • Save magicstone1412/6f16a70df0e8608e9b0aa8e4427e5ecb to your computer and use it in GitHub Desktop.
Save magicstone1412/6f16a70df0e8608e9b0aa8e4427e5ecb to your computer and use it in GitHub Desktop.

Revisions

  1. @pinheadmz pinheadmz revised this gist Jul 23, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hns-pi.md
    Original file line number Diff line number Diff line change
    @@ -23,7 +23,7 @@ wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            ...
    ```

    Run hsd
    Run hsd: note that I am using the IP obtained from `ifconfig` as the `rs-host` setting

    ```
    $ sudo hsd --rs-host=10.0.1.5 --rs-port=53
  2. @pinheadmz pinheadmz revised this gist Jun 22, 2020. 1 changed file with 2 additions and 2 deletions.
    4 changes: 2 additions & 2 deletions hns-pi.md
    Original file line number Diff line number Diff line change
    @@ -75,11 +75,11 @@ and just set my static IP to `10.0.1.5` which was the address my router DHCP gav

    Then I set my iphone settings to the screenshot below under my home wifi network:

    <img src="https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG" width=200px>
    <img src="https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG" width=300px>

    and OSX network settings:

    ![Screen Shot 2020-06-22 at 2 15 38 PM](https://user-images.githubusercontent.com/2084648/85322698-bf8bef80-b494-11ea-8392-f1f26d826ede.png)
    <img src="https://user-images.githubusercontent.com/2084648/85322698-bf8bef80-b494-11ea-8392-f1f26d826ede.png" width=500px>



  3. @pinheadmz pinheadmz revised this gist Jun 22, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hns-pi.md
    Original file line number Diff line number Diff line change
    @@ -75,7 +75,7 @@ and just set my static IP to `10.0.1.5` which was the address my router DHCP gav

    Then I set my iphone settings to the screenshot below under my home wifi network:

    ![IMG_0365](https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG)
    <img src="https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG" width=200px>

    and OSX network settings:

  4. @pinheadmz pinheadmz revised this gist Jun 22, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hns-pi.md
    Original file line number Diff line number Diff line change
    @@ -75,7 +75,7 @@ and just set my static IP to `10.0.1.5` which was the address my router DHCP gav

    Then I set my iphone settings to the screenshot below under my home wifi network:

    ![IMG_0365](https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG =300x)
    ![IMG_0365](https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG)

    and OSX network settings:

  5. @pinheadmz pinheadmz revised this gist Jun 22, 2020. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion hns-pi.md
    Original file line number Diff line number Diff line change
    @@ -75,7 +75,7 @@ and just set my static IP to `10.0.1.5` which was the address my router DHCP gav

    Then I set my iphone settings to the screenshot below under my home wifi network:

    ![IMG_0365](https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG)
    ![IMG_0365](https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG =300x)

    and OSX network settings:

  6. @pinheadmz pinheadmz revised this gist Jun 22, 2020. 1 changed file with 4 additions and 0 deletions.
    4 changes: 4 additions & 0 deletions hns-pi.md
    Original file line number Diff line number Diff line change
    @@ -75,9 +75,13 @@ and just set my static IP to `10.0.1.5` which was the address my router DHCP gav

    Then I set my iphone settings to the screenshot below under my home wifi network:

    ![IMG_0365](https://user-images.githubusercontent.com/2084648/85322710-c4e93a00-b494-11ea-898c-7731ba527f2f.PNG)

    and OSX network settings:

    ![Screen Shot 2020-06-22 at 2 15 38 PM](https://user-images.githubusercontent.com/2084648/85322698-bf8bef80-b494-11ea-8392-f1f26d826ede.png)





  7. @pinheadmz pinheadmz revised this gist Jun 22, 2020. 1 changed file with 30 additions and 5 deletions.
    35 changes: 30 additions & 5 deletions hns-pi.md
    Original file line number Diff line number Diff line change
    @@ -23,9 +23,24 @@ wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            ...
    ```

    Run hsdsudo hsd --rs-host=10.0.1.5 --rs-port=53
    BONUS: enable as service for auto-restartedit file with this command:$ sudo nano /lib/systemd/system/hsd.service
    these are the contents:[Unit]
    Run hsd

    ```
    $ sudo hsd --rs-host=10.0.1.5 --rs-port=53
    ```

    BONUS: enable as service for auto-restart!

    edit file with this command:

    ```
    $ sudo nano /lib/systemd/system/hsd.service
    ```

    these are the contents:

    ```
    [Unit]
    Description=hsd
    After=network.target
    @@ -44,13 +59,23 @@ ExecStart=/usr/local/bin/node /home/pi/hsd/bin/hsd
    [Install]
    WantedBy=multi-user.target
    ```

    execute:$ sudo systemctl daemon-reload$ sudo systemctl enable hsd.service$ sudo systemctl start hsd
    execute:

    The service file is just a nice touch to enable auto-restart.For static IP, I followed this guide: https://pimylifeup.com/raspberry-pi-static-ip-address/and just set my static IP to 10.0.1.5 which was the address my router DHCP gave me anyway
    ```
    $ sudo systemctl daemon-reload
    $ sudo systemctl enable hsd.service
    $ sudo systemctl start hsd
    ```

    The service file is just a nice touch to enable auto-restart.
    For static IP, I followed this guide: https://pimylifeup.com/raspberry-pi-static-ip-address/
    and just set my static IP to `10.0.1.5` which was the address my router DHCP gave me anyway

    Then I set my iphone settings to the screenshot below under my home wifi network:


    and OSX network settings:


  8. @pinheadmz pinheadmz created this gist Jun 22, 2020.
    60 changes: 60 additions & 0 deletions hns-pi.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,60 @@
    Upgrade nodejs to v12.x.x

    ```
    $ sudo npm install -g n
    $ sudo n lts
    ```

    Install hsd

    ```
    $ sudo apt install libunbound-dev
    $ git clone https://github.com/handshake-org/hsd
    $ cd hsd
    $ npm i
    ```

    Get IP

    ```
    $ ifconfig
    wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
            inet 10.0.1.5  netmask 255.255.255.0  broadcast 10.0.1.255
            ...
    ```

    Run hsdsudo hsd --rs-host=10.0.1.5 --rs-port=53
    BONUS: enable as service for auto-restartedit file with this command:$ sudo nano /lib/systemd/system/hsd.service
    these are the contents:[Unit]
    Description=hsd
    After=network.target

    [Service]
    Type=simple
    Restart=always
    RestartSec=1
    User=root
    Environment="HSD_NETWORK=main"
    Environment="HSD_LOG_LEVEL=debug"
    Environment="HSD_NO_WALLET=true"
    Environment="HSD_RS_PORT"
    Environment="HSD_RS_HOST=0.0.0.0"
    Environment="HSD_PREFIX=/home/pi/.hsd"
    ExecStart=/usr/local/bin/node /home/pi/hsd/bin/hsd

    [Install]
    WantedBy=multi-user.target

    execute:$ sudo systemctl daemon-reload$ sudo systemctl enable hsd.service$ sudo systemctl start hsd

    The service file is just a nice touch to enable auto-restart.For static IP, I followed this guide: https://pimylifeup.com/raspberry-pi-static-ip-address/and just set my static IP to 10.0.1.5 which was the address my router DHCP gave me anyway

    Then I set my iphone settings to the screenshot below under my home wifi network:

    and OSX network settings: