Skip to content
Closed
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
40 changes: 40 additions & 0 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# 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:
branches:
- main
pull_request:
branches:
- '*'

# 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.15.15' # The Go version to download (if necessary) and use.

# 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
38 changes: 38 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: goreleaser

on:
push:
# run only against tags
tags:
- '*'

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.15.15
- 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 }}
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: ./telemetry
id: "telemetry"
binary: telemetry
goos:
- linux
- darwin
41 changes: 26 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
# 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:

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

set -x #echo on

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

**Note**:- For connecting to the mainnet dashboard use `--ethstats <node-name>:[email protected]:3000`. For connecting to the testnet dashboard use `--ethstats <node-name>:[email protected]: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 +61,23 @@ 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 build -o telemetry
mv telemetry $GOBIN
```

Create systemd file :-
```

```shell
echo "[Unit]
Description=Telemtry
After=network-online.target
Expand All @@ -79,14 +90,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`

8 changes: 7 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ module github.com/vitwit/matic-telemetry
go 1.15

require (
github.com/ethereum/go-ethereum v1.10.1
github.com/fsnotify/fsnotify v1.4.9 // indirect
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/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.7.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/go-playground/validator.v9 v9.31.0
gopkg.in/yaml.v2 v2.3.0 // indirect
)
Loading