Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/DougAnderson444/hypns-super-peer
Super peer for pinning hypns peers for friends on https://PeerPiper.io
https://github.com/DougAnderson444/hypns-super-peer
Last synced: about 2 months ago
JSON representation
Super peer for pinning hypns peers for friends on https://PeerPiper.io
- Host: GitHub
- URL: https://github.com/DougAnderson444/hypns-super-peer
- Owner: DougAnderson444
- License: other
- Created: 2020-09-23T14:56:35.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-14T16:44:30.000Z (over 3 years ago)
- Last Synced: 2024-11-24T21:08:54.286Z (about 2 months ago)
- Language: JavaScript
- Homepage:
- Size: 1.12 MB
- Stars: 4
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-starred - DougAnderson444/hypns-super-peer - Super peer for pinning hypns peers for friends on https://PeerPiper.io (others)
README
# HyPNS Super-Peer
Super peer for pinning HyPNS peers. Keeps the data online when the peers are offline.
## .env File Setup
You'll need:
```
# recommended, so not just anyone can pin to your server
# give this to your friends
TOKEN=the-token-code-you-give-to-those-who-you-will-pin-for# optional, if you want to push this code to glitch
# don't give to anyone except github webhook
SECRET=the-secret-needed-to-push-updates-to-Glitch.com```
Then your friends can put this TOKEN in their pinning code:
```js
// use Vercel fetch, as it includes auto-retry, so if your Glitch node is asleep it'll wake it up
const fetch = require('@vercel/fetch')(require('node-fetch')) // to make fetch work in nodejs// replace YOUR-GLITCH-URL with, well, your glitch url
const url = 'https://YOUR-GLITCH-URL.glitch.me/pin/' || 'https://your-super-peer-here.com/pin/'const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${process.env.TOKEN}`
},
body: JSON.stringify(req.body) // body data type must match "Content-Type" header
})```
## Start server
`npm run start`
## Server Deploy
This code can be deployed via Github action with a push.
## Glitch Deploy
You can easily deply this code to Glitch, and update automatically on each push.
## See status online
A Svelte page has been configured so the page displays all pins.
## Hyperswarm-Web Proxy
The server also spins up a hyperswarm-web proxy on port 4977 so that peers can proxy into hyperswarm from the browser.