config

package
v0.0.0-...-a360f25 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultAuthenticationContract

func DefaultAuthenticationContract() (*contract.Contract, error)

func DefaultCommitteeContract

func DefaultCommitteeContract() (*contract.Contract, error)

func Init

func Init(u *Usechain) error

read the config from profile

func ReadManagerContractConfig

func ReadManagerContractConfig() (*contractConfig, error)

func UpdateManagerContractConfig

func UpdateManagerContractConfig(ctr *contractConfig) error

func UpdateProfile

func UpdateProfile(profile *CommittteeProfile) error

func UpdateUsedConfig

func UpdateUsedConfig(used *UsedConfig) error

func UpdateWhisperNode

func UpdateWhisperNode(ws *NodeConfig) error

Types

type CommittteeProfile

type CommittteeProfile struct {
	CommitteeID int
	Role        string
	Address     string
	PrivShares  string
}

Structure of a committee info

func ReadProfile

func ReadProfile() (*CommittteeProfile, error)

type NodeConfig

type NodeConfig struct {
	NodeID string
	Boot   string
	Topic  string
	Key    string
}

Structure of a whisper node

func ReadWhisperNode

func ReadWhisperNode() (*NodeConfig, error)

type State

type State int

The state of the Usechain committee

const (
	Voting        State = iota //value --> 0	in voting
	Selected                   //value --> 1	selected, but not confirmed
	WaittingOther              //value --> 2	self confirmed, wait for all confirmed
	KeyGenerating              //value --> 3	in generating committee key
	Verifying                  //value --> 4   in verification
	NotCommittee               //value --> 5	not a committee
	Other                      //value --> 6
)

Enum of the State

func GetState

func GetState(config Usechain) State

Get the state of the committee

type Usechain

type Usechain struct {
	UserProfile      *CommittteeProfile
	ManagerContract  *contract.Contract
	IdentityContract *contract.Contract
	NodeRPC          *usedrpc.UseRPC
	WisperInfo       *NodeConfig
	UsedClient       *UsedConfig
	Kstore           *keystore.KeyStore
	Workstat         State
}

Usechain implements the Usechain Committee full node service.

type UsedConfig

type UsedConfig struct {
	Name string
	Url  string
}

Used node info

func ReadUsedConfig

func ReadUsedConfig() (*UsedConfig, error)

Jump to

Keyboard shortcuts

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