Documentation ¶
Index ¶
- Constants
- func GetAddressAndHash(message *protocol.MpcMessage) (hash common.Hash, address common.MpcAddress, have bool)
- func NewMpcNodeInfo() *mpcNodeInfo
- func NodeInfoKey(hash common.Hash, addr common.MpcAddress) common.Hash
- type BaseMpcResult
- type MemStatus
- type MpcAddress
- type MpcConfig
- type MpcContext
- type MpcContextCreater
- type MpcCtxFactory
- type MpcDistributor
- func (mpcServer *MpcDistributor) BoardcastMessage(peers []*discover.NodeID, code uint64, msg interface{}) error
- func (mpcServer *MpcDistributor) CreateKeystore(result protocol.MpcResultInterface, nodeInfo protocol.MpcNodeInterface) error
- func (mpcServer *MpcDistributor) CreateRequestMpc()
- func (mpcServer *MpcDistributor) FinishMpc(PeerID *discover.NodeID, mpcMessage *protocol.MpcMessage) error
- func (mpcServer *MpcDistributor) GetMessage(PeerID discover.NodeID, msg *p2p.Msg) error
- func (mpcServer *MpcDistributor) GetPeerLeader(bRequest bool) *discover.NodeID
- func (mpcServer *MpcDistributor) MessageLoop()
- func (mpcServer *MpcDistributor) MpcAccountRequest() (hexutil.Bytes, error)
- func (mpcServer *MpcDistributor) NewTime()
- func (mpcServer *MpcDistributor) P2pMessage(peerID *discover.NodeID, code uint64, msg interface{}) error
- func (mpcServer *MpcDistributor) QuitMpcContext(msg *protocol.MpcMessage)
- func (mpcServer *MpcDistributor) SelfNodeId() *discover.NodeID
- func (mpcServer *MpcDistributor) SendSignRequestPrepare(txHash common.Hash, address common.MpcAddress) error
- func (mpcServer *MpcDistributor) SignTransaction(result protocol.MpcResultInterface) error
- func (mpcServer *MpcDistributor) Start()
- func (mpcServer *MpcDistributor) Stop()
- func (mpcServer *MpcDistributor) UnlockKeystore(address common.MpcAddress, password string) error
- type MpcInterface
- type MpcKey
- type MpcService
- func (ms *MpcService) APIs() []rpc.API
- func (mp *MpcService) GetPeers() []*discover.NodeID
- func (ms *MpcService) HandlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error
- func (ms *MpcService) IsActivePeer(peerID *discover.NodeID) bool
- func (ms *MpcService) MaxMessageSize() uint32
- func (mp *MpcService) MessageChannel() <-chan protocol.PeerMessage
- func (ms *MpcService) Protocols() []p2p.Protocol
- func (mp *MpcService) Self() *discover.Node
- func (ms *MpcService) SendToPeer(peerID *discover.NodeID, msgcode uint64, data interface{}) error
- func (ms *MpcService) Start(server *p2p.Server) error
- func (ms *MpcService) Stop() error
- type MpcTestCtxFactory
- type NodeCollection
- func (nc *NodeCollection) AddNode(seed uint64, nodeId *discover.NodeID) error
- func (nc *NodeCollection) Address() *common.MpcAddress
- func (nc *NodeCollection) FetchQuorum() bool
- func (nc *NodeCollection) GetNodeId(seed uint64) *discover.NodeID
- func (nc *NodeCollection) GetPeerIDs() []*discover.NodeID
- func (nc *NodeCollection) GetPeers() []protocol.PeerInfo
- func (nc *NodeCollection) GetSeed(nodeId *discover.NodeID) uint64
- func (nc *NodeCollection) GetSeedsNum(seed uint64, nodeId *discover.NodeID) int
- func (nc *NodeCollection) GetState() protocol.MpcState
- func (nc *NodeCollection) Hash() *common.Hash
- func (nc *NodeCollection) InitfromKey(key *keystore.MpcKey)
- func (nc *NodeCollection) Leader() *discover.NodeID
- func (nc *NodeCollection) NeedQuorum() int
- func (nc *NodeCollection) RunNode(seed uint64, nodeId *discover.NodeID) protocol.MpcState
- func (nc *NodeCollection) SetState(state protocol.MpcState)
- type P2pMessager
- type Peer
- type StoremanAPI
Constants ¶
View Source
const ( MpcName = "eth" MpcVersion = 1 MpcVersionStr = "1.0" )
View Source
const ( MpcInterval = 30 MpcCacity = 20 )
Variables ¶
This section is empty.
Functions ¶
func GetAddressAndHash ¶
func GetAddressAndHash(message *protocol.MpcMessage) (hash common.Hash, address common.MpcAddress, have bool)
func NewMpcNodeInfo ¶
func NewMpcNodeInfo() *mpcNodeInfo
func NodeInfoKey ¶
Types ¶
type BaseMpcResult ¶
type BaseMpcResult struct { Result map[string]interface{} // contains filtered or unexported fields }
func (*BaseMpcResult) GetValue ¶
func (mpc *BaseMpcResult) GetValue(key string) (interface{}, error)
func (*BaseMpcResult) Initialize ¶
func (result *BaseMpcResult) Initialize(preSetValue ...protocol.MpcValue)
func (*BaseMpcResult) SetValue ¶
func (mpc *BaseMpcResult) SetValue(key string, value interface{}) error
type MpcAddress ¶
type MpcConfig ¶
type MpcConfig struct { Address []MpcAddress `json:"mpcAddress"` PassWord string `json:"password"` DataDir string `json:"datadir"` }
type MpcContext ¶
type MpcContext struct { ContextID common.Hash //Unique id for every content NodeInfo protocol.MpcNodeInterface MpcSteps []protocol.MpcStepFunc MapStepChan map[uint64]chan *protocol.StepMessage // contains filtered or unexported fields }
func (*MpcContext) SubscribeResult ¶
func (mpcCtx *MpcContext) SubscribeResult(result chan<- *protocol.MpcResult)
type MpcContextCreater ¶
type MpcDistributor ¶
type MpcDistributor struct { P2pMessager P2pMessager // contains filtered or unexported fields }
func CreateMpcDistributor ¶
func CreateMpcDistributor(keystoreDir string, msger P2pMessager, password string) *MpcDistributor
func (*MpcDistributor) BoardcastMessage ¶
func (mpcServer *MpcDistributor) BoardcastMessage(peers []*discover.NodeID, code uint64, msg interface{}) error
func (*MpcDistributor) CreateKeystore ¶
func (mpcServer *MpcDistributor) CreateKeystore(result protocol.MpcResultInterface, nodeInfo protocol.MpcNodeInterface) error
func (*MpcDistributor) CreateRequestMpc ¶
func (mpcServer *MpcDistributor) CreateRequestMpc()
func (*MpcDistributor) FinishMpc ¶
func (mpcServer *MpcDistributor) FinishMpc(PeerID *discover.NodeID, mpcMessage *protocol.MpcMessage) error
func (*MpcDistributor) GetMessage ¶
func (*MpcDistributor) GetPeerLeader ¶
func (mpcServer *MpcDistributor) GetPeerLeader(bRequest bool) *discover.NodeID
func (*MpcDistributor) MessageLoop ¶
func (mpcServer *MpcDistributor) MessageLoop()
func (*MpcDistributor) MpcAccountRequest ¶
func (mpcServer *MpcDistributor) MpcAccountRequest() (hexutil.Bytes, error)
func (*MpcDistributor) NewTime ¶
func (mpcServer *MpcDistributor) NewTime()
func (*MpcDistributor) P2pMessage ¶
func (mpcServer *MpcDistributor) P2pMessage(peerID *discover.NodeID, code uint64, msg interface{}) error
func (*MpcDistributor) QuitMpcContext ¶
func (mpcServer *MpcDistributor) QuitMpcContext(msg *protocol.MpcMessage)
func (*MpcDistributor) SelfNodeId ¶
func (mpcServer *MpcDistributor) SelfNodeId() *discover.NodeID
func (*MpcDistributor) SendSignRequestPrepare ¶
func (mpcServer *MpcDistributor) SendSignRequestPrepare(txHash common.Hash, address common.MpcAddress) error
func (*MpcDistributor) SignTransaction ¶
func (mpcServer *MpcDistributor) SignTransaction(result protocol.MpcResultInterface) error
func (*MpcDistributor) Start ¶
func (mpcServer *MpcDistributor) Start()
func (*MpcDistributor) Stop ¶
func (mpcServer *MpcDistributor) Stop()
func (*MpcDistributor) UnlockKeystore ¶
func (mpcServer *MpcDistributor) UnlockKeystore(address common.MpcAddress, password string) error
type MpcInterface ¶
type MpcService ¶
type MpcService struct { MpcPeerGroup []*discover.NodeID // contains filtered or unexported fields }
func New ¶
func New(cfg *MpcConfig) *MpcService
New creates a Whisper client ready to communicate through the Ethereum P2P network.
func (*MpcService) APIs ¶
func (ms *MpcService) APIs() []rpc.API
APIs returns the RPC descriptors the Whisper implementation offers
func (*MpcService) GetPeers ¶
func (mp *MpcService) GetPeers() []*discover.NodeID
func (*MpcService) HandlePeer ¶
func (ms *MpcService) HandlePeer(peer *p2p.Peer, rw p2p.MsgReadWriter) error
HandlePeer is called by the underlying P2P layer when the whisper sub-protocol connection is negotiated.
func (*MpcService) IsActivePeer ¶
func (ms *MpcService) IsActivePeer(peerID *discover.NodeID) bool
func (*MpcService) MaxMessageSize ¶
func (ms *MpcService) MaxMessageSize() uint32
MaxMessageSize returns the maximum accepted message size.
func (*MpcService) MessageChannel ¶
func (mp *MpcService) MessageChannel() <-chan protocol.PeerMessage
func (*MpcService) Protocols ¶
func (ms *MpcService) Protocols() []p2p.Protocol
Protocols returns the whisper sub-protocols ran by this particular client.
func (*MpcService) Self ¶
func (mp *MpcService) Self() *discover.Node
func (*MpcService) SendToPeer ¶
func (ms *MpcService) SendToPeer(peerID *discover.NodeID, msgcode uint64, data interface{}) error
func (*MpcService) Start ¶
func (ms *MpcService) Start(server *p2p.Server) error
Start implements node.Service, starting the background data propagation thread of the Whisper protocol.
func (*MpcService) Stop ¶
func (ms *MpcService) Stop() error
Stop implements node.Service, stopping the background data propagation thread of the Whisper protocol.
type MpcTestCtxFactory ¶
type MpcTestCtxFactory struct {
// contains filtered or unexported fields
}
func (*MpcTestCtxFactory) CreateContext ¶
func (*MpcTestCtxFactory) CreateRequestAccountMpc ¶
func (mf *MpcTestCtxFactory) CreateRequestAccountMpc(mpcID common.Hash, peers []protocol.PeerInfo, leader *discover.NodeID, preSetValue ...protocol.MpcValue) (*MpcContext, error)
send create LockAccount from leader
type NodeCollection ¶
type NodeCollection struct { Quorum int Seeds []protocol.PeerInfo Collection map[discover.NodeID]uint64 // contains filtered or unexported fields }
func NewNodeCollection ¶
func NewNodeQuorum ¶
func NewNodeQuorum(peers []protocol.PeerInfo, leader *discover.NodeID) *NodeCollection
func (*NodeCollection) AddNode ¶
func (nc *NodeCollection) AddNode(seed uint64, nodeId *discover.NodeID) error
func (*NodeCollection) Address ¶
func (nc *NodeCollection) Address() *common.MpcAddress
func (*NodeCollection) FetchQuorum ¶
func (nc *NodeCollection) FetchQuorum() bool
func (*NodeCollection) GetNodeId ¶
func (nc *NodeCollection) GetNodeId(seed uint64) *discover.NodeID
func (*NodeCollection) GetPeerIDs ¶
func (nc *NodeCollection) GetPeerIDs() []*discover.NodeID
func (*NodeCollection) GetPeers ¶
func (nc *NodeCollection) GetPeers() []protocol.PeerInfo
func (*NodeCollection) GetSeedsNum ¶
func (nc *NodeCollection) GetSeedsNum(seed uint64, nodeId *discover.NodeID) int
func (*NodeCollection) GetState ¶
func (nc *NodeCollection) GetState() protocol.MpcState
func (*NodeCollection) Hash ¶
func (nc *NodeCollection) Hash() *common.Hash
func (*NodeCollection) InitfromKey ¶
func (nc *NodeCollection) InitfromKey(key *keystore.MpcKey)
func (*NodeCollection) Leader ¶
func (nc *NodeCollection) Leader() *discover.NodeID
func (*NodeCollection) NeedQuorum ¶
func (nc *NodeCollection) NeedQuorum() int
func (*NodeCollection) SetState ¶
func (nc *NodeCollection) SetState(state protocol.MpcState)
type P2pMessager ¶
type StoremanAPI ¶
type StoremanAPI struct {
// contains filtered or unexported fields
}
func (*StoremanAPI) CreateMpcAccount ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.