Documentation ¶
Index ¶
- Constants
- func CheckSig(msg *msgjson.Message, pubKey *secp256k1.PublicKey) error
- func MessageDigest(msg *msgjson.Message) [32]byte
- func MustNotification(route string, payload any) *msgjson.Message
- func MustRequest(route string, payload any) *msgjson.Message
- func MustResponse(id uint64, payload any, rpcErr *msgjson.Error) *msgjson.Message
- func NewMessageID() uint64
- func SignMessage(priv *secp256k1.PrivateKey, msg *msgjson.Message)
- func Truncate(b []byte) string
- type Broadcast
- type BroadcastMessageType
- type Connect
- type Disconnect
- type FundedMessage
- type NewSubscriber
- type PathInquiry
- type RateMessage
- type RemoteReputation
- type Subscription
- type Tankagram
- type TankagramResult
- type TankagramResultType
- type TatankaConfig
- type Troll
- type Unsubscription
Constants ¶
View Source
const ( ErrNone = iota ErrTimeout ErrInternal ErrBadRequest ErrAuth ErrSig ErrNoConfig ErrBannned ErrFailedRelay )
View Source
const ( // tatanka <=> tatanka RouteTatankaConfig = "tatanka_config" RouteTatankaConnect = "tatanka_connect" RouteNewClient = "new_client" RouteClientDisconnect = "client_disconnect" RouteGetReputation = "get_reputation" RouteRelayBroadcast = "relay_broadcast" RouteRelayTankagram = "relay_tankagram" RoutePathInquiry = "path_inquiry" // tatanka <=> client RouteConnect = "connect" RouteConfig = "config" RoutePostBond = "post_bond" RouteSubscribe = "subscribe" RouteUnsubscribe = "unsubscribe" RouteRates = "rates" // client1 <=> tatankanode <=> client2 RouteTankagram = "tankagram" RouteEncryptionKey = "encryption_key" RouteBroadcast = "broadcast" RouteNewSubscriber = "new_subscriber" )
View Source
const ( TopicMarket = "market" TopicFiatRate = "fiat_rate" )
Variables ¶
This section is empty.
Functions ¶
func CheckSig ¶
CheckSig checks that the message's signature was created with the private key for the provided secp256k1 public key on the sha256 hash of the message.
func MessageDigest ¶
func MustResponse ¶
func NewMessageID ¶
func NewMessageID() uint64
func SignMessage ¶
Types ¶
type BroadcastMessageType ¶
type BroadcastMessageType string
const ( MessageTypeTrollBox BroadcastMessageType = "troll_box" MessageTypeNewOrder BroadcastMessageType = "new_order" MessageTypeProposeMatch BroadcastMessageType = "propose_match" MessageTypeAcceptMatch BroadcastMessageType = "accept_match" MessageTypeNewSubscriber BroadcastMessageType = "new_subscriber" MessageTypeUnsubTopic BroadcastMessageType = "unsub_topic" MessageTypeUnsubSubject BroadcastMessageType = "unsub_subject" )
type Disconnect ¶
type Disconnect = Connect
type FundedMessage ¶
type FundedMessage struct { AssetID uint32 `json:"assetID"` Funding json.RawMessage `json:"funding"` Msg msgjson.Message `json:"msg"` }
type NewSubscriber ¶
type PathInquiry ¶
type PathInquiry = Connect
type RateMessage ¶
type RateMessage struct { Topic tanka.Topic `json:"topic"` Rates map[string]*fiatrates.FiatRateInfo `json:"rates"` }
type RemoteReputation ¶
type Subscription ¶
type TankagramResult ¶
type TankagramResult struct { Result TankagramResultType `json:"result"` Response dex.Bytes `json:"response"` // If the tankagram is not transmitted, the server will stamp and sign the // tankagram separately. Stamp uint64 `json:"stamp"` Sig dex.Bytes `json:"sig"` }
func (*TankagramResult) Sign ¶
func (r *TankagramResult) Sign(priv *secp256k1.PrivateKey)
type TankagramResultType ¶
type TankagramResultType string
TankagramResultType is a critical component of the mesh network's reputation system. The outcome of self-reported audits of counterparty failures will depend heavily on what signed TankagramResult.Result is submitted.
const ( TRTTransmitted TankagramResultType = "transmitted" TRTNoPath TankagramResultType = "nopath" TRTErrFromPeer TankagramResultType = "errorfrompeer" TRTErrFromTanka TankagramResultType = "errorfromtanka" TRTErrBadClient TankagramResultType = "badclient" )
type TatankaConfig ¶
Click to show internal directories.
Click to hide internal directories.