service

package
v0.0.0-...-3d4a0dd Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 31 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockDetailsResponse

type BlockDetailsResponse struct {
	Number           int64                        `json:"number"`
	Hash             string                       `json:"hash"`
	ParentHash       string                       `json:"parentHash"`
	Nonce            string                       `json:"nonce"`
	Sha3Uncles       string                       `json:"sha3Uncles"`
	LogsBloom        string                       `json:"logsBloom"`
	TransactionsRoot string                       `json:"transactionsRoot"`
	StateRoot        string                       `json:"stateRoot"`
	Miner            string                       `json:"miner"`
	Difficulty       int64                        `json:"difficulty"`
	TotalDifficulty  int64                        `json:"totalDifficulty"`
	ExtraData        string                       `json:"extraData"`
	Size             int64                        `json:"size"`
	GasLimit         int64                        `json:"gasLimit"`
	GasUsed          int64                        `json:"gasUsed"`
	Timestamp        int64                        `json:"timestamp"`
	Transactions     []TransactionDetailsResponse `json:"transactions"`
	Uncles           []string                     `json:"uncles"`
	TimeElapsed      int64                        `json:"TimeElapsed"`
}

type ChartInfo

type ChartInfo struct {
	TimeStamp        int `json:"timeStamp"`
	BlockCount       int `json:"blockCount"`
	TransactionCount int `json:"transactionCount"`
}

type ConnectionInfo

type ConnectionInfo struct {
	IP    string `json:"ip"`
	Port  int    `json:"port"`
	Enode string `json:"enode"`
}

type ContractCounter

type ContractCounter struct {
	TotalContracts int `json:"totalContracts"`
	ABIavailable   int `json:"abis"`
}

type ContractJson

type ContractJson struct {
	Filename        string `json:"filename"`
	Interface       string `json:"interface"`
	Bytecode        string `json:"bytecode"`
	ContractAddress string `json:"address"`
	Json            string `json:"json"`
}

type ContractTableRow

type ContractTableRow struct {
	ContractAdd  string `json:"contractAddress"`
	ContractName string `json:"contractName"`
	ABIContent   string `json:"abi"`
	Sender       string `json:"sender"`
	ContractType string `json:"contractType"`
	Description  string `json:"description"`
	Timestamp    string `json:"timestamp"`
}

type CrawledABI

type CrawledABI struct {
	Filename         string `json:"filename"`
	ModificationTime int64  `json:"modificationTime"`
	Processed        bool   `json:"processed"`
	Contractname     string `json:"contractname"`
}

type CreateNetworkScriptArgs

type CreateNetworkScriptArgs struct {
	Nodename          string `json:"nodename,omitempty"`
	CurrentIP         string `json:"currentIP,omitempty"`
	RPCPort           string `json:"rpcPort,omitempty"`
	WhisperPort       string `json:"whisperPort,omitempty"`
	ConstellationPort string `json:"constellationPort,omitempty"`
	NodeManagerPort   string `json:"nodeManagerPort,omitempty"`
}

type DecodeFailure

type DecodeFailure struct {
	Label string `json:"label"`
	Type  string `json:"type"`
}

type GetGenesisResponse

type GetGenesisResponse struct {
	ContstellationPort string `json:"contstellation-port"`
	NetID              string `json:"netID"`
	Genesis            string `json:"genesis"`
}

type GetNmcAddressResponse

type GetNmcAddressResponse struct {
	ContstellationPort string `json:"nmcAddress"`
}

type IPList

type IPList struct {
	WhiteList     []string      `json:"whiteList"`
	ConnectedList []connectedIP `json:"connectedList"`
}

type IstanbulStats

type IstanbulStats struct {
	Validators  []common.Address `json:"validators"`
	BlocksMined []uint32         `json:"blocks_mined"`

	Users           []common.Address `json:"users"`
	GasConsumptions []uint64         `json:"gas_consumptions"`

	MaxGas uint64 `json:"max_gas_used"`
}

type JoinNetworkRequest

type JoinNetworkRequest struct {
	EnodeID   string `json:"enode-id,omitempty"`
	IPAddress string `json:"ip-address,omitempty"`
	Nodename  string `json:"nodename,omitempty"`
	AccPubKey string `json:"acc-pub-key,omitempty"`
	ChainID   string `json:"chain-id,omitempty"`
	Role      string `json:"role,omitempty"`
}

type JoinNetworkResponse

type JoinNetworkResponse struct {
	EnodeID string `json:"enode-id"`
	Status  string `json:"status"`
}

type JoinNetworkScriptArgs

type JoinNetworkScriptArgs struct {
	Nodename              string `json:"nodename,omitempty"`
	CurrentIP             string `json:"currentIP,omitempty"`
	RPCPort               string `json:"rpcPort,omitempty"`
	WhisperPort           string `json:"whisperPort,omitempty"`
	ConstellationPort     string `json:"constellationPort,omitempty"`
	NodeManagerPort       string `json:"nodeManagerPort,omitempty"`
	MasterNodeManagerPort string `json:"masterNodeManagerPort,omitempty"`
	MasterIP              string `json:"masterIP,omitempty"`
}

type LatencyResponse

type LatencyResponse struct {
	EnodeID string `json:"enode-id"`
	Latency string `json:"latency"`
}

type LatestBlockResponse

type LatestBlockResponse struct {
	LatestBlockNumber int64 `json:"latestBlockNumber"`
	TimeElapsed       int64 `json:"TimeElapsed"`
}

type Logs

type Logs struct {
	Address          string   `json:"address"`
	BlockHash        string   `json:"blockHash"`
	BlockNumber      int64    `json:"blockNumber"`
	Data             string   `json:"data"`
	LogIndex         int64    `json:"logIndex"`
	Topics           []string `json:"topics"`
	TransactionHash  string   `json:"transactionHash"`
	TransactionIndex int64    `json:"transactionIndex"`
}

type MailServerConfig

type MailServerConfig struct {
	Host          string `json:"smtpServerHost"`
	Port          string `json:"port"`
	Username      string `json:"username"`
	Password      string `json:"password"`
	RecipientList string `json:"recipientList"`
}

type NodeInfo

type NodeInfo struct {
	NodeName       string           `json:"nodeName"`
	NodeCount      int              `json:"nodeCount"`
	TotalNodeCount int              `json:"totalNodeCount"`
	Active         string           `json:"active"`
	ConnectionInfo ConnectionInfo   `json:"connectionInfo"`
	Role           string           `json:"role"`
	BlockNumber    int64            `json:"blockNumber"`
	PendingTxCount int              `json:"pendingTxCount"`
	AdminInfo      client.AdminInfo `json:"adminInfo"`
	ChainId        int              `json:"chainId"`
}

type NodeList

type NodeList struct {
	NodeName  string `json:"nodeName"`
	Role      string `json:"role,omitempty"`
	PublicKey string `json:"publicKey"`
	IP        string `json:"ip,omitempty"`
	Enode     string `json:"enode,omitempty"`
}

type NodeServiceImpl

type NodeServiceImpl struct {
	Url                      string
	LitionContractClient     *litionScClient.ContractClient
	NodeAccAddress           string
	MiningRegisteredChan     chan struct{}
	MiningRegistered         bool
	NotaryPeriod             int64
	Nms                      *contractclient.NetworkMapContractClient
	LastInternalNotary       int64
	LastLitionScNotaryBlock  int64
	LastProcessedNotaryBlock int64
	NotaryInvokedCounter     uint32
}

func NewNodeServiceImpl

func NewNodeServiceImpl(url string, litionContractClient *litionScClient.ContractClient, nodeAccAddress string, nms *contractclient.NetworkMapContractClient) (*NodeServiceImpl, error)

func (*NodeServiceImpl) ABICrawler

func (nsi *NodeServiceImpl) ABICrawler(url string)

func (*NodeServiceImpl) CheckGethStatus

func (nsi *NodeServiceImpl) CheckGethStatus(url string) bool

func (*NodeServiceImpl) ContractCount

func (nsi *NodeServiceImpl) ContractCount() ContractCounter

func (*NodeServiceImpl) ContractCrawler

func (nsi *NodeServiceImpl) ContractCrawler(url string)

func (*NodeServiceImpl) ContractDetailsUpdateHandler

func (nsi *NodeServiceImpl) ContractDetailsUpdateHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) ContractList

func (nsi *NodeServiceImpl) ContractList() []ContractTableRow

func (*NodeServiceImpl) CreateAccountHandler

func (nsi *NodeServiceImpl) CreateAccountHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) DeployContractHandler

func (nsi *NodeServiceImpl) DeployContractHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) DirectoryCrawl

func (nsi *NodeServiceImpl) DirectoryCrawl()

func (*NodeServiceImpl) GetAccountsHandler

func (nsi *NodeServiceImpl) GetAccountsHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetBlockInfoHandler

func (nsi *NodeServiceImpl) GetBlockInfoHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetChartData

func (nsi *NodeServiceImpl) GetChartData(url string) []ChartInfo

func (*NodeServiceImpl) GetChartDataHandler

func (nsi *NodeServiceImpl) GetChartDataHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetContractCountHandler

func (nsi *NodeServiceImpl) GetContractCountHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetContractListHandler

func (nsi *NodeServiceImpl) GetContractListHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetCurrentNodeHandler

func (nsi *NodeServiceImpl) GetCurrentNodeHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetGenesisHandler

func (nsi *NodeServiceImpl) GetGenesisHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetLatestBlockInfoHandler

func (nsi *NodeServiceImpl) GetLatestBlockInfoHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetLatestTransactionInfoHandler

func (nsi *NodeServiceImpl) GetLatestTransactionInfoHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetNmcAddress

func (nsi *NodeServiceImpl) GetNmcAddress(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetOtherPeerHandler

func (nsi *NodeServiceImpl) GetOtherPeerHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetStatistics

func (nsi *NodeServiceImpl) GetStatistics(from int64, to int64) (*IstanbulStats, error)

func (*NodeServiceImpl) GetTransactionInfoHandler

func (nsi *NodeServiceImpl) GetTransactionInfoHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) GetTransactionReceiptHandler

func (nsi *NodeServiceImpl) GetTransactionReceiptHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) InitInternalContract

func (nsi *NodeServiceImpl) InitInternalContract(url string)

func (*NodeServiceImpl) JoinRequestResponseHandler

func (nsi *NodeServiceImpl) JoinRequestResponseHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) LatencyHandler

func (nsi *NodeServiceImpl) LatencyHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) LatestBlockHandler

func (nsi *NodeServiceImpl) LatestBlockHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) LogCleanerGeth

func (nsi *NodeServiceImpl) LogCleanerGeth()

func (*NodeServiceImpl) LogRotaterConst

func (nsi *NodeServiceImpl) LogRotaterConst()

func (*NodeServiceImpl) LogRotaterGeth

func (nsi *NodeServiceImpl) LogRotaterGeth()

@TODO: Implement logrotate command to do this.

func (*NodeServiceImpl) NetworkManagerContractDeployer

func (nsi *NodeServiceImpl) NetworkManagerContractDeployer(url string)

func (*NodeServiceImpl) Notary

func (nsi *NodeServiceImpl) Notary(privateKey *ecdsa.PrivateKey)

func (*NodeServiceImpl) OptionsHandler

func (nsi *NodeServiceImpl) OptionsHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) ProposeValidator

func (nsi *NodeServiceImpl) ProposeValidator(event *litionScClient.LitionScClientAccountMining)

This wrapper is used in event listener for automatic voting

func (*NodeServiceImpl) RegisterNodeDetails

func (nsi *NodeServiceImpl) RegisterNodeDetails(url string)

func (*NodeServiceImpl) TransactionSearchHandler

func (nsi *NodeServiceImpl) TransactionSearchHandler(w http.ResponseWriter, r *http.Request)

func (*NodeServiceImpl) UnvoteValidatorInternal

func (nsi *NodeServiceImpl) UnvoteValidatorInternal(validatorAddress string)

func (*NodeServiceImpl) UpdateLastMainnetNotary

func (nsi *NodeServiceImpl) UpdateLastMainnetNotary(event *litionScClient.LitionScClientNotary)

type PendingRequests

type PendingRequests struct {
	NodeName string `json:"nodeName"`
	Enode    string `json:"enode"`
	Message  string `json:"message"`
	EnodeID  string `json:"enodeid"`
	IP       string `json:"ip"`
}

type SuccessResponse

type SuccessResponse struct {
	Status string `json:"statusMessage"`
}

type SuccessResponseBool

type SuccessResponseBool struct {
	Status bool `json:"statusMessage"`
}

type TransactionDetailsResponse

type TransactionDetailsResponse struct {
	BlockHash        string `json:"blockHash"`
	BlockNumber      int64  `json:"blockNumbe"`
	From             string `json:"from"`
	Gas              int64  `json:"gas"`
	GasPrice         int64  `json:"gasPrice"`
	Hash             string `json:"hash"`
	Input            string `json:"input"`
	Nonce            int64  `json:"nonce"`
	To               string `json:"to"`
	TransactionIndex int64  `json:"transactionIndex"`
	Value            int64  `json:"value"`
	V                string `json:"v"`
	R                string `json:"r"`
	S                string `json:"s"`
	TransactionType  string `json:"transactionType"`
	TimeElapsed      int64  `json:"TimeElapsed"`
}

type TransactionReceiptResponse

type TransactionReceiptResponse struct {
	BlockHash         string                         `json:"blockHash"`
	BlockNumber       int64                          `json:"blockNumber"`
	ContractAddress   string                         `json:"contractAddress"`
	CumulativeGasUsed int64                          `json:"cumulativeGasUsed"`
	From              string                         `json:"from"`
	Gas               int64                          `json:"gas"`
	GasPrice          int64                          `json:"gasPrice"`
	GasUsed           int64                          `json:"gasUsed"`
	Input             string                         `json:"input"`
	Logs              []Logs                         `json:"logs"`
	LogsBloom         string                         `json:"logsBloom"`
	Nonce             int64                          `json:"nonce"`
	Root              string                         `json:"root"`
	To                string                         `json:"to"`
	TransactionHash   string                         `json:"transactionHash"`
	TransactionIndex  int64                          `json:"transactionIndex"`
	Value             int64                          `json:"value"`
	V                 string                         `json:"v"`
	R                 string                         `json:"r"`
	S                 string                         `json:"s"`
	TransactionType   string                         `json:"transactionType"`
	TimeElapsed       int64                          `json:"TimeElapsed"`
	DecodedInputs     []contractclient.ParamTableRow `json:"decodedInputs,omitempty"`
	FunctionDetails   string                         `json:"functionDetails,omitempty"`
	DecodeFailed      DecodeFailure                  `json:"decodeFailed,omitempty"`
}

Jump to

Keyboard shortcuts

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