rewards

package
v1.3.112 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2026 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Overview

Package rewards pkg/services/rewards/rewards.go c3-vis-appsvc

The reward system as a pkg/services.Service: the reward UI server (`skywire cli rewards ui`) with the hourly reward cycle inside it (`skywire cli rewards serve`), so a visor can host it under its own key.

Block shape:

{
  "type": "rewards", "name": "rewards", "keyfile": "/path/rewards.key",
  "work_dir": "/var/lib/skywire/rewards",
  "skycoin_node": "http://127.0.0.1:6420",
  "proxy": "127.0.0.1:4443", "fetch": false,
  "bot_token_file": "/etc/skywire/rewardbot.token", "bot_chat_id": -100123
}

work_dir holds hist/, log_backups/ and xpub_index.json. The bot token is read from bot_token_file or TG_BOT_TOKEN, never from the block, and the chat from bot_chat_id or TG_CHAT_ID.

Index

Constants

View Source
const Type = "rewards"

Type is the registry key used in services.json blocks.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	PubKey cipher.PubKey `json:"public_key,omitempty"`
	SecKey cipher.SecKey `json:"secret_key,omitempty"`
	// Addr is an optional plain-HTTP listen address. Empty serves dmsg only.
	Addr     string `json:"addr,omitempty"`
	DmsgPort uint16 `json:"dmsg_port,omitempty"`
	WorkDir  string `json:"work_dir"`
	// Whitelist are the keys allowed to post a reward transaction.
	Whitelist        []cipher.PubKey `json:"whitelist,omitempty"`
	SkycoinNode      string          `json:"skycoin_node,omitempty"`
	LoginNode        string          `json:"login_node,omitempty"`
	CanonicalDomain  string          `json:"canonical_domain,omitempty"`
	SurveyMinVersion string          `json:"survey_min_version,omitempty"`

	// The cycle: hourly unless cycle_interval says otherwise, none with no_cycle.
	NoCycle       bool              `json:"no_cycle,omitempty"`
	CycleInterval services.Duration `json:"cycle_interval,omitempty"`
	SkipCollect   bool              `json:"skip_collect,omitempty"`
	Fetch         bool              `json:"fetch,omitempty"`
	Proxy         string            `json:"proxy,omitempty"`
	MinVersion    string            `json:"min_version,omitempty"`
	PruneBelow    string            `json:"prune_below_version,omitempty"`

	BotTokenFile string `json:"bot_token_file,omitempty"`
	BotChatID    int64  `json:"bot_chat_id,omitempty"`
}

Config is the JSON shape of a rewards block.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL