lotus/cmd/lotus-stats/setup.bash
Travis Person bd4322f56f Update lotus-stats with a richer cli
This updates lotus stats to use urfave instead of the golang flags
package. This brings with it some common features from other lotus tools
such as the use of the `FULLNODE_API_INFO` env and other parts of the
lotus cli package.

This also includes the latest dashboard.
2020-11-04 18:06:17 +00:00

30 lines
743 B
Bash
Executable File

#!/usr/bin/env bash
GRAFANA_HOST="http://localhost:13000"
curl -s -XPOST http://admin:admin@$GRAFANA_HOST/api/datasources -H 'Content-Type: text/json' --data-binary @- > /dev/null << EOF
{
"name":"filecoin-ntwk-localstats",
"type":"influxdb",
"database":"lotus",
"url": "http://influxdb:8086",
"basicAuth":false,
"access": "proxy"
}
EOF
curl -s -XPOST http://admin:admin@$GRAFANA_HOST/api/dashboards/import -H 'Content-Type: text/json' --data-binary @- << EOF | jq -r "\"http://$GRAFANA_HOST\" + .importedUrl"
{
"dashboard": $(cat ./chain.dashboard.json),
"overwrite": true,
"inputs": [
{
"name": "DS_INFLUXDB",
"pluginId": "influxdb",
"type": "datasource",
"value": "InfluxDB"
}
]
}
EOF