config

package
v0.3.2-0...-6117ab2 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2019 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DitConfig ditConfig

DitConfig is exported since it needs to be accessed from other packages all the time

View Source
var EthereumNodes = []string{"https://node.ditcraft.io", "https://dai.poa.network"}

EthereumNodes is an array of rpc nodes that are used. First one is the primary, if one fails, the next one is used

View Source
var KyberNetworkProxy = "0x818E6FECD516Ecc3849DAf6845e3EC868087B755"

KyberNetworkProxy address that will be used for the ETH<->DAI swap

View Source
var MainnetNodes = []string{"https://mainnet.infura.io/v3/e0c6c62366d14f509033c919f2c72767"}

MainnetNodes contains the infura address to the eth mainnet

View Source
var Version = 5

Version of the config, will be incremented after every ditCLI update that modified the config file or the smart contracts in a way that an update is necessaray

Functions

func Create

func Create(_demoMode bool) error

Create will create a new config file

func GetPrivateKey

func GetPrivateKey(_forTransaction bool) (string, error)

GetPrivateKey will prompt the user for his password and return the decrypted ethereum private key

func Load

func Load() error

Load will load the config and set it to the exported variable "DitConfig"

func Save

func Save() error

Save will write the current config object to the file

func Update

func Update(_liveDitCoordinator string, _demoDitCoordinator string) (bool, error)

Update will migrate the current key-pair after a ditCLI update that

Types

type ActiveVote

type ActiveVote struct {
	KNWVoteID      int            `json:"knw_vote_id"`
	KnowledgeLabel KnowledgeLabel `json:"knowledge_label"`
	BranchHash     string         `json:"branch_hash"`
	NewHeadHash    string         `json:"new_head_hash"`
	Choice         int            `json:"choice"`
	Salt           string         `json:"salt"`
	NumTokens      string         `json:"num_tokens"`
	NumVotes       string         `json:"num_votes"`
	NumKNW         string         `json:"num_knw"`
	CommitEnd      int            `json:"commit_end"`
	RevealEnd      int            `json:"reveal_end"`
	Resolved       bool           `json:"resolved"`
}

ActiveVote struct, exported since its used in the ethereum package for new votes

type KnowledgeLabel

type KnowledgeLabel struct {
	ID    int    `json:"id"`
	Label string `json:"label"`
}

KnowledgeLabel struct, exported since its used in the ethereum package for new repositories

type Repository

type Repository struct {
	Provider        string                 `json:"provider"`
	KnowledgeLabels []KnowledgeLabel       `json:"knowledge_labels"`
	ActiveVotes     map[string]*ActiveVote `json:"active_votes"`
}

Repository struct, exported since its used in the ethereum package for new repositories

Jump to

Keyboard shortcuts

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