core

package
v0.0.0-...-698e449 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2023 License: MIT Imports: 40 Imported by: 1

Documentation

Index

Constants

View Source
const TimeWeight = 1 //Time duration to check for cumulative price
View Source
const TxTimeout = time.Minute * 1

Variables

View Source
var (
	KlaytnClient    *client.Client
	KlaytnClientCtx context.Context
	KlaytnChainId   = os.Getenv("CHAIN_ID")
)

Functions

func DeployNewOracleProviderSample

func DeployNewOracleProviderSample(nodeAddress, adapterId string)

func DryRun

func DryRun(feed protonode.Adapter) ([]*big.Int, error)

DryRun for dev purposes to test if everything will work on production

func NewHttpClient

func NewHttpClient() (*client.Client, error)

func NewNodeServiceClient

func NewNodeServiceClient(bt bootstrap2.BT) (protonode.NodeServiceClient, *grpc.ClientConn, error)

NewNodeServiceClient @Todo this can only be used by bootstrap node to create client conn. other node will fail with auth err

func NewNodeServiceServer

func NewNodeServiceServer(n *Node) (*grpc.Server, error)

func NewWssClient

func NewWssClient()

func Run

func Run(feed protonode.Adapter) (int64, error)

Run should not halt execution of program if error occurred simply pass error back to go routine anonymous function to log

func UpdateRoundAnswer

func UpdateRoundAnswer(adapter *protonode.Adapter, roundAnswer int64) (error, common.Hash)

Types

type Node

type Node struct {
	protonode.UnimplementedNodeServiceServer
	Sever        *grpc.Server
	Organization config.Organization

	Jobs map[string]*protonode.Adapter //Using multiple routines to R&W to channel is safe without mutex.

	LastTxHash string
	LastNonce  *big.Int
	RoundQueue *[]RoundQueue
	// contains filtered or unexported fields
}

func (*Node) AddToKnownPeers

func (n *Node) AddToKnownPeers(ctx context.Context, info *protonode.NodeInfo) (*protonode.Null, error)

func (*Node) FeedHistory

func (*Node) HandShake

func (n *Node) HandShake(ctx context.Context, provider *protonode.DPInfo) (*protonode.HandShakeStatus, error)

func (*Node) ListKnownPeers

func (n *Node) ListKnownPeers(context.Context, *protonode.Null) (*protonode.NodeInfos, error)

func (*Node) NodeJobsCount

func (n *Node) NodeJobsCount(ctx context.Context, null *protonode.Null) (*protonode.JobLength, error)

func (*Node) Peer

func (n *Node) Peer()

func (*Node) QueueJob

func (n *Node) QueueJob(ctx context.Context, adapter *protonode.Adapter) (*protonode.RequestStatus, error)

func (*Node) TotalNetworkRequests

func (n *Node) TotalNetworkRequests(ctx context.Context, null *protonode.Null) (*protonode.JobLength, error)

func (*Node) WatchRoundQueue

func (n *Node) WatchRoundQueue()

type RoundQueue

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

Jump to

Keyboard shortcuts

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