Web 浏览器

可以查看链、区块、交易的所有信息。

dero_explorer
DERO Atlantis Explorer: A secure, private blockchain with smart-contracts

Usage:
  dero_explorer [--help] [--version] [--debug] [--rpc-server-address=<127.0.0.1:18091>] [--http-address=<0.0.0.0:8080>] 
  dero_explorer -h | --help
  dero_explorer --version

Options:
  -h --help     Show this screen.
  --version     Show version.
  --debug       Debug mode enabled, print log messages
  --rpc-server-address=<127.0.0.1:18091>  connect to this daemon port as client
  --http-address=<0.0.0.0:8080>    explorer listens on this port to serve user requests

交易信息

// all the tx info which ever needs to be printed
type txinfo struct {
    Hex          string // raw tx
    Height       string // height at which tx was mined
    Depth        int64
    Timestamp    uint64 // timestamp
    Age          string //  time diff from current time
    Block_time   string // UTC time from block header
    Epoch        uint64 // Epoch time
    In_Pool      bool   // whether tx was in pool
    Hash         string // hash for hash
    PrefixHash   string // prefix hash
    Version      int    // version of tx
    Size         string // size of tx in KB
    Sizeuint64   uint64 // size of tx in bytes
    Fee          string // fee in TX
    Feeuint64    uint64 // fee in atomic units
    In           int    // inputs counts
    Out          int    // outputs counts
    Amount       string
    CoinBase     bool     // is tx coin base
    Extra        string   // extra within tx
    Keyimages    []string // key images within tx
    OutAddress   []string // contains output secret key
    OutOffset    []uint64 // contains index offsets
    Type         string   // ringct or ruffct ( bulletproof)
    ValidBlock   string   // the tx is valid in which block
    InvalidBlock []string // the tx is invalid in which block
    Skipped      bool     // this is only valid, when a block is being listed
    Ring_size    int
    Ring         [][]globals.TX_Output_Data

    TXpublickey string
    PayID32     string // 32 byte payment ID
    PayID8      string // 8 byte encrypted payment ID


    Proof_address string // address agains which which the proving ran
    Proof_index  int64  // proof satisfied for which index
    Proof_amount string // decoded amount 
    Proof_PayID8 string // decrypted 8 byte payment id
    Proof_error  string // error if any while decoding proof

}

如何解决不同区块内的打包交易的交易冲突问题

(重复打包交易,区别于双花支付)

当交易冲突时,时间稍后的冲突交易会被“discard”掉,这个被丢弃的交易是怎样和有效交易进行状态区分的?

答:本地标记。区块排序的一致可以保证“无效交易标记”的一致。

由于每笔交易是否有效是每个矿工自己做出的判断,而没有持久化写在区块中,所以无法实现像比特币那样,通过Merkle Path向轻节点证明一个交易在区块中,因为你无法通过Merkle Path知道它是有效的还是无效的。

上述的 Skipped 字段起到标记作用。

在区块浏览器中就可以查到这种状态。

区块信息

// any information for block which needs to be printed
type block_info struct {
    Major_Version uint64
    Minor_Version uint64
    Height        int64
    TopoHeight    int64
    Depth         int64
    Timestamp     uint64
    Hash          string
    Tips          []string
    Nonce         uint64
    Fees          string
    Reward        string
    Size          string
    Age           string //  time diff from current time
    Block_time    string // UTC time from block header
    Epoch         uint64 // Epoch time
    Outputs       string
    Mtx           txinfo
    Txs           []txinfo
    Orphan_Status bool
    SyncBlock     bool // whether the block is sync block
    Tx_Count      int
}

架构设计:

本身是一个 net/http 所以启动、管理很方便。

  • 路由层(不同请求过来,让对应的 Handle 进行处理)
  • 核心业务层(主要是通过 rpcClient 发送请求让系统处理;这里只做简单的事前、事后处理,然后返回结果)
  • 表现层(即页面,用的是 html/template 模板)

results matching ""

    No results matching ""