Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# This is a basic workflow to help you get started with Actions

name: CICD

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# Setup Go
- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: 1.17.x

# Run build of the application
- name: Run build
run: go build -o telemetry

- name: golangci-lint
uses: golangci/golangci-lint-action@v3
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
version: v1.45
41 changes: 41 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: goreleaser

on:
push:
branches-ignore:
- '**'
tags:
- 'v*.*.*'
# to be used by fork patch-releases ^^
- 'v*.*.*-*'

permissions:
contents: write
# packages: write
# issues: write

jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: "Checkout"
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: "Fetch all tags"
run: git fetch --force --tags
- name: "Set up Go"
uses: actions/setup-go@v2
with:
go-version: 1.17.x
- name: "Run GoReleaser"
uses: goreleaser/goreleaser-action@v2
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
config.toml
config.toml
telemetry
8 changes: 8 additions & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# .goreleaser.yaml
builds:
- main: ./main.go
id: "telemetry"
binary: telemetry
goos:
- linux
- darwin
43 changes: 28 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
# Matic-stats-exporter

- ## Bor:-
- ## Bor

Telemetry data for Bor nodes on Mainnet and Mumbai-testnet can be found here https://bor-mainnet.vitwit.com and https://bor-mumbai.vitwit.com.
![](https://github.com/vitwit/matic-telemetry/blob/main/docs/screen.png)

To export your nodes telemetry data to these dashboards do the following steps -
#### Restart your bor node with the ethstats flag

#### Restart your bor node with the ethstats flag

- Add `--ethstats` flag to your bor bash script which will be present at `~/node/bor/start.sh`. After adding the flag to the bash file it should look like this:
```#!/usr/bin/env sh
- Add `--ethstats` flag to your bor bash script which will be present at `~/node/bor/start.sh`. After adding the flag to the bash file it should look like this:

```shell
#!/usr/bin/env sh

set -x #echo on

Expand All @@ -25,27 +28,32 @@ bor --datadir $DATA_DIR \
......
......
```

**Note**:- For connecting to the mainnet dashboard use `--ethstats <node-name>:mainnet@bor-mainnet.vitwit.com:3000`. For connecting to the testnet dashboard use `--ethstats <node-name>:testnet@bor-mumbai.vitwit.com:3000`. `<node-name>` is just an identifier to display it on the dashboard.
- Restart your bor service `sudo systemctl restart bor`
- Restart your bor service `sudo systemctl restart bor`

To set up your own dashboard follow these [instructions](./docs/bor-setup.md).

- ## Heimdall:-
Telemetry data for Heimdall nodes on Mainnet and Mumbai-testnet can be found here [https://heimdall-mainnet.vitwit.com](https://heimdall-mainnet.vitwit.com) and [https://heimdall-mumbai.vitwit.com](https://heimdall-mumbai.vitwit.com)
- ## Heimdall

Telemetry data for Heimdall nodes on Mainnet and Mumbai-testnet can be found
here [https://heimdall-mainnet.vitwit.com](https://heimdall-mainnet.vitwit.com)
and [https://heimdall-mumbai.vitwit.com](https://heimdall-mumbai.vitwit.com)

To export your nodes telemetry data to these dashboards do the following:-

```
```shell
git clone https://github.com/vitwit/matic-telemetry.git
cd matic-telemetry
mkdir -p ~/.telemetry/config
cp example.config.toml ~/.telemetry/config/config.toml
```

Replace default value of `node` with your <node-name> in `~/.telemetry/config/config.toml`.

Use the following secret_key and IP to connect to **Mainnet** dashboard

```
```toml
[stats_details]
secret_key = "heimdall_mainnet"
node = "<node-name>"
Expand All @@ -54,19 +62,24 @@ net_stats_ip = "heimdall-mainnet.vitwit.com:3000"

Use the following secret_key and IP to connect to **Testnet** dashboard

```
```toml
[stats_details]
secret_key = "heimdall_testnet"
node = "<node-name>"
net_stats_ip = "heimdall-mumbai.vitwit.com:3000"
```

Build the binary :-
```

```shell
go mod tidy
go build -o telemetry
mv telemetry $GOBIN
```

Create systemd file :-
```

```shell
echo "[Unit]
Description=Telemtry
After=network-online.target
Expand All @@ -79,14 +92,14 @@ LimitNOFILE=4096
[Install]
WantedBy=multi-user.target" | sudo tee "/lib/systemd/system/telemetry.service"
```

Start the telemetry service

```
```shell
sudo systemctl enable telemetry.service
sudo systemctl start telemetry.service
```

View the logs using

`journalctl -u telemetry -f`

27 changes: 23 additions & 4 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,13 +1,32 @@
module github.com/vitwit/matic-telemetry

go 1.15
go 1.17

require (
github.com/ethereum/go-ethereum v1.10.1
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/gorilla/websocket v1.4.2
github.com/leodido/go-urn v1.2.1 // indirect
github.com/sirupsen/logrus v1.8.1
github.com/spf13/viper v1.7.1
gopkg.in/go-playground/validator.v9 v9.31.0
)

require (
github.com/fsnotify/fsnotify v1.4.9 // indirect
github.com/go-playground/locales v0.13.0 // indirect
github.com/go-playground/universal-translator v0.17.0 // indirect
github.com/hashicorp/hcl v1.0.0 // indirect
github.com/leodido/go-urn v1.2.1 // indirect
github.com/magiconair/properties v1.8.1 // indirect
github.com/mitchellh/mapstructure v1.1.2 // indirect
github.com/pelletier/go-toml v1.2.0 // indirect
github.com/spf13/afero v1.1.2 // indirect
github.com/spf13/cast v1.3.0 // indirect
github.com/spf13/jwalterweatherman v1.0.0 // indirect
github.com/spf13/pflag v1.0.5 // indirect
github.com/stretchr/testify v1.7.0 // indirect
github.com/subosito/gotenv v1.2.0 // indirect
golang.org/x/sys v0.0.0-20210124154548-22da62e12c0c // indirect
golang.org/x/text v0.3.3 // indirect
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect
gopkg.in/ini.v1 v1.51.0 // indirect
gopkg.in/yaml.v2 v2.3.0 // indirect
)
Loading