diff --git a/model/client/admin/status/consensus_info_request.go b/model/client/admin/status/consensus_info_request.go new file mode 100644 index 00000000..8b9c9677 --- /dev/null +++ b/model/client/admin/status/consensus_info_request.go @@ -0,0 +1,8 @@ +package status + +type ConsensusInfoRequest struct { +} + +func (*ConsensusInfoRequest) Method() string { + return "consensus_info" +} diff --git a/model/client/admin/status/consensus_info_response.go b/model/client/admin/status/consensus_info_response.go new file mode 100644 index 00000000..aab5c827 --- /dev/null +++ b/model/client/admin/status/consensus_info_response.go @@ -0,0 +1,31 @@ +package status + +import "github.com/xyield/xrpl-go/model/client/common" + +type ConsensusInfoResponse struct { + Info ConsensusInfo `json:"info"` +} + +type ConsensusInfo struct { + Consensus string `json:"consensus,omitempty"` + Acquired map[string]string `json:"acquired,omitempty"` + CloseGranularity int `json:"close_granularity,omitempty"` + ClosePercent int `json:"close_percent,omitempty"` + CloseResolution int `json:"close_resolution,omitempty"` + CloseTimes map[string]int `json:"close_times,omitempty"` + CurrentMs int `json:"current_ms,omitempty"` + HaveTimeConsensus bool `json:"have_time_consensus"` + LedgerSeq common.LedgerIndex `json:"ledger_seq,omitempty"` + OurPosition Position `json:"our_position"` + PeerPositions map[string]Position `json:"peer_positions,omitempty"` + Proposers int `json:"proposers,omitempty"` + State string `json:"state,omitempty"` +} + +type Position struct { + CloseTime uint `json:"close_time"` + PeerId string `json:"peer_id"` + PreviousLedger common.LedgerHash `json:"previous_ledger"` + ProposeSeq int `json:"propose_seq"` + TransactionHash string `json:"transaction_hash"` +} diff --git a/model/client/admin/status/feature_request.go b/model/client/admin/status/feature_request.go new file mode 100644 index 00000000..4daa8148 --- /dev/null +++ b/model/client/admin/status/feature_request.go @@ -0,0 +1,10 @@ +package status + +type FeatureRequest struct { + Feature string `json:"feature,omitempty"` + Vetoed bool `json:"vetoed,omitempty"` +} + +func (*FeatureRequest) Method() string { + return "feature" +} diff --git a/model/client/admin/status/feature_response.go b/model/client/admin/status/feature_response.go new file mode 100644 index 00000000..c398c524 --- /dev/null +++ b/model/client/admin/status/feature_response.go @@ -0,0 +1,14 @@ +package status + +// TODO support deserialization of RPC and Websocket +// Currently only supports websocket +type FeatureResponse struct { + Features map[string]Feature `json:"features"` +} + +type Feature struct { + Enabled bool `json:"enabled"` + Name string `json:"name"` + Supported bool `json:"supported"` + Vetoed bool `json:"vetoed"` +} diff --git a/model/client/admin/status/fetch_info_request.go b/model/client/admin/status/fetch_info_request.go new file mode 100644 index 00000000..c671a759 --- /dev/null +++ b/model/client/admin/status/fetch_info_request.go @@ -0,0 +1,9 @@ +package status + +type FetchInfoRequest struct { + Clear bool `json:"clear"` +} + +func (*FetchInfoRequest) Method() string { + return "fetch_info" +} diff --git a/model/client/admin/status/fetch_info_response.go b/model/client/admin/status/fetch_info_response.go new file mode 100644 index 00000000..d77393ee --- /dev/null +++ b/model/client/admin/status/fetch_info_response.go @@ -0,0 +1,14 @@ +package status + +type FetchInfoResponse struct { + Info map[string]FetchInfo `json:"info"` +} + +type FetchInfo struct { + Hash string `json:"hash"` + HaveHeader bool `json:"have_header"` + HaveTransactions bool `json:"have_transactions"` + NeededStateHashes []string `json:"needed_state_hashes"` + Peers int `json:"peers"` + Timeouts int `json:"timeouts"` +} diff --git a/model/client/admin/status/get_counts_request.go b/model/client/admin/status/get_counts_request.go new file mode 100644 index 00000000..2e72847a --- /dev/null +++ b/model/client/admin/status/get_counts_request.go @@ -0,0 +1,9 @@ +package status + +type GetCountsRequest struct { + MinCount int `json:"min_count,omitempty"` +} + +func (*GetCountsRequest) Method() string { + return "get_counts" +} diff --git a/model/client/admin/status/get_counts_response.go b/model/client/admin/status/get_counts_response.go new file mode 100644 index 00000000..4e61b6a6 --- /dev/null +++ b/model/client/admin/status/get_counts_response.go @@ -0,0 +1,15 @@ +package status + +type GetCountsResponse struct { + Transaction int + Ledger int + NodeObject int + Uptime string `json:"uptime"` + LedgerHitRate float32 `json:"ledger_hit_rate"` + NodeHitRate float32 `json:"node_hit_rate"` + NodeReadBytes int `json:"node_read_bytes"` + NodeReadsHit int `json:"node_reads_hit"` + NodeReadsTotal int `json:"node_reads_total"` + NodeWrites int `json:"node_writes"` + NodeWrittenBytes int `json:"node_written_bytes"` +} diff --git a/model/client/admin/status/validator_info_request.go b/model/client/admin/status/validator_info_request.go new file mode 100644 index 00000000..0ab6ad8b --- /dev/null +++ b/model/client/admin/status/validator_info_request.go @@ -0,0 +1,8 @@ +package status + +type ValidatorInfoRequest struct { +} + +func (*ValidatorInfoRequest) Method() string { + return "validator_info" +} diff --git a/model/client/admin/status/validator_info_response.go b/model/client/admin/status/validator_info_response.go new file mode 100644 index 00000000..8dfdf39f --- /dev/null +++ b/model/client/admin/status/validator_info_response.go @@ -0,0 +1,9 @@ +package status + +type ValidatorInfoResponse struct { + Domain string `json:"domain,omitempty"` + EphemeralKey string `json:"ephemeral_key,omitempty"` + Manifest string `json:"manifest,omitempty"` + MasterKey string `json:"master_key"` + Seq int `json:"seq,omitempty"` +} diff --git a/model/client/admin/status/validator_list_sites_request.go b/model/client/admin/status/validator_list_sites_request.go new file mode 100644 index 00000000..6df3a907 --- /dev/null +++ b/model/client/admin/status/validator_list_sites_request.go @@ -0,0 +1,8 @@ +package status + +type ValidatorListSitesRequest struct { +} + +func (*ValidatorListSitesRequest) Method() string { + return "validator_list_sites" +} diff --git a/model/client/admin/status/validator_list_sites_response.go b/model/client/admin/status/validator_list_sites_response.go new file mode 100644 index 00000000..5bbe2dfe --- /dev/null +++ b/model/client/admin/status/validator_list_sites_response.go @@ -0,0 +1,12 @@ +package status + +type ValidatorListSitesResponse struct { + ValidatorSites []ValidatorSite `json:"validator_sites"` +} + +type ValidatorSite struct { + LastRefreshStatus string `json:"last_refresh_status"` + LastRefreshTime string `json:"last_refresh_time"` + RefreshIntervalMin uint `json:"refresh_interval_min"` + URI string `json:"uri"` +} diff --git a/model/client/admin/status/validators_request.go b/model/client/admin/status/validators_request.go new file mode 100644 index 00000000..354f344f --- /dev/null +++ b/model/client/admin/status/validators_request.go @@ -0,0 +1,8 @@ +package status + +type ValidatorsRequest struct { +} + +func (*ValidatorsRequest) Method() string { + return "validators" +} diff --git a/model/client/admin/status/validators_response.go b/model/client/admin/status/validators_response.go new file mode 100644 index 00000000..6cc351c8 --- /dev/null +++ b/model/client/admin/status/validators_response.go @@ -0,0 +1,19 @@ +package status + +type ValidatorsResponse struct { + LocalStaticKeys []string `json:"local_static_keys"` + PublisherLists []PublisherList `json:"publisher_lists"` + SigningKeys map[string]string `json:"signing_keys"` + TrustedValidatorKeys []string `json:"trusted_validator_keys"` + ValidationQuorum int `json:"validation_quorum"` + ValidatorListExpires string `json:"validator_list_expires"` +} + +type PublisherList struct { + Available bool `json:"available"` + Expiration string `json:"expiration"` + List []string `json:"list"` + PubkeyPublisher string `json:"pubkey_publisher"` + Seq uint `json:"seq"` + Version uint `json:"version"` +}