How to run a relay
- Run this in the command line and follow the steps to create a new NodeJS project
shell
npm init- Then install the package as a dependency
shell
npm i @gun-vue/relay- Add this line to the generated
package.jsonfile
json
"scripts": {
"start": "node start.js"
}- Create a
start.jsscript and edit it as follows: - Import the
relayand initiate it.
js
import relay from "@gun-vue/relay";
relay.init();- Save the
start.jsand run it.
shell
node start.jsYou'll see the message from the relay server running with it's address to use as a Gun peer in your app:
Hello wonderful person! :) Thanks for using GUN, please ask for help on http://chat.gun.eco if anything takes you longer than 5min to figure out!
AXE relay enabled!
Server started at http://localhost:8765/gun
Multicast on 233.255.255.255:8765