Documentation
¶
Overview ¶
Package smpc Gsmpc rpc interface
Package smpc Gsmpc rpc interface ¶
Package smpc P2P rpc interface
Index ¶
- Constants
- Variables
- func RPCInit(port int)
- type Enode
- type EnodeStatus
- type GroupID
- type GroupInfo
- type Result
- type Service
- func (service *Service) AcceptKeyGen(rsv string, msg string) map[string]interface{}
- func (service *Service) AcceptReShare(raw string) map[string]interface{}
- func (service *Service) AcceptReSharing(rsv string, msg string) map[string]interface{}
- func (service *Service) AcceptReqAddr(raw string) map[string]interface{}
- func (service *Service) AcceptSign(raw string) map[string]interface{}
- func (service *Service) AcceptSigning(rsv string, msg string) map[string]interface{}
- func (service *Service) BroadcastInSDKGroupAll(gid, msg string) map[string]interface{}
- func (service *Service) CreateGroup(threshold string, enodes []string) map[string]interface{}
- func (service *Service) CreateSDKGroup(threshold string, enodes []string, subGroup bool) map[string]interface{}
- func (service *Service) GetAccounts(account, mode string) map[string]interface{}
- func (service *Service) GetAccountsBalance(pubkey string, account string) map[string]interface{}
- func (service *Service) GetBalance(account string, cointype string, smpcaddr string) map[string]interface{}
- func (service *Service) GetBip32ChildKey(rootpubkey string, inputcode string, keytype string, mode string) map[string]interface{}
- func (service *Service) GetCurNodeReShareInfo() map[string]interface{}
- func (service *Service) GetCurNodeReqAddrInfo(account string) map[string]interface{}
- func (service *Service) GetCurNodeSignInfo(account string) map[string]interface{}
- func (service *Service) GetEnode() map[string]interface{}
- func (service *Service) GetEnodeStatus(enode string) map[string]interface{}
- func (service *Service) GetGroupByID(gid string) map[string]interface{}
- func (service *Service) GetMpcNodeInfo() map[string]interface{}
- func (service *Service) GetReShareNonce(account string) map[string]interface{}
- func (service *Service) GetReShareStatus(key string) map[string]interface{}
- func (service *Service) GetReqAddrNonce(account string) map[string]interface{}
- func (service *Service) GetReqAddrStatus(key string) map[string]interface{}
- func (service *Service) GetSDKGroup(enode string) map[string]interface{}
- func (service *Service) GetSDKGroup4Smpc() map[string]interface{}
- func (service *Service) GetSDKGroupAll() map[string]interface{}
- func (service *Service) GetSDKGroupPerson(enode string) map[string]interface{}
- func (service *Service) GetSignNonce(account string) map[string]interface{}
- func (service *Service) GetSignStatus(key string) map[string]interface{}
- func (service *Service) GetSmpcAddr(pubkey string) map[string]interface{}
- func (service *Service) GetVersion() map[string]interface{}
- func (service *Service) PreGenSignData(raw string) map[string]interface{}
- func (service *Service) PreSigning(rsv string, msg string) map[string]interface{}
- func (service *Service) ReShare(raw string) map[string]interface{}
- func (service *Service) ReSharing(rsv string, msg string) map[string]interface{}
- func (service *Service) ReqKeyGen(rsv string, msg string) map[string]interface{}
- func (service *Service) ReqSmpcAddr(raw string) map[string]interface{}
- func (service *Service) ReshareGroup(threshold string, enodes []string) map[string]interface{}
- func (service *Service) SendToGroupAllNodes(gid, msg string) map[string]interface{}
- func (service *Service) Sign(raw string) map[string]interface{}
- func (service *Service) Signing(rsv string, msg string) map[string]interface{}
- type Version
Constants ¶
Variables ¶
var RPCTEST bool = false
RPCTEST test
Functions ¶
Types ¶
type EnodeStatus ¶
EnodeStatus the status of enode
type Result ¶
type Result struct { Status string // Success, Error, Null, Repeat, Pending Tip string Error string Data interface{} }
Result rpc result
type Service ¶
type Service struct{}
Service RPC service,include interface
func (*Service) AcceptKeyGen ¶
AcceptKeyGen Agree to generate pubkey Raw is a special signed transaction that agrees to reqaddr. The data format is: { "TxType":"ACCEPTREQADDR", "Account":"xxx", "Nonce":"xxx", "Key":"XXX", "Accept":"XXX", "TimeStamp":"XXX" }
func (*Service) AcceptReShare ¶
AcceptReShare Agree to reshare
func (*Service) AcceptReSharing ¶
AcceptReSharing Agree to reshare
func (*Service) AcceptReqAddr ¶
AcceptReqAddr Agree to generate pubkey
Raw is a special signed transaction that agrees to reqaddr. The data format is:
{ "TxType":"ACCEPTREQADDR", "Key":"XXX", "Accept":"XXX", "TimeStamp":"XXX" }
func (*Service) AcceptSign ¶
AcceptSign Agree to sign Raw is a special transaction agreed to sign after signing. The data format is: { "TxType":"ACCEPTSIGN", "Key":"XXX", "Accept":"XXX", "TimeStamp":"XXX" }
func (*Service) AcceptSigning ¶
AcceptSigning Agree to sign Raw is a special transaction agreed to sign after signing. The data format is: { "TxType":"ACCEPTSIGN", "Account":"xxx", "Nonce":"xxx", "Key":"XXX", "Accept":"XXX", "TimeStamp":"XXX" }
func (*Service) BroadcastInSDKGroupAll ¶
BroadcastInSDKGroupAll broacast msg to all nodes in group by gid
func (*Service) CreateGroup ¶
CreateGroup create group
func (*Service) CreateSDKGroup ¶
func (service *Service) CreateSDKGroup(threshold string, enodes []string, subGroup bool) map[string]interface{}
CreateSDKGroup create group
func (*Service) GetAccounts ¶
GetAccounts get all pubkey by accout and mode gid = "",get all pubkey of all gid gid != "",get all pubkey by gid
func (*Service) GetAccountsBalance ¶
GetAccountsBalance get all accout balances by pubkey
func (*Service) GetBalance ¶
func (service *Service) GetBalance(account string, cointype string, smpcaddr string) map[string]interface{}
GetBalance get account balance
func (*Service) GetBip32ChildKey ¶
func (service *Service) GetBip32ChildKey(rootpubkey string, inputcode string, keytype string, mode string) map[string]interface{}
GetBip32ChildKey The return value is the sub public key of the X1 / x2 /... / xn sub node of the root node's total public key pubkey. Rootpubkey is the total public key pubkey of the root node The inputcode format is "m / X1 / x2 /... / xn", where x1,..., xn is the index number of the child node of each level, which is in decimal format, for example: "m / 1234567890123456789012345678901234567890123456789012323455678901234" inputcode = "m/x1/x2/..../xn"
func (*Service) GetCurNodeReShareInfo ¶
GetCurNodeReShareInfo Get the Reshare command approval list
func (*Service) GetCurNodeReqAddrInfo ¶
GetCurNodeReqAddrInfo Get the list of generating pubkey command data currently to be approved
func (*Service) GetCurNodeSignInfo ¶
GetCurNodeSignInfo Get the list of sign command data currently to be approved
func (*Service) GetEnodeStatus ¶
GetEnodeStatus get enode status
func (*Service) GetGroupByID ¶
GetGroupByID get group by gid
func (*Service) GetMpcNodeInfo ¶
GetMpcNodeInfo get mpc node info
func (*Service) GetReShareNonce ¶
GetReShareNonce Get the nonce value of this resare command special transaction
func (*Service) GetReShareStatus ¶
GetReShareStatus Get the result of the Reshare command
func (*Service) GetReqAddrNonce ¶
GetReqAddrNonce Get the nonce value of the special transaction generating pubkey
func (*Service) GetReqAddrStatus ¶
GetReqAddrStatus Get the result of generating pubkey key: This generates the unique identification value of the pubkey command
func (*Service) GetSDKGroup ¶
GetSDKGroup get sdk group
func (*Service) GetSDKGroup4Smpc ¶
GetSDKGroup4Smpc get group for smpc
func (*Service) GetSDKGroupAll ¶
GetSDKGroupAll for test
func (*Service) GetSDKGroupPerson ¶
GetSDKGroupPerson get person group
func (*Service) GetSignNonce ¶
GetSignNonce Get the nonce value of the special transaction of the sign command
func (*Service) GetSignStatus ¶
GetSignStatus Get the result of sign command key: This generates the unique identification value of the sign command
func (*Service) GetSmpcAddr ¶
GetSmpcAddr get smpc addrs by pubkey
func (*Service) GetVersion ¶
GetVersion get gsmpc version
func (*Service) PreGenSignData ¶
PreGenSignData Generate the relevant data required by the sign command in advance raw tx: data = pubkey + subgids
func (*Service) PreSigning ¶
PreSigning Generate the relevant data required by the sign command in advance data = pubkey + subgids
func (*Service) ReqKeyGen ¶
ReqKeyGen this will be called by smpc_reqKeyGen msg: a json string,such as : { "Account":xxx, "Nonce":xxx, } return pubkey and coins addr
func (*Service) ReqSmpcAddr ¶
ReqSmpcAddr this will be called by smpc_reqSmpcAddr raw: tx raw data return pubkey and coins addr
func (*Service) ReshareGroup ¶
ReshareGroup create reshare group
func (*Service) SendToGroupAllNodes ¶
SendToGroupAllNodes send msg to all nodes in group by gid
func (*Service) Sign ¶
Sign Execute the sign command Raw is a special signed transaction. The nonce of the transaction is through SMPC_ Getsignnonce function. The data format is: { "TxType":"SIGN", "PubKey":"XXX", "MsgHash":"XXX", "MsgContext":"XXX", "Keytype":"XXX", "GroupId":"XXX", "ThresHold":"XXX", "Mode":"XXX", "TimeStamp":"XXX" }
func (*Service) Signing ¶
Signing Execute the sign command Raw is a special signed transaction. The nonce of the transaction is through SMPC_ Getsignnonce function. The data format is: { "TxType":"SIGN", "Account":"xxx", "Nonce":"xxx", "PubKey":"XXX", "MsgHash":"XXX", "MsgContext":"XXX", "Keytype":"XXX", "GroupId":"XXX", "ThresHold":"XXX", "Mode":"XXX", "TimeStamp":"XXX" }