Documentation
¶
Index ¶
- func Open(addr string) (*bufio.ReadWriter, error)
- func RewardsDistribution(bcnet *BlockchainNetwork)
- type BlockchainNetwork
- func (bcnet *BlockchainNetwork) CommitteeUpdate(id int, members *[]chain.Member) error
- func (bcnet *BlockchainNetwork) GetBlock(id int, block *chain.Block) error
- func (bcnet *BlockchainNetwork) GetTxs(id int, txs *[]chain.LocalTransaction) error
- func (bcnet *BlockchainNetwork) Register(nodeInfo RegisterInfo, reply *bool) error
- func (bcnet *BlockchainNetwork) SendBlock(candi Candidate, sent *bool) error
- func (bcnet *BlockchainNetwork) SendRole(member chain.Member, committeeSetup *bool) error
- func (bcnet *BlockchainNetwork) SendTx(tx chain.LocalTransaction, sent *bool) error
- type Candidate
- type Endpoint
- type HandleFunc
- type RegisterInfo
- type TaskInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RewardsDistribution ¶
func RewardsDistribution(bcnet *BlockchainNetwork)
Types ¶
type BlockchainNetwork ¶
type BlockchainNetwork struct {
Transactions []chain.LocalTransaction //pending transactions
CandidateBlock chan chain.Block //pending block
BlockSender map[string]int //the sender of the candidate block
VerifiedBlock chain.Block //the verfied block
Members chain.MemberSet //committee members
Nodes chain.PeerSet //the registered nodes in the network
Task TaskInfo //the task published in the network
StakeMap map[int]int //the stake map of nodes
Vrf consensus.VRF //stake based random role selection
VoteLock sync.Mutex //control the voting process
CommitteeLock sync.Mutex //control the committee process
BlockLock sync.Mutex //control the candidate block receiving process
TxLock sync.Mutex //control the tx receiving process
CommitteeWait chan bool
CommitteeSetup chan bool
CandidateWait chan bool
BlockReceived chan bool
NewBlock chan bool
NewRound chan bool
NewTask bool
}
func NetworkInit ¶
func NetworkInit() *BlockchainNetwork
func (*BlockchainNetwork) CommitteeUpdate ¶
func (bcnet *BlockchainNetwork) CommitteeUpdate(id int, members *[]chain.Member) error
func (*BlockchainNetwork) GetBlock ¶
func (bcnet *BlockchainNetwork) GetBlock(id int, block *chain.Block) error
func (*BlockchainNetwork) GetTxs ¶
func (bcnet *BlockchainNetwork) GetTxs(id int, txs *[]chain.LocalTransaction) error
func (*BlockchainNetwork) Register ¶
func (bcnet *BlockchainNetwork) Register(nodeInfo RegisterInfo, reply *bool) error
func (*BlockchainNetwork) SendBlock ¶
func (bcnet *BlockchainNetwork) SendBlock(candi Candidate, sent *bool) error
func (*BlockchainNetwork) SendRole ¶
func (bcnet *BlockchainNetwork) SendRole(member chain.Member, committeeSetup *bool) error
func (*BlockchainNetwork) SendTx ¶
func (bcnet *BlockchainNetwork) SendTx(tx chain.LocalTransaction, sent *bool) error
type Endpoint ¶
type Endpoint struct {
// contains filtered or unexported fields
}
Endpoint provides an endpoint to other processess that they can send data to.
func NewEndpoint ¶
func NewEndpoint() *Endpoint
NewEndpoint creates a new endpoint. To keep things simple, the endpoint listens on a fixed port number.
func (*Endpoint) AddHandleFunc ¶
func (e *Endpoint) AddHandleFunc(name string, f HandleFunc)
AddHandleFunc adds a new function for handling incoming data.
type HandleFunc ¶
type HandleFunc func(*bufio.ReadWriter, net.Addr)
type TaskInfo ¶
type TaskInfo struct {
TaskName string
Model *python3.PyObject
GlobalModel string
ModelSize [][]int
CompModelSize []int //the compressed model size
PartNum int //the number of participants required in each training round
Rank int
CurrentRound int
Beta float64
Slr float64
UnlabeledData *python3.PyObject
}
FL Task
Click to show internal directories.
Click to hide internal directories.