Documentation ¶
Index ¶
- Constants
- Variables
- func GetAddressKey(address string) string
- func GetCheckpointKey(blockNum *big.Int) string
- func GetExplorerPort(nodePort string) string
- type Address
- type Data
- type HTTPError
- type InaccessibleAddressInfo
- type Service
- func (s *Service) APIs() []rpc.API
- func (s *Service) GetAddresses(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetCirculatingSupply(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetInaccessibleAddressInfo(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetNodeSync(w http.ResponseWriter, r *http.Request)
- func (s *Service) GetTotalSupply(w http.ResponseWriter, r *http.Request)
- func (s *Service) Init()
- func (s *Service) NotifyService(params map[string]interface{})
- func (s *Service) Run() *http.Server
- func (s *Service) SetMessageChan(messageChan chan *msg_pb.Message)
- func (s *Service) Start() error
- func (s *Service) Stop() error
- type StakingTransaction
- type Storage
- func (storage *Storage) Dump(block *types.Block, height uint64)
- func (storage *Storage) GetAddresses(size int, prefix string) ([]string, error)
- func (storage *Storage) GetDB() *leveldb.DB
- func (storage *Storage) Init(ip, port string)
- func (storage *Storage) UpdateTxAddressStorage(addr string, txRecords TxRecords, isStaking bool)
- type Transaction
- type TxRecord
- type TxRecords
Constants ¶
const ( AddressPrefix = "ad" CheckpointPrefix = "dc" PrefixLen = 3 )
Constants for storage.
const ( Received = "RECEIVED" Sent = "SENT" )
Tx types ...
Variables ¶
var ( // InaccessibleAddresses are a list of known eth addresses that cannot spend net tokens. InaccessibleAddresses = []ethCommon.Address{ ethCommon.HexToAddress("0x7bDeF7Bdef7BDeF7BDEf7bDef7bdef7bdeF6E7AD"), } )
Functions ¶
func GetExplorerPort ¶
GetExplorerPort returns the port serving explorer dashboard. This port is explorerPortDifference less than the node port.
Types ¶
type Address ¶
type Address struct { ID string `json:"id"` Balance *big.Int `json:"balance"` TXs TxRecords `json:"txs"` StakingTXs TxRecords `json:"staking_txs"` }
Address ...
type InaccessibleAddressInfo ¶
type InaccessibleAddressInfo struct { EthAddress ethCommon.Address `json:"eth-address"` Address string `json:"address"` Balance numeric.Dec `json:"balance"` Nonce uint64 `json:"nonce"` }
InaccessibleAddressInfo ..
type Service ¶
type Service struct { IP string Port string Storage *Storage // contains filtered or unexported fields }
Service is the struct for explorer service.
func (*Service) GetAddresses ¶
func (s *Service) GetAddresses(w http.ResponseWriter, r *http.Request)
GetAddresses serves end-point /addresses, returns size of addresses from address with prefix.
func (*Service) GetCirculatingSupply ¶
func (s *Service) GetCirculatingSupply(w http.ResponseWriter, r *http.Request)
GetCirculatingSupply serves /circulating-supply end-point. Note that known InaccessibleAddresses have their funds removed from the supply for this endpoint.
func (*Service) GetInaccessibleAddressInfo ¶
func (s *Service) GetInaccessibleAddressInfo(w http.ResponseWriter, r *http.Request)
GetInaccessibleAddressInfo serves /burn-addresses end-point.
func (*Service) GetNodeSync ¶
func (s *Service) GetNodeSync(w http.ResponseWriter, r *http.Request)
GetNodeSync returns status code 500 if node is not in sync
func (*Service) GetTotalSupply ¶
func (s *Service) GetTotalSupply(w http.ResponseWriter, r *http.Request)
GetTotalSupply serves /total-supply end-point. Note that known InaccessibleAddresses have their funds removed from the supply for this endpoint.
func (*Service) NotifyService ¶
NotifyService notify service.
func (*Service) SetMessageChan ¶
SetMessageChan sets up message channel to service.
type StakingTransaction ¶
type StakingTransaction struct {
Transaction
}
StakingTransaction ...
func GetStakingTransaction ¶
func GetStakingTransaction(tx *staking.StakingTransaction, addressBlock *types.Block) (*StakingTransaction, error)
GetStakingTransaction ...
type Storage ¶
type Storage struct {
// contains filtered or unexported fields
}
Storage dump the block info into leveldb.
func GetStorageInstance ¶
GetStorageInstance returns attack model by using singleton pattern.
func (*Storage) GetAddresses ¶
GetAddresses returns size of addresses from address with prefix.
type Transaction ¶
type Transaction struct { ID string `json:"id"` Timestamp string `json:"timestamp"` From string `json:"from"` To string `json:"to"` Value *big.Int `json:"value"` Bytes string `json:"bytes"` Data string `json:"data"` GasFee *big.Int `json:"gasFee"` FromShard uint32 `json:"fromShard"` ToShard uint32 `json:"toShard"` Type string `json:"type"` }
Transaction ...
func GetTransaction ¶
func GetTransaction(tx *types.Transaction, addressBlock *types.Block) (*Transaction, error)
GetTransaction ...