service

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Valid = iota
	Expired
	Deactivated
	NonExist
)

Variables

This section is empty.

Functions

func GetPayloadInfo

func GetPayloadInfo(p types.Payload, pVersion byte) service.PayloadInfo

func GetTransactionInfo

func GetTransactionInfo(cfg *service.Config, header interfaces.Header, tx *types.Transaction) *service.TransactionInfo

func GetTransactionInfoFromBytes

func GetTransactionInfoFromBytes(txInfoBytes []byte) (*service.TransactionInfo, error)

Types

type Config added in v0.1.0

type Config struct {
	service.Config
	Params   *config.Params
	Compile  string
	NodePort uint16
	RPCPort  uint16
	RestPort uint16
	WSPort   uint16
	Store    *blockchain.IDChainStore
}

type DidDocState added in v0.1.3

type DidDocState uint8

func (DidDocState) String added in v0.1.3

func (c DidDocState) String() string

type HttpService added in v0.1.0

type HttpService struct {
	*service.HttpService
	// contains filtered or unexported fields
}

func NewHttpService

func NewHttpService(cfg *Config) *HttpService

func (*HttpService) GetIdentificationTxByIdAndPath added in v0.1.0

func (s *HttpService) GetIdentificationTxByIdAndPath(param http.Params) (interface{}, error)

func (*HttpService) GetNodeState added in v0.1.0

func (s *HttpService) GetNodeState(param http.Params) (interface{}, error)

func (*HttpService) ListUnspent added in v0.1.0

func (s *HttpService) ListUnspent(param http.Params) (interface{}, error)

func (*HttpService) ResolveDID added in v0.1.3

func (s *HttpService) ResolveDID(param http.Params) (interface{}, error)

type PeerInfo added in v0.1.0

type PeerInfo struct {
	NetAddress     string `json:"netaddress"`
	Services       string `json:"services"`
	RelayTx        bool   `json:"relaytx"`
	LastSend       string `json:"lastsend"`
	LastRecv       string `json:"lastrecv"`
	ConnTime       string `json:"conntime"`
	TimeOffset     int64  `json:"timeoffset"`
	Version        uint32 `json:"version"`
	Inbound        bool   `json:"inbound"`
	StartingHeight uint32 `json:"startingheight"`
	LastBlock      uint32 `json:"lastblock"`
	LastPingTime   string `json:"lastpingtime"`
	LastPingMicros int64  `json:"lastpingmicros"`
}

type RegisterIdentificationContentInfo

type RegisterIdentificationContentInfo struct {
	Path   string                            `json:"path"`
	Values []RegisterIdentificationValueInfo `json:"values"`
}

type RegisterIdentificationInfo

type RegisterIdentificationInfo struct {
	Id       string                              `json:"id"`
	Sign     string                              `json:"sign"`
	Contents []RegisterIdentificationContentInfo `json:"contents"`
}

type RegisterIdentificationValueInfo

type RegisterIdentificationValueInfo struct {
	DataHash string `json:"datahash"`
	Proof    string `json:"proof"`
	Info     string `json:"info"`
}

type RpcOperation added in v0.1.3

type RpcOperation struct {
	Header  id.DIDHeaderInfo `json:"header"`
	Payload string           `json:"payload"`
	Proof   id.DIDProofInfo  `json:"proof"`
}

type RpcPayloadDIDInfo added in v0.1.3

type RpcPayloadDIDInfo struct {
	DID        string                `json:"did"`
	Status     int                   `json:"status"`
	RpcTXDatas []RpcTranasactionData `json:"transaction,omitempty"`
}

payload of DID transaction

type RpcTranasactionData added in v0.1.3

type RpcTranasactionData struct {
	TXID      string       `json:"txid"`
	Timestamp string       `json:"timestamp"`
	Operation RpcOperation `json:"operation"`
}

func (*RpcTranasactionData) FromTranasactionData added in v0.1.3

func (rpcTxData *RpcTranasactionData) FromTranasactionData(txData id.
	TranasactionData) bool

type ServerInfo added in v0.1.0

type ServerInfo struct {
	Compile   string      `json:"compile"`   // The compile version of this server node
	Height    uint32      `json:"height"`    // The ServerNode latest block height
	Version   uint32      `json:"version"`   // The network protocol the ServerNode used
	Services  string      `json:"services"`  // The services the server supports
	Port      uint16      `json:"port"`      // The nodes's port
	RPCPort   uint16      `json:"rpcport"`   // The RPC service port
	RestPort  uint16      `json:"restport"`  // The RESTful service port
	WSPort    uint16      `json:"wsport"`    // The webservcie port
	Neighbors []*PeerInfo `json:"neighbors"` // The connected neighbor peers.
}

Jump to

Keyboard shortcuts

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