Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix v1.3.17 survey collection #1736

Merged
merged 3 commits into from
Feb 10, 2024
Merged
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
10 changes: 9 additions & 1 deletion cmd/skywire-cli/commands/log/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,10 @@ var logCmd = &cobra.Command{
Long: "Fetch health, survey, and transport logging from visors which are online in the uptime tracker\nhttp://ut.skywire.skycoin.com/uptimes?v=v2\nhttp://ut.skywire.skycoin.com/uptimes?v=v2&visors=<pk1>;<pk2>;<pk3>",
Run: func(cmd *cobra.Command, args []string) {
log := logging.MustGetLogger("log-collecting")
fver, err := version.NewVersion("v1.3.17")
if err != nil {
log.Fatal("can't parse version for filtering fetches")
}
if logOnly && surveyOnly {
log.Fatal("use of mutually exclusive flags --log and --survey")
}
Expand Down Expand Up @@ -202,7 +206,11 @@ var logCmd = &cobra.Command{
}
}
if !logOnly {
download(ctx, log, httpC, "node-info.json", "node-info.json", key, maxFileSize) //nolint
if visorVersion.LessThan(fver) {
download(ctx, log, httpC, "node-info.json", "node-info.json", key, maxFileSize) //nolint
} else {
download(ctx, log, httpC, "node-info", "node-info.json", key, maxFileSize) //nolint
}
}
if !surveyOnly {
for i := 0; i <= duration; i++ {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Package clireward cmd/skywire-cli/commands/reward/root.go
package clireward
// Package clirewards cmd/skywire-cli/commands/rewards/calc.go
package clirewards

import (
"fmt"
Expand Down Expand Up @@ -54,23 +54,22 @@ type rewardData struct {
}

func init() {
RootCmd.AddCommand(rewardCalcCmd)
rewardCalcCmd.Flags().SortFlags = false
rewardCalcCmd.Flags().StringVarP(&wdate, "date", "d", wdate, "date for which to calculate reward")
rewardCalcCmd.Flags().StringVarP(&pubkey, "pk", "k", pubkey, "check reward for pubkey")
rewardCalcCmd.Flags().StringVarP(&disallowArchitectures, "noarch", "n", "amd64", "disallowed architectures, comma separated")
rewardCalcCmd.Flags().IntVarP(&yearlyTotal, "year", "y", yearlyTotalRewards, "yearly total rewards")
rewardCalcCmd.Flags().StringVarP(&utfile, "utfile", "u", "ut.txt", "uptime tracker data file")
rewardCalcCmd.Flags().StringVarP(&surveyPath, "path", "p", "log_collecting", "path to the surveys")
rewardCalcCmd.Flags().BoolVarP(&h0, "h0", "0", false, "hide statistical data")
rewardCalcCmd.Flags().BoolVarP(&h1, "h1", "1", false, "hide survey csv data")
rewardCalcCmd.Flags().BoolVarP(&h2, "h2", "2", false, "hide reward csv data")
rewardCalcCmd.Flags().BoolVarP(&grr, "err", "e", false, "account for non rewarded keys")

RootCmd.Flags().SortFlags = false
RootCmd.Flags().StringVarP(&wdate, "date", "d", wdate, "date for which to calculate reward")
RootCmd.Flags().StringVarP(&pubkey, "pk", "k", pubkey, "check reward for pubkey")
RootCmd.Flags().StringVarP(&disallowArchitectures, "noarch", "n", "amd64", "disallowed architectures, comma separated")
RootCmd.Flags().IntVarP(&yearlyTotal, "year", "y", yearlyTotalRewards, "yearly total rewards")
RootCmd.Flags().StringVarP(&utfile, "utfile", "u", "ut.txt", "uptime tracker data file")
RootCmd.Flags().StringVarP(&surveyPath, "path", "p", "log_collecting", "path to the surveys")
RootCmd.Flags().BoolVarP(&h0, "h0", "0", false, "hide statistical data")
RootCmd.Flags().BoolVarP(&h1, "h1", "1", false, "hide survey csv data")
RootCmd.Flags().BoolVarP(&h2, "h2", "2", false, "hide reward csv data")
RootCmd.Flags().BoolVarP(&grr, "err", "e", false, "account for non rewarded keys")
}

var rewardCalcCmd = &cobra.Command{
Use: "calc",
// RootCmd is the root command for skywire-cli rewards
var RootCmd = &cobra.Command{
Use: "rewards",
Short: "calculate rewards from uptime data & collected surveys",
Long: `
Collect surveys: skywire-cli log
Expand Down
2 changes: 2 additions & 0 deletions cmd/skywire-cli/commands/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import (
climdisc "github.com/skycoin/skywire/cmd/skywire-cli/commands/mdisc"
cliskysocksc "github.com/skycoin/skywire/cmd/skywire-cli/commands/proxy"
clireward "github.com/skycoin/skywire/cmd/skywire-cli/commands/reward"
clirewards "github.com/skycoin/skywire/cmd/skywire-cli/commands/rewards"
clirtfind "github.com/skycoin/skywire/cmd/skywire-cli/commands/rtfind"
cliservices "github.com/skycoin/skywire/cmd/skywire-cli/commands/services"
cliskyfwd "github.com/skycoin/skywire/cmd/skywire-cli/commands/skyfwd"
Expand Down Expand Up @@ -189,6 +190,7 @@ func init() {
cliskyfwd.RootCmd,
cliskyrev.RootCmd,
clireward.RootCmd,
clirewards.RootCmd,
clisurvey.RootCmd,
clirtfind.RootCmd,
climdisc.RootCmd,
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ require (
github.com/orandin/lumberjackrus v1.0.1
github.com/pterm/pterm v0.12.66
github.com/sirupsen/logrus v1.9.3
github.com/skycoin/dmsg v1.3.17
github.com/skycoin/dmsg v1.3.18-0.20240210174503-ecde4c538de6
github.com/skycoin/skycoin v0.27.1
github.com/skycoin/skycoin-service-discovery v0.0.0-20231221001759-d1af6ec27db1
github.com/skycoin/skywire-services v0.0.0-20240207001624-ebee7346e526
Expand Down
11 changes: 2 additions & 9 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -434,16 +434,14 @@ github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6Mwd
github.com/sirupsen/logrus v1.9.0/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
github.com/sirupsen/logrus v1.9.3/go.mod h1:naHLuLoDiP4jHNo9R0sCBMtWGeIprob74mVsIT4qYEQ=
github.com/skycoin/dmsg v1.3.17 h1:CUq8u4ABDKFkE4ppscJ/R09hMtfPUE72Rleq078vQ28=
github.com/skycoin/dmsg v1.3.17/go.mod h1:INEDx+ECwCGQWw/Kd0QcLmSWMhbeRRcfkxj+xATQGFg=
github.com/skycoin/dmsg v1.3.18-0.20240210174503-ecde4c538de6 h1:+FJ4PdoWc6W43qph/6TF1TIXWwc51uPCpRrbJ0Dkp/E=
github.com/skycoin/dmsg v1.3.18-0.20240210174503-ecde4c538de6/go.mod h1:INEDx+ECwCGQWw/Kd0QcLmSWMhbeRRcfkxj+xATQGFg=
github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6 h1:1Nc5EBY6pjfw1kwW0duwyG+7WliWz5u9kgk1h5MnLuA=
github.com/skycoin/noise v0.0.0-20180327030543-2492fe189ae6/go.mod h1:UXghlricA7J3aRD/k7p/zBObQfmBawwCxIVPVjz2Q3o=
github.com/skycoin/skycoin v0.27.1 h1:HatxsRwVSPaV4qxH6290xPBmkH/HgiuAoY2qC+e8C9I=
github.com/skycoin/skycoin v0.27.1/go.mod h1:78nHjQzd8KG0jJJVL/j0xMmrihXi70ti63fh8vXScJw=
github.com/skycoin/skycoin-service-discovery v0.0.0-20231221001759-d1af6ec27db1 h1:CQpzVCMiAZfL3NsByipzzPDIzBRJA00AURU/9Pctq1E=
github.com/skycoin/skycoin-service-discovery v0.0.0-20231221001759-d1af6ec27db1/go.mod h1:6VwZDwW4aO6fucuZKiJQ4PnnVYi5CfN/eHcK8F0C05M=
github.com/skycoin/skywire-services v0.0.0-20231221001820-3212895ddf12 h1:fic0WKltARs0JnbNFcKesijNgcPOeJh7CsFs/KLZoJw=
github.com/skycoin/skywire-services v0.0.0-20231221001820-3212895ddf12/go.mod h1:HYqBsmgat3wTk1zwGLNj3q5N3iCpJOwYOuLexqKH02k=
github.com/skycoin/skywire-services v0.0.0-20240207001624-ebee7346e526 h1:9Fs12yw4gpNwb/D7FtRZj1BfOMM3GkWt7NYM16K0+tM=
github.com/skycoin/skywire-services v0.0.0-20240207001624-ebee7346e526/go.mod h1:KfJQ6p13LpG+gBwzASh5ehZSi059aX44E/E4wQM2780=
github.com/skycoin/skywire-utilities v1.3.17 h1:89aPdViJxhMpjEJbByQ02W8anX6Oxt68OeSxAENBlFI=
Expand Down Expand Up @@ -547,7 +545,6 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk
golang.org/x/crypto v0.0.0-20190411191339-88737f569e3a/go.mod h1:WFFai1msRO1wXaEeE5yQxYXgSfI8pQAWXbQop6sCtWE=
golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20190820162420-60c769a6c586/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191002192127-34f69633bfdc/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20201012173705-84dcc777aaee/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
Expand Down Expand Up @@ -581,7 +578,6 @@ golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20191003171128-d98b1b443823/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
golang.org/x/net v0.0.0-20201010224723-4f7140c49acb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
Expand Down Expand Up @@ -620,7 +616,6 @@ golang.org/x/sys v0.0.0-20190916202348-b4ddaad3f8a3/go.mod h1:h1NjWce9XRLGQEsW7w
golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200116001909-b77594299b42/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200223170610-d5e6a3e2c0ae/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200302150141-5c8b2ff67527/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200428200454-593003d681fa/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
Expand Down Expand Up @@ -694,8 +689,6 @@ golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 h1:B82qJJgjvYKsXS9jeu
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2/go.mod h1:deeaetjYA+DHMHg+sMSMI58GrEteJUUzzw7en6TJQcI=
golang.zx2c4.com/wireguard v0.0.0-20230223181233-21636207a675 h1:/J/RVnr7ng4fWPRH3xa4WtBJ1Jp+Auu4YNLmGiPv5QU=
golang.zx2c4.com/wireguard v0.0.0-20230223181233-21636207a675/go.mod h1:whfbyDBt09xhCYQWtO2+3UVjlaq6/9hDZrjg2ZE6SyA=
golang.zx2c4.com/wireguard v0.0.20200320 h1:1vE6zVeO7fix9cJX1Z9ZQ+ikPIIx7vIyU0o0tLDD88g=
golang.zx2c4.com/wireguard v0.0.20200320/go.mod h1:lDian4Sw4poJ04SgHh35nzMVwGSYlPumkdnHcucAQoY=
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

35 changes: 4 additions & 31 deletions vendor/github.com/skycoin/dmsg/cmd/dmsg-server/commands/root.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 5 additions & 33 deletions vendor/github.com/skycoin/dmsg/cmd/dmsgcurl/commands/dmsgcurl.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading