OSDN Git Service

pow
authorjeason <jeason_ustc@163.com>
Fri, 28 Jul 2017 07:08:10 +0000 (00:08 -0700)
committerjeason <jeason_ustc@163.com>
Fri, 28 Jul 2017 07:08:10 +0000 (00:08 -0700)
encoding/blockchain/blockchain.go
log/log.go
rpc/core/routes.go
rpc/core/types/responses.go

index fe803b2..feb7cf4 100644 (file)
@@ -9,7 +9,7 @@ import (
        "math"
        "sync"
 
-       "chain/encoding/bufpool"
+       "github.com/blockchain/encoding/bufpool"
 )
 
 var bufPool = sync.Pool{New: func() interface{} { return new([9]byte) }}
index fda1b64..c5e4cbf 100644 (file)
@@ -14,7 +14,7 @@ import (
        "sync"
        "time"
 
-       "chain/errors"
+       "github.com/blockchain/errors"
 )
 
 const rfc3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00"
index 70c61fe..476ec5b 100644 (file)
@@ -13,6 +13,8 @@ var Routes = map[string]*rpc.RPCFunc{
        // info API
 //     "status":               rpc.NewRPCFunc(Status, ""),
        "net_info":             rpc.NewRPCFunc(NetInfo, ""),
+        "getwork":              rpc.NewRPCFunc(GetWork, ""),
+        "submitwork":           rpc.NewRPCFunc(SubmitWork, ""),
 //     "blockchain":           rpc.NewRPCFunc(BlockchainInfo, "minHeight,maxHeight"),
 //     "genesis":              rpc.NewRPCFunc(Genesis, ""),
 //     "block":                rpc.NewRPCFunc(Block, "height"),
index 9d75eed..56815df 100644 (file)
@@ -6,11 +6,13 @@ import (
        abci "github.com/tendermint/abci/types"
        "github.com/tendermint/go-crypto"
        "github.com/tendermint/go-wire/data"
-
+        "github.com/blockchain/protocol/bc"
        "github.com/blockchain/p2p"
        "github.com/blockchain/types"
 )
 
+type BlockNonce [8]byte
+
 type ResultBlockchainInfo struct {
        LastHeight int                `json:"last_height"`
        BlockMetas []*types.BlockMeta `json:"block_metas"`
@@ -59,6 +61,16 @@ type ResultNetInfo struct {
        Peers     []Peer   `json:"peers"`
 }
 
+type ResultBlockHeaderInfo struct {
+        Version uint64   `json:"version"`
+        Height uint64    `json:"height"`
+        MerkleRoot bc.Hash  `json:"merkleroot"`
+        PreviousBlockHash bc.Hash  `json:"prevblockhash"`
+        TimestampMS uint64   `json:"timestamp"`
+        Bits uint64      `json:"bits"`
+        Nonce uint64     `json:"nonce"`
+}
+
 type ResultDialSeeds struct {
        Log string `json:"log"`
 }