ccq

package
v0.0.0-...-7be3494 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2024 License: Apache-2.0 Imports: 39 Imported by: 0

Documentation

Index

Constants

View Source
const CCQ_SERVER_SIGNING_KEY = "CCQ SERVER SIGNING KEY"
View Source
const DEV_NETWORK_ID = "/deltaswap/dev"
View Source
const ETH_CALL_SIG_LENGTH = 4
View Source
const MAX_BODY_SIZE = 5 * 1024 * 1024

Variables

View Source
var QueryServerCmd = &cobra.Command{
	Use:   "query-server",
	Short: "Run the cross-chain query server",
	Run:   runQueryServer,
}

Functions

func FetchCurrentPhylaxSet

func FetchCurrentPhylaxSet(rpcUrl, coreAddr string) (*common.PhylaxSet, error)

func NewHTTPServer

func NewHTTPServer(addr string, t *pubsub.Topic, permissions Permissions, signerKey *ecdsa.PrivateKey, p *PendingResponses, logger *zap.Logger, env common.Environment) *http.Server

func NewStatusServer

func NewStatusServer(addr string, logger *zap.Logger, env common.Environment) *http.Server

Types

type AllowedCall

type AllowedCall struct {
	EthCall             *EthCall             `json:"ethCall"`
	EthCallByTimestamp  *EthCallByTimestamp  `json:"ethCallByTimestamp"`
	EthCallWithFinality *EthCallWithFinality `json:"ethCallWithFinality"`
}

type Config

type Config struct {
	Permissions []User `json:"Permissions"`
}

type EthCall

type EthCall struct {
	Chain           int    `json:"chain"`
	ContractAddress string `json:"contractAddress"`
	Call            string `json:"call"`
}

type EthCallByTimestamp

type EthCallByTimestamp struct {
	Chain           int    `json:"chain"`
	ContractAddress string `json:"contractAddress"`
	Call            string `json:"call"`
}

type EthCallWithFinality

type EthCallWithFinality struct {
	Chain           int    `json:"chain"`
	ContractAddress string `json:"contractAddress"`
	Call            string `json:"call"`
}

type P2PSub

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

type PendingResponse

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

func NewPendingResponse

func NewPendingResponse(req *gossipv1.SignedQueryRequest) *PendingResponse

type PendingResponses

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

func NewPendingResponses

func NewPendingResponses() *PendingResponses

func (*PendingResponses) Add

func (*PendingResponses) Get

func (p *PendingResponses) Get(signature string) *PendingResponse

func (*PendingResponses) Remove

func (p *PendingResponses) Remove(r *PendingResponse)

type Permissions

type Permissions map[string]*permissionEntry

type PhylaxSignature

type PhylaxSignature struct {
	Index     int
	Signature string
}

type SignedResponse

type SignedResponse struct {
	Response   *query.QueryResponsePublication
	Signatures []PhylaxSignature
}

type User

type User struct {
	UserName      string        `json:"userName"`
	ApiKey        string        `json:"apiKey"`
	AllowUnsigned bool          `json:"allowUnsigned"`
	AllowedCalls  []AllowedCall `json:"allowedCalls"`
}

Jump to

Keyboard shortcuts

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