dkgnode

package
v0.0.0-...-d9fe26e Latest Latest
Warning

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

Go to latest
Published: Feb 14, 2020 License: MIT Imports: 100 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PingMethod                  = "Ping"
	ConnectionDetailsMethod     = "ConnectionDetails"
	ShareRequestMethod          = "ShareRequest"
	KeyAssignMethod             = "KeyAssign"
	CommitmentRequestMethod     = "CommitmentRequest"
	VerifierLookupRequestMethod = "VerifierLookupRequest"
	KeyLookupRequestMethod      = "KeyLookupRequest"
	UpdatePublicKeyMethod       = "updatePubKey"
	UpdateShareMethod           = "updateShare"
	UpdateCommitmentMethod      = "updateCommitment"
)

Method Constants

View Source
const ContextID = ContextKey("ID")
View Source
const MaxFailedPubKeyAssigns = 100
View Source
const ShareCountMethod = "ShareCount"

Debug Handelers

Variables

View Source
var Events = struct {
	ErrorEvent string
	StartEvent string
	StopEvent  string
}{
	ErrorEvent: "error",
	StartEvent: "start",
	StopEvent:  "stop",
}
View Source
var MessageSourceMapping = map[MessageSource]string{
	BFT: "BFT",
	P2P: "P2P",
}
View Source
var (

	// ProtocolVersion -
	ProtocolVersion version.Protocol = 0x1
)

DB Stuff for App state and mappings

Functions

func AwaitTopic

func AwaitTopic(eventBus eventbus.Bus, topic string) <-chan interface{}

func BytesArrayToPointsArray

func BytesArrayToPointsArray(byteArray []byte) (pointsArray []*common.Point)

func EmptyHandler

func EmptyHandler(name string) func()

func GETHealthz

func GETHealthz(w http.ResponseWriter, r *http.Request)

GETHealthz always responds with 200 and can be used for basic readiness checks

func GetBftStatus

func GetBftStatus(w http.ResponseWriter, r *http.Request)

func GetPeerIDFromP2pListenAddress

func GetPeerIDFromP2pListenAddress(p2pListenAddress string) (*peer.ID, error)

func HashToString

func HashToString(bytes []byte) string

HashToString hashes the first 6 chars to a hex string

func HexstringToInt

func HexstringToInt(hs hexstring) int

func IntToHexstring

func IntToHexstring(i int) hexstring

func New

func New()

func PointsArrayToBytesArray

func PointsArrayToBytesArray(pointsArray *[]common.Point) []byte

Types

type ABCIApp

type ABCIApp struct {
	types.BaseApplication
	// contains filtered or unexported fields
}

func (*ABCIApp) BeginBlock

Track the block hash and header information

func (*ABCIApp) CheckTx

func (app *ABCIApp) CheckTx(req types.RequestCheckTx) types.ResponseCheckTx

func (*ABCIApp) Commit

func (app *ABCIApp) Commit() types.ResponseCommit

func (*ABCIApp) DeliverTx

func (*ABCIApp) EndBlock

func (app *ABCIApp) EndBlock(req types.RequestEndBlock) types.ResponseEndBlock

EndBlock

func (*ABCIApp) Info

func (app *ABCIApp) Info(req types.RequestInfo) (resInfo types.ResponseInfo)

func (*ABCIApp) LoadState

func (app *ABCIApp) LoadState() (State, bool)

func (*ABCIApp) Query

func (app *ABCIApp) Query(reqQuery types.RequestQuery) (resQuery types.ResponseQuery)

Query -

func (*ABCIApp) SaveState

func (app *ABCIApp) SaveState() State

func (*ABCIApp) ValidateAndUpdateAndTagBFTTx

func (app *ABCIApp) ValidateAndUpdateAndTagBFTTx(bftTx []byte, msgType byte, senderDetails NodeDetails) (bool, *[]tmcommon.KVPair, error)

Validates transactions to be delivered to the BFT. is the master switch for all tx

type ABCIMethods

type ABCIMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	RetrieveKeyMapping(keyIndex big.Int) (keyDetails KeyAssignmentPublic, err error)
	GetIndexesFromVerifierID(verifier, veriferID string) (keyIndexes []big.Int, err error)
	GetVerifierIterator() (iterator *mapping.VerifierIterator, err error)
}

type ABCIMethodsImpl

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

func (*ABCIMethodsImpl) GetIndexesFromVerifierID

func (a *ABCIMethodsImpl) GetIndexesFromVerifierID(verifier, verifierID string) (keyIndexes []big.Int, err error)

func (*ABCIMethodsImpl) GetOwner

func (a *ABCIMethodsImpl) GetOwner() (owner string)

func (*ABCIMethodsImpl) GetVerifierIterator

func (a *ABCIMethodsImpl) GetVerifierIterator() (iterator *mapping.VerifierIterator, err error)

func (*ABCIMethodsImpl) RetrieveKeyMapping

func (a *ABCIMethodsImpl) RetrieveKeyMapping(keyIndex big.Int) (keyDetails KeyAssignmentPublic, err error)

func (*ABCIMethodsImpl) SetOwner

func (a *ABCIMethodsImpl) SetOwner(owner string)

type ABCIService

type ABCIService struct {
	ABCIApp *ABCIApp
	// contains filtered or unexported fields
}

func (*ABCIService) Call

func (a *ABCIService) Call(method string, args ...interface{}) (interface{}, error)

func (*ABCIService) Name

func (a *ABCIService) Name() string

func (*ABCIService) NewABCIApp

func (a *ABCIService) NewABCIApp() *ABCIApp

func (*ABCIService) OnStart

func (a *ABCIService) OnStart() error

func (*ABCIService) OnStop

func (a *ABCIService) OnStop() error

func (*ABCIService) RunABCIServer

func (a *ABCIService) RunABCIServer(eventBus eventbus.Bus) error

func (*ABCIService) SetBaseService

func (a *ABCIService) SetBaseService(bs *BaseService)

type ABCITransaction

type ABCITransaction struct {
	Type    string      `json:"type"`
	Payload interface{} `json:"payload"`
}

ABCITransaction -

type AppInfo

type AppInfo struct {
	Height  int64  `json:"height"`
	AppHash []byte `json:"app_hash"`
}

type AssignmentBFTTx

type AssignmentBFTTx struct {
	Verifier   string
	VerifierID string
}

type BFTRPC

type BFTRPC struct {
	client.Client
	BftMsgQueue *msgqueue.MessageQueue
}

func NewBFTRPC

func NewBFTRPC(tmclient client.Client) *BFTRPC

func (BFTRPC) Broadcast

func (bftrpc BFTRPC) Broadcast(bftTx interface{}) (*pcmn.Hash, error)

BroadcastTxSync Wrapper (input should be bijsoned) to tendermint. blocks until message is sent

func (BFTRPC) Retrieve

func (bftrpc BFTRPC) Retrieve(hash []byte, txStruct BFTTxWrapper) (err error)

Retrieves tx from the bft and gives back results.

type BFTRPCWSQueryHandler

type BFTRPCWSQueryHandler struct {
	idmutex.Mutex
	QueryMap   map[string]chan []byte
	QueryCount map[string]int
}

type BFTRPCWSStatus

type BFTRPCWSStatus int
const (
	BftRPCWSStatusDown BFTRPCWSStatus = iota
	BftRPCWSStatusUp
)

type BFTTxWrapper

type BFTTxWrapper interface {
	//Create byte type and attach nonce
	PrepareBFTTx() ([]byte, error)
	//Decode byte type
	DecodeBFTTx([]byte) error
	GetSerializedBody() []byte
}

type BaseService

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

BaseService provides the guarantees that a ServiceCore can only be started and stopped once.

func NewABCIService

func NewABCIService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewBaseService

func NewBaseService(impl ServiceCore) *BaseService

NewBaseService returns a base service that wraps an implementation of ServiceCore and handles starting and stopping.

func NewCacheService

func NewCacheService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewDatabaseService

func NewDatabaseService(ctx context.Context, eb eventbus.Bus) *BaseService

func NewEthereumService

func NewEthereumService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewKeygennofsmService

func NewKeygennofsmService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewMappingService

func NewMappingService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewP2PService

func NewP2PService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewPSSService

func NewPSSService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewServerService

func NewServerService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewTelemetryService

func NewTelemetryService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewTendermintService

func NewTendermintService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func NewVerifierService

func NewVerifierService(ctx context.Context, eventBus eventbus.Bus) *BaseService

func (*BaseService) Call

func (bs *BaseService) Call(method string, args ...interface{}) (interface{}, error)

Query implements Service

func (*BaseService) IsRunning

func (bs *BaseService) IsRunning() bool

IsRunning implements Service

func (*BaseService) Name

func (bs *BaseService) Name() string

func (*BaseService) SetServiceCore

func (bs *BaseService) SetServiceCore(service ServiceCore)

SetServiceCore implements SetServiceCore

func (*BaseService) Start

func (bs *BaseService) Start() (bool, error)

Start implements Service

func (*BaseService) Stop

func (bs *BaseService) Stop() bool

Stop implements Service

func (*BaseService) String

func (bs *BaseService) String() string

String implements Service

func (*BaseService) Wait

func (bs *BaseService) Wait()

type BftWorkerUpdates

type BftWorkerUpdates struct {
	Type    string
	Payload interface{}
}

type CacheMethods

type CacheMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	TokenCommitExists(verifier string, tokenCommitment string) (exists bool)
	GetTokenCommitKey(verifier string, tokenCommitment string) (pubKey common.Point)
	RecordTokenCommit(verifier string, tokenCommitment string, pubKey common.Point)
	SignerSigExists(signature string) (exists bool)
	RecordSignerSig(signature string)
}

type CacheMethodsImpl

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

func (*CacheMethodsImpl) GetOwner

func (m *CacheMethodsImpl) GetOwner() (owner string)

func (*CacheMethodsImpl) GetTokenCommitKey

func (cache *CacheMethodsImpl) GetTokenCommitKey(verifier string, tokenCommitment string) (pubKey common.Point)

func (*CacheMethodsImpl) RecordSignerSig

func (cache *CacheMethodsImpl) RecordSignerSig(signature string)

func (*CacheMethodsImpl) RecordTokenCommit

func (cache *CacheMethodsImpl) RecordTokenCommit(verifier string, tokenCommitment string, pubKey common.Point)

func (*CacheMethodsImpl) SetOwner

func (m *CacheMethodsImpl) SetOwner(owner string)

func (*CacheMethodsImpl) SignerSigExists

func (cache *CacheMethodsImpl) SignerSigExists(signature string) (exists bool)

func (*CacheMethodsImpl) TokenCommitExists

func (cache *CacheMethodsImpl) TokenCommitExists(verifier string, tokenCommitment string) (exists bool)

type CacheService

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

func (*CacheService) Call

func (c *CacheService) Call(method string, args ...interface{}) (interface{}, error)

func (*CacheService) Name

func (c *CacheService) Name() string

func (*CacheService) OnStart

func (c *CacheService) OnStart() error

func (*CacheService) OnStop

func (c *CacheService) OnStop() error

func (*CacheService) SetBaseService

func (c *CacheService) SetBaseService(bs *BaseService)

type CacheSuiteSyncMap

type CacheSuiteSyncMap struct {
	sync.Map
}

func (*CacheSuiteSyncMap) Exists

func (s *CacheSuiteSyncMap) Exists(key string) (ok bool)

func (*CacheSuiteSyncMap) Get

func (s *CacheSuiteSyncMap) Get(key string) *cache.Cache

func (*CacheSuiteSyncMap) Set

func (s *CacheSuiteSyncMap) Set(key string, value *cache.Cache)

type CommitmentRequestHandler

type CommitmentRequestHandler struct {
	TimeNow func() time.Time
	// contains filtered or unexported fields
}

func (CommitmentRequestHandler) ServeJSONRPC

func (h CommitmentRequestHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

type CommitmentRequestParams

type CommitmentRequestParams struct {
	MessagePrefix      string `json:"messageprefix"`
	TokenCommitment    string `json:"tokencommitment"`
	TempPubX           string `json:"temppubx"`
	TempPubY           string `json:"temppuby"`
	VerifierIdentifier string `json:"verifieridentifier"`
}

func (*CommitmentRequestParams) ToString

func (p *CommitmentRequestParams) ToString() string

type CommitmentRequestResult

type CommitmentRequestResult struct {
	Signature string `json:"signature"`
	Data      string `json:"data"`
	NodePubX  string `json:"nodepubx"`
	NodePubY  string `json:"nodepuby"`
}

type CommitmentRequestResultData

type CommitmentRequestResultData struct {
	MessagePrefix      string `json:"messageprefix"`
	TokenCommitment    string `json:"tokencommitment"`
	TempPubX           string `json:"temppubx"`
	TempPubY           string `json:"temppuby"`
	VerifierIdentifier string `json:"verifieridentifier"`
	TimeSigned         string `json:"timesigned"`
}

func (*CommitmentRequestResultData) FromString

func (c *CommitmentRequestResultData) FromString(data string) (bool, error)

func (*CommitmentRequestResultData) ToString

func (c *CommitmentRequestResultData) ToString() string

type ConnectionDetails

type ConnectionDetails struct {
	TMP2PConnection string
	P2PConnection   string
}

type ConnectionDetailsHandler

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

func (ConnectionDetailsHandler) ServeJSONRPC

func (h ConnectionDetailsHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

type ConnectionDetailsJRPCResponse

type ConnectionDetailsJRPCResponse struct {
	RpcVersion string                  `json:"jsonrpc"`
	Id         int                     `json:"id"`
	Result     ConnectionDetailsResult `json:"result"`
}

type ConnectionDetailsMessage

type ConnectionDetailsMessage struct {
	Timestamp   string            `json:"timestamp"`
	Message     string            `json:"message"`
	NodeAddress ethCommon.Address `json:"node_address"`
}

func (*ConnectionDetailsMessage) String

func (c *ConnectionDetailsMessage) String() string

func (*ConnectionDetailsMessage) Validate

func (c *ConnectionDetailsMessage) Validate(pubKeyX, pubKeyY big.Int, sig []byte) (bool, error)

type ConnectionDetailsParams

type ConnectionDetailsParams struct {
	PubKeyX                  big.Int                  `json:"pubkeyx"`
	PubKeyY                  big.Int                  `json:"pubkeyy"`
	ConnectionDetailsMessage ConnectionDetailsMessage `json:"connection_details_message"`
	Signature                []byte                   `json:"signature"`
}

type ConnectionDetailsRequestBody

type ConnectionDetailsRequestBody struct {
	RpcVersion string                  `json:"jsonrpc"`
	Method     string                  `json:"method"`
	Id         int                     `json:"id"`
	Params     ConnectionDetailsParams `json:"params"`
}

type ConnectionDetailsResult

type ConnectionDetailsResult struct {
	TMP2PConnection string `json:"tm_p2p_connection"`
	P2PConnection   string `json:"p2p_connection"`
}

type ConnectionStatus

type ConnectionStatus int
const (
	EthClientDisconnected ConnectionStatus = iota
	EthClientConnected
)

type ContextKey

type ContextKey string

type CustomAuthFields

type CustomAuthFields struct {
	Timestamp string `json:"torus-timestamp"`
	Nonce     string `json:"torus-nonce"`
	Signature []byte `json:"torus-signature"`
}

type DBIteratorsSyncMap

type DBIteratorsSyncMap struct {
	sync.Map
}

func (*DBIteratorsSyncMap) Delete

func (d *DBIteratorsSyncMap) Delete(identifier string)

func (*DBIteratorsSyncMap) Exists

func (d *DBIteratorsSyncMap) Exists(identifier string) (ok bool)

func (*DBIteratorsSyncMap) Get

func (d *DBIteratorsSyncMap) Get(identifier string) dbm.Iterator

func (*DBIteratorsSyncMap) Set

func (d *DBIteratorsSyncMap) Set(identifier string, iterator dbm.Iterator)

type DKGKeygennofsmTransport

type DKGKeygennofsmTransport struct {
	Prefix     KeygenProtocolPrefix
	KeygenNode *keygennofsm.KeygenNode
	// contains filtered or unexported fields
}

func (*DKGKeygennofsmTransport) CheckIfNIZKPProcessed

func (tp *DKGKeygennofsmTransport) CheckIfNIZKPProcessed(keyIndex big.Int) bool

func (*DKGKeygennofsmTransport) GetType

func (tp *DKGKeygennofsmTransport) GetType() string

func (*DKGKeygennofsmTransport) Init

func (tp *DKGKeygennofsmTransport) Init()

func (*DKGKeygennofsmTransport) Output

func (tp *DKGKeygennofsmTransport) Output(inter interface{})

func (*DKGKeygennofsmTransport) Receive

func (tp *DKGKeygennofsmTransport) Receive(senderDetails keygennofsm.NodeDetails, keygenMessage keygennofsm.KeygenMessage) error

func (*DKGKeygennofsmTransport) ReceiveBroadcast

func (tp *DKGKeygennofsmTransport) ReceiveBroadcast(keygenMessage keygennofsm.KeygenMessage) error

func (*DKGKeygennofsmTransport) Send

func (tp *DKGKeygennofsmTransport) Send(nodeDetails keygennofsm.NodeDetails, keygenMessage keygennofsm.KeygenMessage) error

func (*DKGKeygennofsmTransport) SendBroadcast

func (tp *DKGKeygennofsmTransport) SendBroadcast(keygenMessage keygennofsm.KeygenMessage) error

func (*DKGKeygennofsmTransport) SetKeygenNode

func (tp *DKGKeygennofsmTransport) SetKeygenNode(keygenNode *keygennofsm.KeygenNode) error

func (*DKGKeygennofsmTransport) Sign

func (tp *DKGKeygennofsmTransport) Sign(s []byte) ([]byte, error)

type DKGMappingDataSource

type DKGMappingDataSource struct {
	MappingNode *mapping.MappingNode
	// contains filtered or unexported fields
}

func NewDKGMappingDataSource

func NewDKGMappingDataSource(e eventbus.Bus) *DKGMappingDataSource

func (*DKGMappingDataSource) GetType

func (ds *DKGMappingDataSource) GetType() string

func (*DKGMappingDataSource) Init

func (ds *DKGMappingDataSource) Init()

func (*DKGMappingDataSource) RetrieveKeyMapping

func (ds *DKGMappingDataSource) RetrieveKeyMapping(index big.Int) (mapping.MappingKey, error)

func (*DKGMappingDataSource) SetEventBus

func (ds *DKGMappingDataSource) SetEventBus(e eventbus.Bus)

func (*DKGMappingDataSource) SetMappingNode

func (ds *DKGMappingDataSource) SetMappingNode(m *mapping.MappingNode) error

type DKGMappingTransport

type DKGMappingTransport struct {
	Prefix      MappingProtocolPrefix
	MappingNode *mapping.MappingNode
	// contains filtered or unexported fields
}

func NewDKGMappingTransport

func NewDKGMappingTransport(e eventbus.Bus, oldEpoch, newEpoch int) *DKGMappingTransport

func (*DKGMappingTransport) GetType

func (tp *DKGMappingTransport) GetType() string

func (*DKGMappingTransport) Init

func (tp *DKGMappingTransport) Init()

func (*DKGMappingTransport) Output

func (tp *DKGMappingTransport) Output(inter interface{})

func (*DKGMappingTransport) Receive

func (tp *DKGMappingTransport) Receive(nodeDetails mapping.NodeDetails, mappingMessage mapping.MappingMessage) error

func (*DKGMappingTransport) ReceiveBroadcast

func (tp *DKGMappingTransport) ReceiveBroadcast(mappingMessage mapping.MappingMessage) error

func (*DKGMappingTransport) Send

func (tp *DKGMappingTransport) Send(nodeDetails mapping.NodeDetails, mappingMessage mapping.MappingMessage) error

func (*DKGMappingTransport) SendBroadcast

func (tp *DKGMappingTransport) SendBroadcast(mappingMessage mapping.MappingMessage) error

func (*DKGMappingTransport) SetEventBus

func (tp *DKGMappingTransport) SetEventBus(e eventbus.Bus)

func (*DKGMappingTransport) SetMappingNode

func (tp *DKGMappingTransport) SetMappingNode(m *mapping.MappingNode) error

func (*DKGMappingTransport) Sign

func (tp *DKGMappingTransport) Sign(s []byte) ([]byte, error)

type DKGPSSDataSource

type DKGPSSDataSource struct {
	PSSNode *pss.PSSNode
	// contains filtered or unexported fields
}

func (*DKGPSSDataSource) GetSharing

func (ds *DKGPSSDataSource) GetSharing(keygenID pss.KeygenID) *pss.Sharing

func (*DKGPSSDataSource) Init

func (ds *DKGPSSDataSource) Init()

func (*DKGPSSDataSource) SetPSSNode

func (ds *DKGPSSDataSource) SetPSSNode(pssNode *pss.PSSNode) error

type DKGPSSTransport

type DKGPSSTransport struct {
	Prefix            PSSProtocolPrefix
	PSSNode           *pss.PSSNode
	SendMiddleware    []Middleware
	ReceiveMiddleware []Middleware
	// contains filtered or unexported fields
}

func (*DKGPSSTransport) GetType

func (tp *DKGPSSTransport) GetType() string

func (*DKGPSSTransport) Init

func (tp *DKGPSSTransport) Init()

func (*DKGPSSTransport) Output

func (tp *DKGPSSTransport) Output(inter interface{})

func (*DKGPSSTransport) Receive

func (tp *DKGPSSTransport) Receive(senderDetails pss.NodeDetails, originalPSSMessage pss.PSSMessage) error

func (*DKGPSSTransport) ReceiveBroadcast

func (tp *DKGPSSTransport) ReceiveBroadcast(originalPSSMessage pss.PSSMessage) error

func (*DKGPSSTransport) Send

func (tp *DKGPSSTransport) Send(nodeDetails pss.NodeDetails, originalPSSMessage pss.PSSMessage) error

func (*DKGPSSTransport) SendBroadcast

func (tp *DKGPSSTransport) SendBroadcast(originalPSSMessage pss.PSSMessage) error

func (*DKGPSSTransport) SetEventBus

func (tp *DKGPSSTransport) SetEventBus(e eventbus.Bus)

func (*DKGPSSTransport) SetPSSNode

func (tp *DKGPSSTransport) SetPSSNode(ref *pss.PSSNode) error

func (*DKGPSSTransport) Sign

func (tp *DKGPSSTransport) Sign(s []byte) ([]byte, error)

type DatabaseMethods

type DatabaseMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	StoreKeygenCommitmentMatrix(keyIndex big.Int, c [][]common.Point) error
	StorePSSCommitmentMatrix(keyIndex big.Int, c [][]common.Point) error
	StoreCompletedKeygenShare(keyIndex big.Int, si big.Int, siprime big.Int) error
	StoreCompletedPSSShare(keyIndex big.Int, si big.Int, siprime big.Int) error
	StorePublicKeyToIndex(publicKey common.Point, keyIndex big.Int) error
	RetrieveCommitmentMatrix(keyIndex big.Int) (c [][]common.Point, err error)
	RetrievePublicKeyToIndex(publicKey common.Point) (keyIndex big.Int, err error)
	RetrieveIndexToPublicKey(keyIndex big.Int) (publicKey common.Point, err error)
	IndexToPublicKeyExists(keyIndex big.Int) bool
	RetrieveCompletedShare(keyIndex big.Int) (Si big.Int, Siprime big.Int, err error)
	GetShareCount() (count int)
	GetKeygenStarted(keygenID string) (started bool)
	SetKeygenStarted(keygenID string, started bool) error
	StoreConnectionDetails(nodeAddress ethCommon.Address, connectionDetails ConnectionDetails) error
	RetrieveConnectionDetails(nodeAddress ethCommon.Address) (connectionDetails ConnectionDetails, err error)
	StoreNodePubKey(nodeAddress ethCommon.Address, pubKey common.Point) error
	RetrieveNodePubKey(nodeAddress ethCommon.Address) (pubKey common.Point, err error)
}

type DatabaseMethodsImpl

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

func (*DatabaseMethodsImpl) GetKeygenStarted

func (db *DatabaseMethodsImpl) GetKeygenStarted(keygenID string) (started bool)

func (*DatabaseMethodsImpl) GetOwner

func (m *DatabaseMethodsImpl) GetOwner() (owner string)

func (*DatabaseMethodsImpl) GetShareCount

func (db *DatabaseMethodsImpl) GetShareCount() (count int)

func (*DatabaseMethodsImpl) IndexToPublicKeyExists

func (db *DatabaseMethodsImpl) IndexToPublicKeyExists(keyIndex big.Int) (exists bool)

func (*DatabaseMethodsImpl) RetrieveCommitmentMatrix

func (db *DatabaseMethodsImpl) RetrieveCommitmentMatrix(keyIndex big.Int) (c [][]common.Point, err error)

func (*DatabaseMethodsImpl) RetrieveCompletedShare

func (db *DatabaseMethodsImpl) RetrieveCompletedShare(keyIndex big.Int) (Si big.Int, Siprime big.Int, err error)

func (*DatabaseMethodsImpl) RetrieveConnectionDetails

func (db *DatabaseMethodsImpl) RetrieveConnectionDetails(nodeAddress ethCommon.Address) (connectionDetails ConnectionDetails, err error)

func (*DatabaseMethodsImpl) RetrieveIndexToPublicKey

func (db *DatabaseMethodsImpl) RetrieveIndexToPublicKey(keyIndex big.Int) (publicKey common.Point, err error)

func (*DatabaseMethodsImpl) RetrieveNodePubKey

func (db *DatabaseMethodsImpl) RetrieveNodePubKey(nodeAddress ethCommon.Address) (pubKey common.Point, err error)

func (*DatabaseMethodsImpl) RetrievePublicKeyToIndex

func (db *DatabaseMethodsImpl) RetrievePublicKeyToIndex(publicKey common.Point) (keyIndex big.Int, err error)

func (*DatabaseMethodsImpl) SetKeygenStarted

func (db *DatabaseMethodsImpl) SetKeygenStarted(keygenID string, started bool) error

func (*DatabaseMethodsImpl) SetOwner

func (m *DatabaseMethodsImpl) SetOwner(owner string)

func (*DatabaseMethodsImpl) StoreCompletedKeygenShare

func (db *DatabaseMethodsImpl) StoreCompletedKeygenShare(keyIndex big.Int, si big.Int, siprime big.Int) error

func (*DatabaseMethodsImpl) StoreCompletedPSSShare

func (db *DatabaseMethodsImpl) StoreCompletedPSSShare(keyIndex big.Int, si big.Int, siprime big.Int) error

func (*DatabaseMethodsImpl) StoreConnectionDetails

func (db *DatabaseMethodsImpl) StoreConnectionDetails(nodeAddress ethCommon.Address, connectionDetails ConnectionDetails) error

func (*DatabaseMethodsImpl) StoreKeygenCommitmentMatrix

func (db *DatabaseMethodsImpl) StoreKeygenCommitmentMatrix(keyIndex big.Int, c [][]common.Point) error

func (*DatabaseMethodsImpl) StoreNodePubKey

func (db *DatabaseMethodsImpl) StoreNodePubKey(nodeAddress ethCommon.Address, pubKey common.Point) error

func (*DatabaseMethodsImpl) StorePSSCommitmentMatrix

func (db *DatabaseMethodsImpl) StorePSSCommitmentMatrix(keyIndex big.Int, c [][]common.Point) error

func (*DatabaseMethodsImpl) StorePublicKeyToIndex

func (db *DatabaseMethodsImpl) StorePublicKeyToIndex(publicKey common.Point, keyIndex big.Int) error

type DatabaseService

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

func (*DatabaseService) Call

func (d *DatabaseService) Call(method string, args ...interface{}) (interface{}, error)

func (*DatabaseService) Name

func (d *DatabaseService) Name() string

func (*DatabaseService) OnStart

func (d *DatabaseService) OnStart() error

func (*DatabaseService) OnStop

func (d *DatabaseService) OnStop() error

func (*DatabaseService) SetBaseService

func (d *DatabaseService) SetBaseService(bs *BaseService)

type DealerResult

type DealerResult struct {
	Code    int
	Message string
}

type DefaultBFTTxWrapper

type DefaultBFTTxWrapper struct {
	BFTTx     []byte       `json:"bft_tx,omitempty"`
	Nonce     uint32       `json:"nonce,omitempty"`
	PubKey    common.Point `json:"pub_key,omitempty"`
	MsgType   byte         `json:"msg_type,omitempty"`
	Signature []byte       `json:"signature,omitempty"`
}

func (*DefaultBFTTxWrapper) DecodeBFTTx

func (wrapper *DefaultBFTTxWrapper) DecodeBFTTx(data []byte) error

func (DefaultBFTTxWrapper) GetSerializedBody

func (wrapper DefaultBFTTxWrapper) GetSerializedBody() []byte

func (*DefaultBFTTxWrapper) PrepareBFTTx

func (wrapper *DefaultBFTTxWrapper) PrepareBFTTx(bftTx interface{}) ([]byte, error)

type EthEpochParams

type EthEpochParams struct {
	EpochID int
	N       int
	T       int
	K       int
}

type EthNodeDetails

type EthNodeDetails struct {
	DeclaredIp         string
	Position           big.Int
	TmP2PListenAddress string
	P2pListenAddress   string
}

type EthereumMethods

type EthereumMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	GetCurrentEpoch() (epoch int)
	GetPreviousEpoch() (epoch int, err error)
	GetNextEpoch() (epoch int, err error)
	GetEpochInfo(epoch int, skipCache bool) (epochInfo epochInfo, err error)
	GetSelfIndex() (index int)
	GetSelfPrivateKey() (privKey big.Int)
	GetSelfPublicKey() (pubKey common.Point)
	GetSelfAddress() (address ethCommon.Address)
	SetSelfIndex(int)
	SelfSignData(data []byte) (rawSig []byte)

	AwaitCompleteNodeList(epoch int) []NodeReference
	GetNodeList(epoch int) []NodeReference
	GetNodeDetailsByAddress(address ethCommon.Address) NodeReference
	GetNodeDetailsByEpochAndIndex(epoch int, index int) NodeReference
	AwaitNodesConnected(epoch int)
	GetPSSStatus(oldEpoch int, newEpoch int) (pssStatus int, err error)
	VerifyDataWithNodelist(pk common.Point, sig []byte, data []byte) (senderDetails NodeDetails, err error)
	VerifyDataWithEpoch(pk common.Point, sig []byte, data []byte, epoch int) (senderDetails NodeDetails, err error)
	StartPSSMonitor() error
	GetTMP2PConnection() string
	GetP2PConnection() string
	ValidateEpochPubKey(nodeAddress ethCommon.Address, pubK common.Point) (valid bool)
}

type EthereumMethodsImpl

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

func (*EthereumMethodsImpl) AwaitCompleteNodeList

func (e *EthereumMethodsImpl) AwaitCompleteNodeList(epoch int) (nodeRefs []NodeReference)

func (*EthereumMethodsImpl) AwaitNodesConnected

func (e *EthereumMethodsImpl) AwaitNodesConnected(epoch int)

func (*EthereumMethodsImpl) GetCurrentEpoch

func (e *EthereumMethodsImpl) GetCurrentEpoch() (epoch int)

func (*EthereumMethodsImpl) GetEpochInfo

func (e *EthereumMethodsImpl) GetEpochInfo(epoch int, skipCache bool) (eInfo epochInfo, err error)

func (*EthereumMethodsImpl) GetNextEpoch

func (e *EthereumMethodsImpl) GetNextEpoch() (epoch int, err error)

func (*EthereumMethodsImpl) GetNodeDetailsByAddress

func (e *EthereumMethodsImpl) GetNodeDetailsByAddress(address ethCommon.Address) (nodeRef NodeReference)

func (*EthereumMethodsImpl) GetNodeDetailsByEpochAndIndex

func (e *EthereumMethodsImpl) GetNodeDetailsByEpochAndIndex(epoch int, index int) (nodeRef NodeReference)

func (*EthereumMethodsImpl) GetNodeList

func (e *EthereumMethodsImpl) GetNodeList(epoch int) (nodeRefs []NodeReference)

func (*EthereumMethodsImpl) GetOwner

func (m *EthereumMethodsImpl) GetOwner() (owner string)

func (*EthereumMethodsImpl) GetP2PConnection

func (e *EthereumMethodsImpl) GetP2PConnection() (p2pconnection string)

func (*EthereumMethodsImpl) GetPSSStatus

func (e *EthereumMethodsImpl) GetPSSStatus(oldEpoch int, newEpoch int) (pssStatus int, err error)

func (*EthereumMethodsImpl) GetPreviousEpoch

func (e *EthereumMethodsImpl) GetPreviousEpoch() (epoch int, err error)

func (*EthereumMethodsImpl) GetSelfAddress

func (e *EthereumMethodsImpl) GetSelfAddress() (address ethCommon.Address)

func (*EthereumMethodsImpl) GetSelfIndex

func (e *EthereumMethodsImpl) GetSelfIndex() (index int)

func (*EthereumMethodsImpl) GetSelfPrivateKey

func (e *EthereumMethodsImpl) GetSelfPrivateKey() (privKey big.Int)

func (*EthereumMethodsImpl) GetSelfPublicKey

func (e *EthereumMethodsImpl) GetSelfPublicKey() (pubKey common.Point)

func (*EthereumMethodsImpl) GetTMP2PConnection

func (e *EthereumMethodsImpl) GetTMP2PConnection() (tmp2pconnection string)

func (*EthereumMethodsImpl) SelfSignData

func (e *EthereumMethodsImpl) SelfSignData(input []byte) (rawSig []byte)

func (*EthereumMethodsImpl) SetOwner

func (m *EthereumMethodsImpl) SetOwner(owner string)

func (*EthereumMethodsImpl) SetSelfIndex

func (e *EthereumMethodsImpl) SetSelfIndex(index int)

func (*EthereumMethodsImpl) StartPSSMonitor

func (e *EthereumMethodsImpl) StartPSSMonitor() error

func (*EthereumMethodsImpl) ValidateEpochPubKey

func (e *EthereumMethodsImpl) ValidateEpochPubKey(nodeAddress ethCommon.Address, pubK common.Point) (valid bool)

func (*EthereumMethodsImpl) VerifyDataWithEpoch

func (e *EthereumMethodsImpl) VerifyDataWithEpoch(pk common.Point, sig []byte, input []byte, epoch int) (senderDetails NodeDetails, err error)

func (*EthereumMethodsImpl) VerifyDataWithNodelist

func (e *EthereumMethodsImpl) VerifyDataWithNodelist(pk common.Point, sig []byte, input []byte) (senderDetails NodeDetails, err error)

type EthereumService

type EthereumService struct {
	idmutex.Mutex
	// contains filtered or unexported fields
}

func (*EthereumService) Call

func (e *EthereumService) Call(method string, args ...interface{}) (interface{}, error)

func (*EthereumService) GetEpochInfo

func (e *EthereumService) GetEpochInfo(epoch int, skipCache bool) (epochInfo, error)

func (*EthereumService) GetNodeRef

func (e *EthereumService) GetNodeRef(nodeAddress ethCommon.Address) (n *NodeReference, err error)

func (*EthereumService) IsSelfRegistered

func (e *EthereumService) IsSelfRegistered(epoch int) (bool, error)

func (*EthereumService) Name

func (e *EthereumService) Name() string

func (*EthereumService) OnStart

func (e *EthereumService) OnStart() error

func (*EthereumService) OnStop

func (e *EthereumService) OnStop() error

func (*EthereumService) RegisterNode

func (e *EthereumService) RegisterNode(epoch int, declaredIP string, TMP2PConnection string, P2PConnection string) (*types.Transaction, error)

RegisterNode - the main function that registered the node on Ethereum node list with the details provided

func (*EthereumService) SetBaseService

func (e *EthereumService) SetBaseService(bs *BaseService)

type EventBusBytes

type EventBusBytes []byte

type FreezeStateData

type FreezeStateData struct {
	FreezeState         int
	LastUnassignedIndex uint
}

type FreezeStateSyncMap

type FreezeStateSyncMap struct {
	sync.Map
}

func (*FreezeStateSyncMap) Get

func (f *FreezeStateSyncMap) Get(mappingID mapping.MappingID) (freezeStateData FreezeStateData)

func (*FreezeStateSyncMap) Set

func (f *FreezeStateSyncMap) Set(mappingID mapping.MappingID, freezeStateData FreezeStateData)

type KeyAssignHandler

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

func (KeyAssignHandler) ServeJSONRPC

func (h KeyAssignHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

assigns a user a secret, returns the same index if the user has been previously assigned

type KeyAssignItem

type KeyAssignItem struct {
	KeyIndex string  `json:"key_index"`
	PubKeyX  big.Int `json:"pub_key_X"`
	PubKeyY  big.Int `json:"pub_key_Y"`
	Address  string  `json:"address"`
}

type KeyAssignParams

type KeyAssignParams struct {
	Verifier   string `json:"verifier"`
	VerifierID string `json:"verifier_id"`
}

type KeyAssignResult

type KeyAssignResult struct {
	Keys []KeyAssignItem `json:"keys"`
}

type KeyAssignment

type KeyAssignment struct {
	KeyAssignmentPublic
	Share    []byte
	Metadata tronCrypto.EciesMetadata
}

KeyAssignment - contains fields necessary to derive/validate a users key contains sensitive share data

type KeyAssignmentOld

type KeyAssignmentOld struct {
	KeyAssignmentPublic
	Share big.Int
}

KeyAssignmentOld - ensures backward compatibility with older versions of the frontend

type KeyAssignmentPublic

type KeyAssignmentPublic struct {
	Index     big.Int
	PublicKey common.Point
	Threshold int
	Verifiers map[string][]string // Verifier => VerifierID
}

KeyAssignmentPublic - holds key fields safe to be shown to non-keyholders

type KeyGenUpdates

type KeyGenUpdates struct {
	Type    string
	Payload interface{}
}

type KeyLookupHandler

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

func (KeyLookupHandler) ServeJSONRPC

func (h KeyLookupHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

Looksup Verifier + VerifierIDs assigned to a key (access structure)

type KeyLookupParams

type KeyLookupParams struct {
	PubKeyX big.Int `json:"pub_key_X"`
	PubKeyY big.Int `json:"pub_key_Y"`
}

type KeyLookupResult

type KeyLookupResult struct {
	KeyAssignmentPublic
}

type KeygenDecision

type KeygenDecision bool

type KeygenProtocolPrefix

type KeygenProtocolPrefix string

type KeygenPubKey

type KeygenPubKey struct {
	DKGID     string       `json:"dkgid"`
	Decided   bool         `json:"decided"`
	GSHSprime common.Point `json:"gshsprime"`
	GS        common.Point `json:"gs"`
}

type KeygennofsmMethods

type KeygennofsmMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	ReceiveMessage(keygenMessage keygennofsm.KeygenMessage) error
	ReceiveBFTMessage(keygenMessage keygennofsm.KeygenMessage) error
}

type KeygennofsmMethodsImpl

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

func (*KeygennofsmMethodsImpl) GetOwner

func (k *KeygennofsmMethodsImpl) GetOwner() (owner string)

func (*KeygennofsmMethodsImpl) ReceiveBFTMessage

func (k *KeygennofsmMethodsImpl) ReceiveBFTMessage(keygenMessage keygennofsm.KeygenMessage) error

func (*KeygennofsmMethodsImpl) ReceiveMessage

func (k *KeygennofsmMethodsImpl) ReceiveMessage(keygenMessage keygennofsm.KeygenMessage) error

func (*KeygennofsmMethodsImpl) SetOwner

func (k *KeygennofsmMethodsImpl) SetOwner(owner string)

type KeygennofsmService

type KeygennofsmService struct {
	idmutex.Mutex

	KeygenNode *keygennofsm.KeygenNode
	// contains filtered or unexported fields
}

func (*KeygennofsmService) Call

func (k *KeygennofsmService) Call(method string, args ...interface{}) (interface{}, error)

func (*KeygennofsmService) GetKeygenProtocolPrefix

func (k *KeygennofsmService) GetKeygenProtocolPrefix(currEpoch int) KeygenProtocolPrefix

func (*KeygennofsmService) Name

func (k *KeygennofsmService) Name() string

func (*KeygennofsmService) OnStart

func (k *KeygennofsmService) OnStart() error

func (*KeygennofsmService) OnStop

func (k *KeygennofsmService) OnStop() error

func (*KeygennofsmService) SetBaseService

func (k *KeygennofsmService) SetBaseService(bs *BaseService)

type MapFreeze

type MapFreeze struct {
	Frozen         bool
	ProposedFreeze map[hexstring]bool
}

MapFreeze -

type MapThaw

type MapThaw struct {
	Thawed       bool
	ProposedThaw map[mappingHash]map[hexstring]bool
}

MapThaw -

type MappingCounter

type MappingCounter struct {
	RequiredCount int
	KeyCount      int
}

type MappingMethods

type MappingMethods interface {
	NewMappingNode(mappingStartData MappingStartData, isOldNode bool, isNewNode bool) error
	ReceiveBFTMessage(mappingID mapping.MappingID, mappingMessage mapping.MappingMessage) error
	GetMappingID(oldEpoch int, newEpoch int) mapping.MappingID
	MappingInstanceExists(mappingID mapping.MappingID) (exists bool)
	GetFreezeState(mappingID mapping.MappingID) (freezeState int, lastUnassignedIndex uint)
	SetFreezeState(mappingID mapping.MappingID, freezeState int, lastUnassignedIndex uint)
	ProposeFreeze(mappingID mapping.MappingID) error
	MappingSummaryFrozen(mappingID mapping.MappingID, mappingSummaryMessage mapping.MappingSummaryMessage) error
	GetMappingProtocolPrefix(oldEpoch int, newEpoch int) MappingProtocolPrefix
}

type MappingMethodsImpl

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

func (*MappingMethodsImpl) GetFreezeState

func (m *MappingMethodsImpl) GetFreezeState(mappingID mapping.MappingID) (freezeState int, lastUnassignedIndex uint)

func (*MappingMethodsImpl) GetMappingID

func (m *MappingMethodsImpl) GetMappingID(oldEpoch int, newEpoch int) mapping.MappingID

func (*MappingMethodsImpl) GetMappingProtocolPrefix

func (m *MappingMethodsImpl) GetMappingProtocolPrefix(oldEpoch int, newEpoch int) (mappingProtocolPrefix MappingProtocolPrefix)

func (*MappingMethodsImpl) GetOwner

func (m *MappingMethodsImpl) GetOwner() (owner string)

func (*MappingMethodsImpl) MappingInstanceExists

func (m *MappingMethodsImpl) MappingInstanceExists(mappingID mapping.MappingID) (exists bool)

func (*MappingMethodsImpl) MappingSummaryFrozen

func (m *MappingMethodsImpl) MappingSummaryFrozen(mappingID mapping.MappingID, mappingSummaryMessage mapping.MappingSummaryMessage) error

func (*MappingMethodsImpl) NewMappingNode

func (m *MappingMethodsImpl) NewMappingNode(mappingStartData MappingStartData, isOldNode bool, isNewNode bool) error

func (*MappingMethodsImpl) ProposeFreeze

func (m *MappingMethodsImpl) ProposeFreeze(mappingID mapping.MappingID) error

func (*MappingMethodsImpl) ReceiveBFTMessage

func (m *MappingMethodsImpl) ReceiveBFTMessage(mappingID mapping.MappingID, mappingMessage mapping.MappingMessage) error

func (*MappingMethodsImpl) SetFreezeState

func (m *MappingMethodsImpl) SetFreezeState(mappingID mapping.MappingID, freezeState int, lastUnassignedIndex uint)

func (*MappingMethodsImpl) SetOwner

func (m *MappingMethodsImpl) SetOwner(owner string)

type MappingProtocolPrefix

type MappingProtocolPrefix string

type MappingService

type MappingService struct {
	MappingInstances map[mapping.MappingID]*mapping.MappingNode
	FreezeState      *FreezeStateSyncMap
	// contains filtered or unexported fields
}

func (*MappingService) Call

func (m *MappingService) Call(method string, args ...interface{}) (result interface{}, err error)

func (*MappingService) GetMappingID

func (m *MappingService) GetMappingID(oldEpoch, newEpoch int) mapping.MappingID

func (*MappingService) GetMappingProtocolPrefix

func (m *MappingService) GetMappingProtocolPrefix(oldEpoch, newEpoch int) MappingProtocolPrefix

func (*MappingService) MappingInstanceExists

func (m *MappingService) MappingInstanceExists(mappingID mapping.MappingID) bool

func (*MappingService) Name

func (m *MappingService) Name() string

func (*MappingService) OnStart

func (m *MappingService) OnStart() error

func (*MappingService) OnStop

func (m *MappingService) OnStop() error

func (*MappingService) SetBaseService

func (m *MappingService) SetBaseService(bs *BaseService)

type MappingStartData

type MappingStartData struct {
	OldEpoch  int
	OldEpochN int
	OldEpochK int
	OldEpochT int
	NewEpoch  int
	NewEpochN int
	NewEpochK int
	NewEpochT int
}

type MessageSource

type MessageSource int
const (
	BFT MessageSource = iota
	P2P
)

type MethodRequest

type MethodRequest struct {
	Caller  string
	Service string
	Method  string
	ID      string
	Data    []interface{}
}

type MethodResponse

type MethodResponse struct {
	Request MethodRequest
	Error   error
	Data    interface{}
}

func ServiceMethod

func ServiceMethod(eventBus eventbus.Bus, caller string, service string, method string, data ...interface{}) MethodResponse

type Middleware

type Middleware func(pss.PSSMessage) (modifiedMessage pss.PSSMessage, end bool, err error)

type NodeDetails

type NodeDetails pcmn.Node

func (*NodeDetails) FromNodeDetailsID

func (n *NodeDetails) FromNodeDetailsID(nodeDetailsID NodeDetailsID)

func (*NodeDetails) ToNodeDetailsID

func (n *NodeDetails) ToNodeDetailsID() NodeDetailsID

type NodeDetailsID

type NodeDetailsID string

type NodeListUpdates

type NodeListUpdates struct {
	Type    string
	Payload interface{}
}

type NodeReference

type NodeReference struct {
	Address         *ethCommon.Address
	Index           *big.Int
	PeerID          peer.ID
	PublicKey       *ecdsa.PublicKey
	TMP2PConnection string
	P2PConnection   string
}

func (NodeReference) Deserialize

func (nodeRef NodeReference) Deserialize(serializedNodeRef SerializedNodeReference) NodeReference

func (NodeReference) Serialize

func (nodeRef NodeReference) Serialize() SerializedNodeReference

type NodeRegister

type NodeRegister struct {
	AllConnected bool
	PSSSending   bool
	NodeList     []*NodeReference
}

func (*NodeRegister) GetNodeByIndex

func (nr *NodeRegister) GetNodeByIndex(index int) *NodeReference

type NodeSignature

type NodeSignature struct {
	Signature   string `json:"signature"`
	Data        string `json:"data"`
	NodePubKeyX string `json:"nodepubx"`
	NodePubKeyY string `json:"nodepuby"`
}

func (*NodeSignature) NodeValidation

func (nodeSig *NodeSignature) NodeValidation(eventBus eventbus.Bus) (*NodeReference, error)

type P2PBasicMsg

type P2PBasicMsg struct {
	// shared between all requests
	Version    p2pMessageVersion `json:"version,omitempty"`
	Timestamp  big.Int           `json:"timestamp,omitempty"`  // unix time
	Id         string            `json:"id,omitempty"`         // allows requesters to use request data when processing a response
	Gossip     bool              `json:"gossip,omitempty"`     // true to have receiver peer gossip the message to neighbors
	NodeId     string            `json:"nodeId,omitempty"`     // id of node that created the message (not the peer that may have sent it). =base58(multihash(nodePubKey))
	NodePubKey []byte            `json:"nodePubKey,omitempty"` // Authoring node Secp256k1 public key (32bytes)
	Sign       []byte            `json:"sign,omitempty"`       // signature of message data + method specific data by message authoring node.
	MsgType    string            `json:"msgtype,omitempty"`    // identifyng message type
	Payload    []byte            `json:"payload"`              // payload data to be unmarshalled
}

func CreateP2PBasicMsg

func CreateP2PBasicMsg(r P2PBasicMsgRaw) P2PBasicMsg

func (*P2PBasicMsg) GetGossip

func (msg *P2PBasicMsg) GetGossip() bool

func (*P2PBasicMsg) GetId

func (msg *P2PBasicMsg) GetId() string

func (*P2PBasicMsg) GetMsgType

func (msg *P2PBasicMsg) GetMsgType() string

func (*P2PBasicMsg) GetNodeId

func (msg *P2PBasicMsg) GetNodeId() string

func (*P2PBasicMsg) GetNodePubKey

func (msg *P2PBasicMsg) GetNodePubKey() []byte

GetNodePubKey - in older versions <= v0.7.0 returns pubkey that is unmarshallable to p2pID secp pubkey Post v0.7.0 this returns a pubkey that is unmarshallable to common.Point{}

func (*P2PBasicMsg) GetPayload

func (msg *P2PBasicMsg) GetPayload() []byte

func (P2PBasicMsg) GetSerializedBody

func (msg P2PBasicMsg) GetSerializedBody() []byte

func (*P2PBasicMsg) GetSign

func (msg *P2PBasicMsg) GetSign() []byte

func (*P2PBasicMsg) GetTimestamp

func (msg *P2PBasicMsg) GetTimestamp() big.Int

func (*P2PBasicMsg) SetSign

func (msg *P2PBasicMsg) SetSign(sig []byte)

type P2PBasicMsgRaw

type P2PBasicMsgRaw struct {
	// shared between all requests
	Timestamp  big.Int
	Id         string
	Gossip     bool
	NodeId     string
	NodePubKey []byte
	Sign       []byte
	MsgType    string
	Payload    []byte
}

type P2PMessage

type P2PMessage interface {
	GetTimestamp() big.Int
	GetId() string
	GetGossip() bool
	GetNodeId() string
	GetNodePubKey() []byte
	GetSign() []byte
	SetSign(sig []byte)
	GetMsgType() string
	GetPayload() []byte
	GetSerializedBody() []byte
}

type P2PMethods

type P2PMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	ID() peer.ID
	SetStreamHandler(protoName string, handler func(StreamMessage)) (err error)
	RemoveStreamHandler(protoName string) (err error)
	AuthenticateMessage(p2pBasicMsg P2PBasicMsg) (err error)
	AuthenticateMessageInEpoch(p2pBasicMsg P2PBasicMsg, epoch int) (err error)
	NewP2PMessage(messageId string, gossip bool, payload []byte, msgType string) (newMsg P2PBasicMsg)
	SignP2PMessage(message P2PMessage) (signature []byte, err error)
	SendP2PMessage(id peer.ID, p protocol.ID, msg P2PMessage) error
	ConnectToP2PNode(nodeP2PConnection string, nodePeerID peer.ID) error
	GetHostAddress() (hostAddress string)
}

type P2PMethodsImpl

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

func (*P2PMethodsImpl) AuthenticateMessage

func (p2p *P2PMethodsImpl) AuthenticateMessage(p2pBasicMsg P2PBasicMsg) (err error)

func (*P2PMethodsImpl) AuthenticateMessageInEpoch

func (p2p *P2PMethodsImpl) AuthenticateMessageInEpoch(p2pBasicMsg P2PBasicMsg, epoch int) (err error)

func (*P2PMethodsImpl) ConnectToP2PNode

func (p2p *P2PMethodsImpl) ConnectToP2PNode(nodeP2PConnection string, nodePeerID peer.ID) error

func (*P2PMethodsImpl) GetHostAddress

func (p2p *P2PMethodsImpl) GetHostAddress() (hostAddress string)

func (*P2PMethodsImpl) GetOwner

func (m *P2PMethodsImpl) GetOwner() (owner string)

func (*P2PMethodsImpl) ID

func (p2p *P2PMethodsImpl) ID() (peerID peer.ID)

func (*P2PMethodsImpl) NewP2PMessage

func (p2p *P2PMethodsImpl) NewP2PMessage(messageId string, gossip bool, payload []byte, msgType string) (newMsg P2PBasicMsg)

func (*P2PMethodsImpl) RemoveStreamHandler

func (p2p *P2PMethodsImpl) RemoveStreamHandler(proto string) error

func (*P2PMethodsImpl) SendP2PMessage

func (p2p *P2PMethodsImpl) SendP2PMessage(id peer.ID, p protocol.ID, msg P2PMessage) error

func (*P2PMethodsImpl) SetOwner

func (m *P2PMethodsImpl) SetOwner(owner string)

func (*P2PMethodsImpl) SetStreamHandler

func (p2p *P2PMethodsImpl) SetStreamHandler(proto string, handler func(StreamMessage)) error

func (*P2PMethodsImpl) SignP2PMessage

func (p2p *P2PMethodsImpl) SignP2PMessage(message P2PMessage) (signature []byte, err error)

type P2PService

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

func (*P2PService) Call

func (p2p *P2PService) Call(method string, args ...interface{}) (interface{}, error)

func (*P2PService) ConnectToP2PNode

func (p2p *P2PService) ConnectToP2PNode(nodeP2PConnection string, nodePeerID peer.ID) error

func (*P2PService) ForwardP2PToEventBus

func (p *P2PService) ForwardP2PToEventBus(proto string)

func (*P2PService) Name

func (p2p *P2PService) Name() string

func (*P2PService) NewP2PMessage

func (p2pService *P2PService) NewP2PMessage(messageId string, gossip bool, payload []byte, msgType string) *P2PBasicMsg

helper method - generate message data shared between all node's p2p protocols messageId: unique for requests, copied from request for responses

func (*P2PService) OnStart

func (p *P2PService) OnStart() error

func (*P2PService) OnStop

func (p2p *P2PService) OnStop() error

func (*P2PService) SetBaseService

func (p2p *P2PService) SetBaseService(bs *BaseService)

func (*P2PService) StopForwardP2PToEventBus

func (p *P2PService) StopForwardP2PToEventBus(proto string)

type P2PSuite

type P2PSuite struct {
	host.Host
	HostAddress ma.Multiaddr
	PingProto   *PingProtocol
}

type PSSDecision

type PSSDecision struct {
	SharingID     string   `json:"sharingid"`
	Decided       bool     `json:"decided"`
	DecidedPSSIDs []string `json:"decidedpssids"`
}

PSSDecision -

type PSSMethods

type PSSMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	PSSInstanceExists(protocolPrefix PSSProtocolPrefix) (exists bool)
	GetPSSProtocolPrefix(oldEpoch int, newEpoch int) (pssProtocolPrefix PSSProtocolPrefix)
	ReceiveBFTMessage(protocolPrefix PSSProtocolPrefix, pssMessage pss.PSSMessage) error
	GetNewNodesN(protocolPrefix PSSProtocolPrefix) (newN int)
	GetNewNodesK(protocolPrefix PSSProtocolPrefix) (newK int)
	GetNewNodesT(protocolPrefix PSSProtocolPrefix) (newT int)
	GetOldNodesN(protocolPrefix PSSProtocolPrefix) (oldN int)
	GetOldNodesK(protocolPrefix PSSProtocolPrefix) (oldK int)
	GetOldNodesT(protocolPrefix PSSProtocolPrefix) (oldT int)
	NewPSSNode(pssStartData PSSStartData, isDealer bool, isPlayer bool) error
	SendPSSMessageToNode(protocolPrefix PSSProtocolPrefix, pssNodeDetails pss.NodeDetails, pssMessage pss.PSSMessage) error
}

type PSSMethodsImpl

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

func (*PSSMethodsImpl) GetEndIndex

func (pss *PSSMethodsImpl) GetEndIndex() (endIndex int)

func (*PSSMethodsImpl) GetNewNodesK

func (pss *PSSMethodsImpl) GetNewNodesK(protocolPrefix PSSProtocolPrefix) (newK int)

func (*PSSMethodsImpl) GetNewNodesN

func (pss *PSSMethodsImpl) GetNewNodesN(protocolPrefix PSSProtocolPrefix) (newN int)

func (*PSSMethodsImpl) GetNewNodesT

func (pss *PSSMethodsImpl) GetNewNodesT(protocolPrefix PSSProtocolPrefix) (newT int)

func (*PSSMethodsImpl) GetOldNodesK

func (pss *PSSMethodsImpl) GetOldNodesK(protocolPrefix PSSProtocolPrefix) (oldK int)

func (*PSSMethodsImpl) GetOldNodesN

func (pss *PSSMethodsImpl) GetOldNodesN(protocolPrefix PSSProtocolPrefix) (oldN int)

func (*PSSMethodsImpl) GetOldNodesT

func (pss *PSSMethodsImpl) GetOldNodesT(protocolPrefix PSSProtocolPrefix) (oldT int)

func (*PSSMethodsImpl) GetOwner

func (pss *PSSMethodsImpl) GetOwner() (owner string)

func (*PSSMethodsImpl) GetPSSProtocolPrefix

func (pss *PSSMethodsImpl) GetPSSProtocolPrefix(oldEpoch int, newEpoch int) (pssProtocolPrefix PSSProtocolPrefix)

func (*PSSMethodsImpl) NewPSSNode

func (pss *PSSMethodsImpl) NewPSSNode(pssStartData PSSStartData, isDealer bool, isPlayer bool) error

func (*PSSMethodsImpl) PSSInstanceExists

func (pss *PSSMethodsImpl) PSSInstanceExists(protocolPrefix PSSProtocolPrefix) (exists bool)

func (*PSSMethodsImpl) ReceiveBFTMessage

func (pss *PSSMethodsImpl) ReceiveBFTMessage(protocolPrefix PSSProtocolPrefix, pssMessage pss.PSSMessage) error

func (*PSSMethodsImpl) SendPSSMessageToNode

func (pss *PSSMethodsImpl) SendPSSMessageToNode(protocolPrefix PSSProtocolPrefix, pssNodeDetails pss.NodeDetails, pssMessage pss.PSSMessage) error

func (*PSSMethodsImpl) SetOwner

func (pss *PSSMethodsImpl) SetOwner(owner string)

type PSSProtocolPrefix

type PSSProtocolPrefix string

type PSSService

type PSSService struct {
	PSSNodeInstances map[PSSProtocolPrefix]*pss.PSSNode
	// contains filtered or unexported fields
}

func (*PSSService) Call

func (p *PSSService) Call(method string, args ...interface{}) (interface{}, error)

func (*PSSService) GetPSSProtocolPrefix

func (pss *PSSService) GetPSSProtocolPrefix(oldEpoch int, newEpoch int) PSSProtocolPrefix

func (*PSSService) Name

func (p *PSSService) Name() string

func (*PSSService) OnStart

func (p *PSSService) OnStart() error

func (*PSSService) OnStop

func (p *PSSService) OnStop() error

func (*PSSService) PSSInstanceExists

func (p *PSSService) PSSInstanceExists(pssProtocolPrefix PSSProtocolPrefix) bool

func (*PSSService) SetBaseService

func (p *PSSService) SetBaseService(bs *BaseService)

type PSSStartData

type PSSStartData struct {
	Message   string
	OldEpoch  int
	OldEpochN int
	OldEpochK int
	OldEpochT int
	NewEpoch  int
	NewEpochN int
	NewEpochK int
	NewEpochT int
}

type PSSSuite

type PSSSuite struct {
	idmutex.Mutex
	Version          string
	FreezeState      int
	EndIndex         uint
	PSSNodeInstances map[PSSProtocolPrefix]*pss.PSSNode
}

type PSSUpdate

type PSSUpdate struct {
	MessageSource MessageSource
	NodeDetails   *NodeReference
	PSSMessage    pss.PSSMessage
}

type PSSWorkerUpdate

type PSSWorkerUpdate struct {
	Type    string
	Payload interface{}
}

type Ping

type Ping struct {
	Message string
}

type PingHandler

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

func (PingHandler) ServeJSONRPC

func (h PingHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

type PingParams

type PingParams struct {
	Message string `json:"message"`
}

type PingProtocol

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

PingProtocol type

func NewPingProtocol

func NewPingProtocol(p2pService *P2PService) *PingProtocol

func (*PingProtocol) Ping

func (p *PingProtocol) Ping(peerID peer.ID) error

Pings a peer

type PingResult

type PingResult struct {
	Message string `json:"message"`
}

type SerializedNodeReference

type SerializedNodeReference struct {
	Address         [20]byte
	Index           big.Int
	PeerID          string
	PublicKey       common.Point
	TMP2PConnection string
	P2PConnection   string
}

type ServerMethods

type ServerMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)
	RequestConnectionDetails(endpoint string) (connectionDetails ConnectionDetails, err error)
}

type ServerMethodsImpl

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

func (*ServerMethodsImpl) GetOwner

func (s *ServerMethodsImpl) GetOwner() (owner string)

func (*ServerMethodsImpl) RequestConnectionDetails

func (s *ServerMethodsImpl) RequestConnectionDetails(endpoint string) (connectionDetails ConnectionDetails, err error)

func (*ServerMethodsImpl) SetOwner

func (s *ServerMethodsImpl) SetOwner(owner string)

type ServerService

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

func (*ServerService) Call

func (s *ServerService) Call(method string, args ...interface{}) (interface{}, error)

func (*ServerService) Name

func (s *ServerService) Name() string

func (*ServerService) OnStart

func (s *ServerService) OnStart() error

func (*ServerService) OnStop

func (s *ServerService) OnStop() error

func (*ServerService) RequestConnectionDetails

func (s *ServerService) RequestConnectionDetails(endpoint string) (connectionDetails ConnectionDetails, err error)

func (*ServerService) SetBaseService

func (s *ServerService) SetBaseService(bs *BaseService)

type Service

type Service interface {
	Start() error
	Stop() error
	IsRunning() bool
	SetServiceCore(ServiceCore)
	String() string
}

Service represents a way to start, stop and get the status of some service. BaseService is the default implementation and should be used by most users. SetServiceCore allows a user to set a ServiceCore. Users should implement their logic using ServiceCore.

type ServiceCore

type ServiceCore interface {
	Name() string
	OnStart() error
	OnStop() error
	Call(method string, args ...interface{}) (result interface{}, err error)
	SetBaseService(*BaseService)
}

ServiceCore is a service that is implemented by a user.

type ServiceLibrary

type ServiceLibrary interface {
	SetOwner(owner string)
	GetOwner() (owner string)
	GetEventBus() eventbus.Bus
	SetEventBus(eventbus.Bus)
	TelemetryMethods() TelemetryMethods
	EthereumMethods() EthereumMethods
	ABCIMethods() ABCIMethods
	TendermintMethods() TendermintMethods
	ServerMethods() ServerMethods
	P2PMethods() P2PMethods
	KeygennofsmMethods() KeygennofsmMethods
	PSSMethods() PSSMethods
	MappingMethods() MappingMethods
	DatabaseMethods() DatabaseMethods
	VerifierMethods() VerifierMethods
	CacheMethods() CacheMethods
}

type ServiceLibraryImpl

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

func NewServiceLibrary

func NewServiceLibrary(eventBus eventbus.Bus, owner string) *ServiceLibraryImpl

func (*ServiceLibraryImpl) ABCIMethods

func (sL *ServiceLibraryImpl) ABCIMethods() ABCIMethods

func (*ServiceLibraryImpl) CacheMethods

func (sL *ServiceLibraryImpl) CacheMethods() CacheMethods

func (*ServiceLibraryImpl) DatabaseMethods

func (sL *ServiceLibraryImpl) DatabaseMethods() DatabaseMethods

func (*ServiceLibraryImpl) EthereumMethods

func (sL *ServiceLibraryImpl) EthereumMethods() EthereumMethods

func (*ServiceLibraryImpl) GetEventBus

func (sL *ServiceLibraryImpl) GetEventBus() eventbus.Bus

func (*ServiceLibraryImpl) GetOwner

func (sL *ServiceLibraryImpl) GetOwner() (owner string)

func (*ServiceLibraryImpl) KeygennofsmMethods

func (sL *ServiceLibraryImpl) KeygennofsmMethods() KeygennofsmMethods

func (*ServiceLibraryImpl) MappingMethods

func (sL *ServiceLibraryImpl) MappingMethods() MappingMethods

func (*ServiceLibraryImpl) P2PMethods

func (sL *ServiceLibraryImpl) P2PMethods() P2PMethods

func (*ServiceLibraryImpl) PSSMethods

func (sL *ServiceLibraryImpl) PSSMethods() PSSMethods

func (*ServiceLibraryImpl) ServerMethods

func (sL *ServiceLibraryImpl) ServerMethods() ServerMethods

func (*ServiceLibraryImpl) SetEventBus

func (sL *ServiceLibraryImpl) SetEventBus(eventBus eventbus.Bus)

func (*ServiceLibraryImpl) SetOwner

func (sL *ServiceLibraryImpl) SetOwner(owner string)

func (*ServiceLibraryImpl) TelemetryMethods

func (sL *ServiceLibraryImpl) TelemetryMethods() TelemetryMethods

func (*ServiceLibraryImpl) TendermintMethods

func (sL *ServiceLibraryImpl) TendermintMethods() TendermintMethods

func (*ServiceLibraryImpl) VerifierMethods

func (sL *ServiceLibraryImpl) VerifierMethods() VerifierMethods

type ServiceRegistry

type ServiceRegistry struct {
	Services map[string]*BaseService
	// contains filtered or unexported fields
}

func NewServiceRegistry

func NewServiceRegistry(eventBus eventbus.Bus, baseServices ...*BaseService) *ServiceRegistry

func (*ServiceRegistry) AddMiddleware

func (s *ServiceRegistry) AddMiddleware(middleware *func(string, interface{}) interface{})

func (*ServiceRegistry) AddRequestMiddleware

func (s *ServiceRegistry) AddRequestMiddleware(middleware *func(methodRequest MethodRequest) MethodRequest)

func (*ServiceRegistry) AddResponseMiddleware

func (s *ServiceRegistry) AddResponseMiddleware(middleware *func(methodResponse MethodResponse) MethodResponse)

func (*ServiceRegistry) RegisterService

func (s *ServiceRegistry) RegisterService(bs *BaseService)

func (*ServiceRegistry) RemoveMiddleware

func (s *ServiceRegistry) RemoveMiddleware(m *func(string, interface{}) interface{})

func (*ServiceRegistry) RemoveRequestMiddleware

func (s *ServiceRegistry) RemoveRequestMiddleware(middleware *func(methodRequest MethodRequest) MethodRequest)

func (*ServiceRegistry) RemoveResponseMiddleware

func (s *ServiceRegistry) RemoveResponseMiddleware(middleware *func(methodResponse MethodResponse) MethodResponse)

func (*ServiceRegistry) SetEventBus

func (s *ServiceRegistry) SetEventBus(e eventbus.Bus)

func (*ServiceRegistry) SetupMethodRouting

func (s *ServiceRegistry) SetupMethodRouting()

type ShareCountHandler

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

func (ShareCountHandler) ServeJSONRPC

func (h ShareCountHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

For testing purposes

type ShareCountParams

type ShareCountParams struct {
}

type ShareCountResult

type ShareCountResult struct {
	Count int `json:"count"`
}

type ShareLog

type ShareLog struct {
	Timestamp          time.Time
	LogNumber          int
	ShareIndex         int
	UnsigncryptedShare []byte
}

type ShareRequestHandler

type ShareRequestHandler struct {
	TimeNow func() time.Time
	// contains filtered or unexported fields
}

func (ShareRequestHandler) ServeJSONRPC

func (h ShareRequestHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

checks id for assignment and then the auth token for verification returns the node's share of the user's key

type ShareRequestItem

type ShareRequestItem struct {
	IDToken            string          `json:"idtoken"`
	NodeSignatures     []NodeSignature `json:"nodesignatures"`
	VerifierIdentifier string          `json:"verifieridentifier"`
}

type ShareRequestParams

type ShareRequestParams struct {
	Item []bijson.RawMessage `json:"item"`
}

type ShareRequestResult

type ShareRequestResult struct {
	Keys []interface{} `json:"keys"`
}

type State

type State struct {
	LastUnassignedIndex    uint                                                                       `json:"last_unassigned_index"`
	LastCreatedIndex       uint                                                                       `json:"last_created_index"`
	BlockTime              time.Time                                                                  `json:"-"`
	NewKeyAssignments      []KeyAssignmentPublic                                                      `json:"new_key_assignments"`
	PSSDecisions           map[string]bool                                                            `json:"pss_decisions"`
	KeygenDecisions        map[string]bool                                                            `json:"keygen_decisions"`
	KeygenPubKeys          map[string]KeygenPubKey                                                    `json:"keygen_pubkeys"`
	MappingProposeFreezes  map[mapping.MappingID]map[NodeDetailsID]bool                               `json:"mapping_propose_freezes"`
	MappingProposeSummarys map[mapping.MappingID]map[mapping.TransferSummaryID]map[NodeDetailsID]bool `json:"mapping_propose_summarys"`
	MappingProposeKeys     map[mapping.MappingID]map[mapping.MappingKeyID]map[NodeDetailsID]bool      `json:"mapping_propose_keys"`
	MappingCounters        map[mapping.MappingID]MappingCounter                                       `json:"mapping_counters"`
	MappingThawed          map[mapping.MappingID]bool                                                 `json:"mapping_thawed"`
	// counter to dump buffer when keygeneration fails across the system
	ConsecutiveFailedPubKeyAssigns uint `json:"consecutive_failed_pubkey_assigns"`
}

State - nothing in state should be a pointer

type StreamMessage

type StreamMessage struct {
	Protocol string
	Message  P2PBasicMsg
}

type TelemetryMethods

type TelemetryMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)
}

type TelemetryMethodsImpl

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

func (*TelemetryMethodsImpl) GetOwner

func (m *TelemetryMethodsImpl) GetOwner() (owner string)

func (*TelemetryMethodsImpl) SetOwner

func (m *TelemetryMethodsImpl) SetOwner(owner string)

type TelemetryService

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

func (*TelemetryService) Call

func (t *TelemetryService) Call(method string, args ...interface{}) (interface{}, error)

func (*TelemetryService) Name

func (t *TelemetryService) Name() string

func (*TelemetryService) OnStart

func (t *TelemetryService) OnStart() error

func (*TelemetryService) OnStop

func (t *TelemetryService) OnStop() error

func (*TelemetryService) SetBaseService

func (t *TelemetryService) SetBaseService(bs *BaseService)

type TendermintMethodResponse

type TendermintMethodResponse struct {
	Error     error
	ByteSlice []byte
}

type TendermintMethods

type TendermintMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	GetNodeKey() (nodeKey tmp2p.NodeKey)
	GetStatus() (status BFTRPCWSStatus)

	Broadcast(tx interface{}) (txHash pcmn.Hash, err error)
	RegisterQuery(query string, count int) (respChannel chan []byte, err error)
	DeregisterQuery(query string) (err error)
}

type TendermintMethodsImpl

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

func (*TendermintMethodsImpl) ABCIQuery

func (t *TendermintMethodsImpl) ABCIQuery(path string, data []byte) (*ctypes.ResultABCIQuery, error)

func (*TendermintMethodsImpl) Broadcast

func (t *TendermintMethodsImpl) Broadcast(tx interface{}) (txHash pcmn.Hash, err error)

func (*TendermintMethodsImpl) DeregisterQuery

func (t *TendermintMethodsImpl) DeregisterQuery(query string) error

func (*TendermintMethodsImpl) GetNodeKey

func (t *TendermintMethodsImpl) GetNodeKey() (nodeKey tmp2p.NodeKey)

func (*TendermintMethodsImpl) GetOwner

func (m *TendermintMethodsImpl) GetOwner() (owner string)

func (*TendermintMethodsImpl) GetStatus

func (t *TendermintMethodsImpl) GetStatus() (status BFTRPCWSStatus)

func (*TendermintMethodsImpl) RegisterQuery

func (t *TendermintMethodsImpl) RegisterQuery(query string, count int) (respChannel chan []byte, err error)

func (*TendermintMethodsImpl) SetOwner

func (m *TendermintMethodsImpl) SetOwner(owner string)

type TendermintService

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

func (*TendermintService) Call

func (t *TendermintService) Call(method string, args ...interface{}) (interface{}, error)

func (*TendermintService) DeregisterQuery

func (t *TendermintService) DeregisterQuery(query string) error

func (*TendermintService) Name

func (t *TendermintService) Name() string

func (*TendermintService) OnStart

func (t *TendermintService) OnStart() error

func (*TendermintService) OnStop

func (t *TendermintService) OnStop() error

func (*TendermintService) RegisterQuery

func (t *TendermintService) RegisterQuery(query string, count int) (chan []byte, context.CancelFunc, error)

func (*TendermintService) RouteWSMessage

func (t *TendermintService) RouteWSMessage(e rpctypes.RPCResponse) error

func (*TendermintService) SetBaseService

func (t *TendermintService) SetBaseService(bs *BaseService)

type TokenCommitmentData

type TokenCommitmentData struct {
	Exists bool
	PubKey common.Point
}

type TransportMessage

type TransportMessage struct {
	Sender common.Point
	Data   []byte
	Sig    []byte
}

type UpdateCommitmentHandler

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

func (UpdateCommitmentHandler) ServeJSONRPC

func (h UpdateCommitmentHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

type UpdatePublicKeyHandler

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

func (UpdatePublicKeyHandler) ServeJSONRPC

func (h UpdatePublicKeyHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

type UpdateShareHandler

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

func (UpdateShareHandler) ServeJSONRPC

func (h UpdateShareHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

type ValidatedNodeSignature

type ValidatedNodeSignature struct {
	NodeSignature
	NodeIndex big.Int
}

type VerifierLookupHandler

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

func (VerifierLookupHandler) ServeJSONRPC

func (h VerifierLookupHandler) ServeJSONRPC(c context.Context, params *bijson.RawMessage) (interface{}, *jsonrpc.Error)

Looksup Keys assigned to a Verifier + VerifierID

type VerifierLookupItem

type VerifierLookupItem struct {
	KeyIndex string  `json:"key_index"`
	PubKeyX  big.Int `json:"pub_key_X"`
	PubKeyY  big.Int `json:"pub_key_Y"`
	Address  string  `json:"address"`
}

type VerifierLookupParams

type VerifierLookupParams struct {
	Verifier   string `json:"verifier"`
	VerifierID string `json:"verifier_id"`
}

type VerifierLookupResult

type VerifierLookupResult struct {
	Keys []VerifierLookupItem `json:"keys"`
}

type VerifierMethods

type VerifierMethods interface {
	SetOwner(owner string)
	GetOwner() (owner string)

	Verify(rawMessage *bijson.RawMessage) (valid bool, verifierID string, err error)
	CleanToken(verifierIdentifier string, idtoken string) (cleanedToken string, err error)
	ListVerifiers() (verifiers []string)
}

type VerifierMethodsImpl

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

func (*VerifierMethodsImpl) CleanToken

func (v *VerifierMethodsImpl) CleanToken(verifierIdentifier string, idtoken string) (cleanedToken string, err error)

func (*VerifierMethodsImpl) GetOwner

func (m *VerifierMethodsImpl) GetOwner() (owner string)

func (*VerifierMethodsImpl) ListVerifiers

func (v *VerifierMethodsImpl) ListVerifiers() (verifiers []string)

func (*VerifierMethodsImpl) SetOwner

func (m *VerifierMethodsImpl) SetOwner(owner string)

func (*VerifierMethodsImpl) Verify

func (v *VerifierMethodsImpl) Verify(rawMessage *bijson.RawMessage) (valid bool, verifierID string, err error)

we pass in pointers here because it has a custom marshaller

type VerifierService

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

func (*VerifierService) Call

func (v *VerifierService) Call(method string, args ...interface{}) (interface{}, error)

func (*VerifierService) Name

func (v *VerifierService) Name() string

func (*VerifierService) OnStart

func (v *VerifierService) OnStart() error

func (*VerifierService) OnStop

func (v *VerifierService) OnStop() error

func (*VerifierService) SetBaseService

func (v *VerifierService) SetBaseService(bs *BaseService)

type WhitelistMonitorUpdates

type WhitelistMonitorUpdates struct {
	Type    string
	Payload interface{}
}

Jump to

Keyboard shortcuts

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