Documentation ¶
Index ¶
- func EncodePartyInfo(pi PartyInfo) []byte
- func EncodePayload(ep EncryptedPayload) []byte
- func EncodePayloadWithRecipients(ep EncryptedPayload, recipients [][]byte) []byte
- func Push(encoded []byte, url string, client utils.HttpClient) (string, error)
- func PushGrpc(encoded []byte, path string, epl EncryptedPayload) error
- type DeleteRequest
- type EncryptedPayload
- type PartyInfo
- func (s *PartyInfo) GetAllValues() (string, map[[nacl.KeySize]byte]string, map[string]bool)
- func (s *PartyInfo) GetPartyInfo()
- func (s *PartyInfo) GetPartyInfoGrpc()
- func (s *PartyInfo) GetRecipient(key nacl.Key) (string, bool)
- func (s *PartyInfo) PollPartyInfo()
- func (s *PartyInfo) RegisterPublicKeys(pubKeys []nacl.Key)
- func (s *PartyInfo) UpdatePartyInfo(encoded []byte)
- func (s *PartyInfo) UpdatePartyInfoGrpc(url string, recipients map[[nacl.KeySize]byte]string, parties map[string]bool)
- type PartyInfoResponse
- type PrivateKey
- type PrivateKeyBytes
- type ReceiveRequest
- type ReceiveResponse
- type ResendRequest
- type SendRequest
- type SendResponse
- type UpdatePartyInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func EncodePartyInfo ¶
func EncodePayload ¶
func EncodePayload(ep EncryptedPayload) []byte
func EncodePayloadWithRecipients ¶
func EncodePayloadWithRecipients(ep EncryptedPayload, recipients [][]byte) []byte
Types ¶
type DeleteRequest ¶
type DeleteRequest struct {
Key string `json:"key"`
}
DeleteRequest deletes the entry matching the given key from the enclave.
type EncryptedPayload ¶
type EncryptedPayload struct { Sender nacl.Key CipherText []byte Nonce nacl.Nonce RecipientBoxes [][]byte RecipientNonce nacl.Nonce }
EncryptedPayload is the struct used for storing all data associated with an encrypted transaction.
func DecodePayload ¶
func DecodePayload(encoded []byte) EncryptedPayload
func DecodePayloadWithRecipients ¶
func DecodePayloadWithRecipients(encoded []byte) (EncryptedPayload, [][]byte)
type PartyInfo ¶
type PartyInfo struct {
// contains filtered or unexported fields
}
PartyInfo is a struct that stores details of all enclave nodes (or parties) on the network.
func CreatePartyInfo ¶
func CreatePartyInfo( url string, otherNodes []string, otherKeys []nacl.Key, client utils.HttpClient) PartyInfo
CreatePartyInfo creates a new PartyInfo struct.
func DecodePartyInfo ¶
func InitPartyInfo ¶
func InitPartyInfo(rawUrl string, otherNodes []string, client utils.HttpClient, grpc bool) PartyInfo
InitPartyInfo initializes a new PartyInfo store.
func (*PartyInfo) GetAllValues ¶
func (*PartyInfo) GetPartyInfo ¶
func (s *PartyInfo) GetPartyInfo()
GetPartyInfo requests PartyInfo data from all remote nodes this node is aware of. The data provided in each response is applied to this node.
func (*PartyInfo) GetPartyInfoGrpc ¶ added in v1.0.0
func (s *PartyInfo) GetPartyInfoGrpc()
func (*PartyInfo) GetRecipient ¶
GetRecipient retrieves the URL associated with the provided recipient.
func (*PartyInfo) PollPartyInfo ¶
func (s *PartyInfo) PollPartyInfo()
func (*PartyInfo) RegisterPublicKeys ¶
RegisterPublicKeys associates the provided public keys with this node.
func (*PartyInfo) UpdatePartyInfo ¶
UpdatePartyInfo updates the PartyInfo datastore with the provided encoded data. This can happen from the /partyinfo server endpoint being hit, or by a response from us hitting another nodes /partyinfo endpoint. TODO: Control access via a channel for updates.
type PartyInfoResponse ¶ added in v1.0.0
type PartyInfoResponse struct {
Payload []byte `json:"payload"`
}
type PrivateKey ¶
type PrivateKey struct { Data PrivateKeyBytes `json:"data"` Type string `json:"type"` }
PrivateKey is a container for a private key.
type PrivateKeyBytes ¶
type PrivateKeyBytes struct {
Bytes string `json:"bytes"`
}
type ReceiveRequest ¶
ReceiveRequest
type ReceiveResponse ¶
type ReceiveResponse struct {
Payload string `json:"payload"`
}
ReceiveResponse returns the raw payload associated with the ReceiveRequest.
type ResendRequest ¶
type ResendRequest struct { // Type is the resend request type. It should be either "all" or "individual" depending on if // you want to request an individual transaction, or all transactions associated with a node. Type string `json:"type"` PublicKey string `json:"publicKey"` Key string `json:"key,omitempty"` }
ResendRequest is used to resend previous transactions. There are two types of supported request. 1. All transactions associated with a node, in which case the Key field should be omitted. 2. A specific transaction with the given key value.
type SendRequest ¶
type SendRequest struct { // Payload is the transaction payload data we wish to store. Payload string `json:"payload"` // From is the sender node identification. From string `json:"from"` // To is a list of the recipient nodes that should be privy to this transaction payload. To []string `json:"to"` }
SendRequest sends a new transaction to the enclave for storage and propagation to the provided recipients.
type SendResponse ¶
type SendResponse struct { // Key is the key that can be used to retrieve the submitted transaction. Key string `json:"key"` }
SendResponse is the response to the SendRequest