mpc

package
v3.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 11, 2021 License: GPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrGetSignStatusTimeout = errors.New("getSignStatus timeout")
	ErrGetSignStatusFailed  = errors.New("getSignStatus failure")
)

get mpc sign status error

Functions

func AcceptSign

func AcceptSign(raw string) (string, error)

AcceptSign call acceptSign

func BuildMPCRawTx

func BuildMPCRawTx(nonce uint64, payload []byte, keyWrapper *keystore.Key) (string, error)

BuildMPCRawTx build mpc raw tx

func DoAcceptSign

func DoAcceptSign(keyID, agreeResult string, msgHash, msgContext []string) (string, error)

DoAcceptSign accept sign

func DoSign

func DoSign(signPubkey string, msgHash, msgContext []string) (keyID string, rsvs []string, err error)

DoSign mpc sign msgHash with context msgContext

func DoSignOne

func DoSignOne(signPubkey, msgHash, msgContext string) (keyID string, rsvs []string, err error)

DoSignOne mpc sign single msgHash with context msgContext

func GetEnode

func GetEnode(rpcAddr string) (string, error)

GetEnode call getEnode

func GetGroupID

func GetGroupID() string

GetGroupID return mpc group id

func GetSignNonce

func GetSignNonce(mpcUser, rpcAddr string) (uint64, error)

GetSignNonce call getSignNonce

func Init

func Init(mpcConfig *params.MPCConfig, isServer bool)

Init init mpc

func IsSwapServer

func IsSwapServer() bool

IsSwapServer returns if this mpc user is the swap server

func Sign

func Sign(raw, rpcAddr string) (string, error)

Sign call sign

Types

type AcceptData

type AcceptData struct {
	TxType     string
	Key        string
	Accept     string
	MsgHash    []string
	MsgContext []string
	TimeStamp  string
}

AcceptData accpet data

type DataEnode

type DataEnode struct {
	Enode string
}

DataEnode enode

type DataResult

type DataResult struct {
	Result string `json:"result"`
}

DataResult result

type DataResultResp

type DataResultResp struct {
	Status string
	Tip    string
	Error  string
	Data   *DataResult
}

DataResultResp result response

type GetEnodeResp

type GetEnodeResp struct {
	Status string
	Tip    string
	Error  string
	Data   *DataEnode
}

GetEnodeResp enode response

type GetGroupByIDResp

type GetGroupByIDResp struct {
	Status string
	Tip    string
	Error  string
	Data   *GroupInfo
}

GetGroupByIDResp group response

type GroupInfo

type GroupInfo struct {
	GID    string
	Count  int
	Enodes []string
}

GroupInfo group info

func GetGroupByID

func GetGroupByID(groupID, rpcAddr string) (*GroupInfo, error)

GetGroupByID call getGroupByID

type NodeInfo

type NodeInfo struct {
	// contains filtered or unexported fields
}

NodeInfo mpc node info

func GetAllInitiatorNodes

func GetAllInitiatorNodes() []*NodeInfo

GetAllInitiatorNodes get all initiator mpc node info

func (*NodeInfo) GetMPCRPCAddress

func (ni *NodeInfo) GetMPCRPCAddress() string

GetMPCRPCAddress get mpc node rpc address

func (*NodeInfo) GetMPCUser

func (ni *NodeInfo) GetMPCUser() common.Address

GetMPCUser returns the mpc user of specified keystore

func (*NodeInfo) GetSignGroups

func (ni *NodeInfo) GetSignGroups() []string

GetSignGroups get sign subgroups

func (*NodeInfo) LoadKeyStore

func (ni *NodeInfo) LoadKeyStore(keyfile, passfile string) (common.Address, error)

LoadKeyStore load keystore

type SignData

type SignData struct {
	TxType     string
	PubKey     string
	MsgHash    []string
	MsgContext []string
	Keytype    string
	GroupID    string
	ThresHold  string
	Mode       string
	TimeStamp  string
}

SignData sign data

type SignInfoData

type SignInfoData struct {
	Account    string
	GroupID    string
	Key        string
	KeyType    string
	Mode       string
	MsgHash    []string
	MsgContext []string
	Nonce      string
	PubKey     string
	ThresHold  string
	TimeStamp  string
}

SignInfoData sign info

func GetCurNodeSignInfo

func GetCurNodeSignInfo() ([]*SignInfoData, error)

GetCurNodeSignInfo call getCurNodeSignInfo

type SignInfoResp

type SignInfoResp struct {
	Status string
	Tip    string
	Error  string
	Data   []*SignInfoData
}

SignInfoResp sign info response

type SignReply

type SignReply struct {
	Enode     string
	Status    string
	TimeStamp string
	Initiator string
}

SignReply sign reply

type SignStatus

type SignStatus struct {
	Status    string
	Rsv       []string
	Tip       string
	Error     string
	AllReply  []*SignReply
	TimeStamp string
}

SignStatus sign status

func GetSignStatus

func GetSignStatus(key, rpcAddr string) (*SignStatus, error)

GetSignStatus call getSignStatus

Jump to

Keyboard shortcuts

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