Documentation ¶
Index ¶
- Constants
- Variables
- func CheckAccountType(accType string) bool
- func GetPreSetKeyArr(keySeed string, num int) []string
- type GetMessageInterface
- type MpcData
- type MpcDataTemp
- type MpcLogger
- func (pl *MpcLogger) Debug(args ...interface{})
- func (pl *MpcLogger) Debugf(msg string, args ...interface{})
- func (pl *MpcLogger) Debugln(args ...interface{})
- func (pl *MpcLogger) Error(args ...interface{})
- func (pl *MpcLogger) Errorf(msg string, args ...interface{})
- func (pl *MpcLogger) Errorln(args ...interface{})
- func (pl *MpcLogger) Fatal(args ...interface{})
- func (pl *MpcLogger) Fatalf(msg string, args ...interface{})
- func (pl *MpcLogger) Fatalln(args ...interface{})
- func (pl *MpcLogger) Info(args ...interface{})
- func (pl *MpcLogger) Infof(msg string, args ...interface{})
- func (pl *MpcLogger) Infoln(args ...interface{})
- func (pl *MpcLogger) SetFormat(string) error
- func (pl *MpcLogger) SetLevel(string) error
- func (pl *MpcLogger) Warn(args ...interface{})
- func (pl *MpcLogger) Warnf(msg string, args ...interface{})
- func (pl *MpcLogger) Warnln(args ...interface{})
- type MpcManager
- type MpcMessage
- type MpcNodeInterface
- type MpcResult
- type MpcResultInterface
- type MpcState
- type MpcStepFunc
- type MpcValue
- type PeerInfo
- type PeerMessage
- type SlicePeers
- type StepMessage
- type TestLogger
Constants ¶
View Source
const ( MpcCreateLockAccountLeader = iota + 0 MpcCreateLockAccountPeer MpcTXSignLeader MpcTXSignPeer MpcReady )
View Source
const ( StatusCode = iota + 0 // used by storeman protocol KeepaliveCode KeepaliveOkCode MSG_MPCError MSG_RequestPrepare MSG_RequestMPC // ask for a new mpc Context MSG_MPCMessage // get a message for a Context MSG_MPCFinish KeepaliveCycle NumberOfMessageCodes MPCDegree = 2 //MPCDegree = 1 MPCTimeOut = time.Second * 30 ProtocolName = "storeman" ProtocolVersion = uint64(1) ProtocolVersionStr = "1.0" )
View Source
const ( MpcSeed = "Seed" MpcPrivateKey = "PrivateKey" MpcPointPart = "PointPart" MpcSignASeed = "SignASeed" MpcSignA = "SignA" MpcSignA0 = "SignA0" MpcSignRSeed = "SignRSeed" MpcSignR = "SignR" MpcSignR0 = "SignR0" MpcSignB = "SignB" MpcSignBSeed = "SignBSeed" MpcSignC = "SignC" MpcSignCSeed = "SignCSeed" MpcSignARSeed = "SignARSeed" MpcSignARResult = "SignARResult" MpcTxSignSeed = "TxSignSeed" MpcTxSignResultR = "TxSignResultR" MpcTxSignResultV = "TxSignResultV" MpcTxSignResult = "TxSignResult" MpcContextResult = "ContextResult" PublicKeyResult = "PublicKeyResult" MpcSignAPoint = "SignAPoint" MpcTxHash = "TxHash" MpcLagrange = "Lagrange" MpcTransaction = "Transaction" MpcChainType = "ChainType" MpcSignType = "SignType" MpcChainID = "ChainID" MpcAddress = "Address" MPCAction = "Action" MPCPolyvalue = "Polyvalue" MPCSignedFrom = "SignedFrom" MpcStmAccType = "StmAccType" )
Variables ¶
View Source
var ( ErrQuit = errors.New("Quit") ErrMpcRequest = errors.New("Mpc Request is not exist") ErrMpcResultExist = errors.New("Mpc Result is not exist") ErrContextType = errors.New("Err Context Type is error") ErrTimeOut = errors.New("Mpc Requst is TimeOut") ErrAddress = errors.New("Mpc Address is not found") ErrChainID = errors.New("Mpc ChainID is not Defined") ErrPointZero = errors.New("Mpc Point is zero") ErrChainTypeError = errors.New("Mpc transaction chaintype error") ErrMpcSeedOutRange = errors.New("Mpc seeds are out range") ErrMpcSeedDuplicate = errors.New("Mpc seeds have duplicate") ErrDecrypt = errors.New("could not decrypt key with given passphrase") ErrTooLessStoreman = errors.New("Mpc alived Storeman is not enough") ErrTooMoreStoreman = errors.New("Mpc alived Storeman is too more") ErrFailedTxVerify = errors.New("Mpc signing transaction verify failed") ErrMpcContextExist = errors.New("Mpc Context ID is already exist") ErrInvalidMPCAddr = errors.New("Invalid mpc account address") ErrFailSignRetVerify = errors.New("Mpc signing result verify failed") ErrInvalidStmAccType = errors.New("invalid storeman account type! please input 'WAN' or 'ETH' or 'BTC' ") ErrMpcFinish = errors.New("Mpc Context has been Finished") )
View Source
var TLog = &TestLogger{ LogMap: make(map[string]int), }
Functions ¶
func CheckAccountType ¶
func GetPreSetKeyArr ¶
Types ¶
type GetMessageInterface ¶
type GetMessageInterface interface {
HandleMessage(*StepMessage) bool
}
type MpcDataTemp ¶
type MpcDataTemp struct { Key string Data interface{} }
type MpcManager ¶
type MpcManager interface { P2pMessage(*discover.NodeID, uint64, interface{}) error BoardcastMessage([]*discover.NodeID, uint64, interface{}) error SelfNodeId() *discover.NodeID CreateKeystore(MpcResultInterface, MpcNodeInterface) error SignTransaction(MpcResultInterface) error }
type MpcMessage ¶
type MpcNodeInterface ¶
type MpcNodeInterface interface { NeedQuorum() int Address() *common.MpcAddress Hash() *common.Hash Leader() *discover.NodeID FetchQuorum() bool RunNode(uint64, *discover.NodeID) MpcState AddNode(seed uint64, nodeId *discover.NodeID) error GetSeedsNum(seed uint64, nodeId *discover.NodeID) int SetState(MpcState) GetState() MpcState GetSeed(nodeId *discover.NodeID) uint64 GetNodeId(seed uint64) *discover.NodeID GetPeers() []PeerInfo GetPeerIDs() []*discover.NodeID }
type MpcResultInterface ¶
type MpcStepFunc ¶
type MpcStepFunc interface { GetMessageInterface InitMessageLoop(GetMessageInterface) error Quit(error) InitStep() error CreateMessage() []StepMessage FinishStep(MpcManager) error GetMessageChan() chan *StepMessage }
type SlicePeers ¶
func (SlicePeers) Len ¶
func (s SlicePeers) Len() int
func (SlicePeers) Less ¶
func (s SlicePeers) Less(i, j int) bool
func (SlicePeers) Swap ¶
func (s SlicePeers) Swap(i, j int)
type StepMessage ¶
type TestLogger ¶
func (*TestLogger) Error ¶
func (lg *TestLogger) Error(format string, ctx ...interface{})
Click to show internal directories.
Click to hide internal directories.