From 4b4e8b00119bb10133dfdf2dfd0cb2ab28d675a4 Mon Sep 17 00:00:00 2001 From: jeason Date: Fri, 28 Jul 2017 00:08:10 -0700 Subject: [PATCH] pow --- encoding/blockchain/blockchain.go | 2 +- log/log.go | 2 +- rpc/core/routes.go | 2 ++ rpc/core/types/responses.go | 14 +++++++++++++- 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/encoding/blockchain/blockchain.go b/encoding/blockchain/blockchain.go index fe803b28..feb7cf47 100644 --- a/encoding/blockchain/blockchain.go +++ b/encoding/blockchain/blockchain.go @@ -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) }} diff --git a/log/log.go b/log/log.go index fda1b64f..c5e4cbf4 100644 --- a/log/log.go +++ b/log/log.go @@ -14,7 +14,7 @@ import ( "sync" "time" - "chain/errors" + "github.com/blockchain/errors" ) const rfc3339NanoFixed = "2006-01-02T15:04:05.000000000Z07:00" diff --git a/rpc/core/routes.go b/rpc/core/routes.go index 70c61fed..476ec5b7 100644 --- a/rpc/core/routes.go +++ b/rpc/core/routes.go @@ -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"), diff --git a/rpc/core/types/responses.go b/rpc/core/types/responses.go index 9d75eed1..56815dff 100644 --- a/rpc/core/types/responses.go +++ b/rpc/core/types/responses.go @@ -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"` } -- 2.11.0