Skip to content

Commit

Permalink
chore:update env example
Browse files Browse the repository at this point in the history
  • Loading branch information
ZCalz committed Sep 3, 2024
1 parent 46b529d commit a885950
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
WORKER_ADDRESS=5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY
RPC_ENDPOINT=ws://127.0.0.1:9988
RPC_ENDPOINT=wss://fraa-flashbox-3239-rpc.a.stagenet.tanssi.network
IP_ADDRESS=
DOMAIN_NAME=
4 changes: 2 additions & 2 deletions KubeServiceUpdated.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ require('dotenv').config();

const WORKER_ADDRESS = process.env.WORKER_ADDRESS || '5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY'; //defaults to alice
const NODE_RPC = process.env.RPC_ENDPOINT || 'wss://fraa-flashbox-3239-rpc.a.stagenet.tanssi.network'; //defaults to hosted chain
const PUBLIC_IP = process.env.PUBLIC_IP || null; //should update on MasterSetup.sh
const IP_ADDRESS = process.env.IP_ADDRESS || null; //should update on MasterSetup.sh
const DOMAIN_NAME = process.env.DOMAIN_NAME || null; //should update on MasterSetup.sh if exists
// const WORKER_ID = process.env.WORKER_ID || null;

Expand Down Expand Up @@ -252,7 +252,7 @@ async function listenToSubstrateEvents() {
const thisWorker = entries.find(([key,value]) => {
let worker = value.toHuman()
const [domain] = worker.api.domain.split(':')
return domain === PUBLIC_IP || domain === DOMAIN_NAME
return domain === IP_ADDRESS || domain === DOMAIN_NAME
})
const workerId = thisWorker? thisWorker[1].toHuman().id : null
console.log("workerId: ", workerId)
Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,17 @@ Take a look at `.env.example`:

These values can be manually customized if you know them already. Otherwise the scripts below will automate this setup process. Keep in mind the scripts are configured for an Ubuntu Linux machine. Using the setup scripts on other machines may introduce errors.

The `RPC_ENDPOINT` is defaulted to localhost at port `9988` which is the typical zombienet RPC endpoint for a parachain. The example `WORKER_ADDRESS` is set to the Alice default test account.
[`Note:`] `RPC_ENDPOINT` defaults to the hosted Cyborg Chain's endpoint. If you are running Cyborg Node locally (not on vm), update the RPC_ENDPOINT to `ws://<your-local-pc-ip-address>:9988`
You can fetch your local IP address (`<your-local-pc-ip-address>`) of your computer on the network using:
```bash
ipconfig getifaddr en0
```
If your Cyborg Node is running on a VM, replace (`<your-local-pc-ip-address>`) with the ip address of the VM
The example `WORKER_ADDRESS` is set to the Alice default test account.
If you decide to run the worker locally within a local network, use this command:
```
Expand All @@ -54,7 +64,7 @@ npm run setup:local
If you decide to setup your worker on a remote machine, use this command:
```
npm run setup:dev
```
```
This command creates a `.env` with the neccessary variables to run the worker properly. You can already edit the `.env` manually afterwards depending on your setup preference. The last command in the setup script will install your k3s cluster master node. You can always run the MasterSetup.sh again to retrieve a worker node join token (`k3s-node-token.txt`). You will need this token to connect a k3s worker node to the k3s master.
Expand Down

0 comments on commit a885950

Please sign in to comment.