From ef642113c8d1bde2eaa2df7b5b750de4e205721c Mon Sep 17 00:00:00 2001 From: laizy Date: Fri, 7 Dec 2018 18:55:16 +0800 Subject: [PATCH] config travis (#3) --- .travis.yml | 12 ++- cli/LevelDBQuery/LevelDBQuery.go | 157 ------------------------------- 2 files changed, 9 insertions(+), 160 deletions(-) delete mode 100644 cli/LevelDBQuery/LevelDBQuery.go diff --git a/.travis.yml b/.travis.yml index 314be443..eda3f2c6 100755 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,15 @@ language: go +go: + - 1.10.x + +go_import_path: DNA + install: - - grep 'import' -rl ./| grep ".go"| xargs sed -i 's#"DNA/#"github.com/DNAProject/DNA/#g' - go get github.com/Masterminds/glide - glide install -go: - - 1.8.x +script: + - make + # - go test -v ./... + diff --git a/cli/LevelDBQuery/LevelDBQuery.go b/cli/LevelDBQuery/LevelDBQuery.go deleted file mode 100644 index 5f574a20..00000000 --- a/cli/LevelDBQuery/LevelDBQuery.go +++ /dev/null @@ -1,157 +0,0 @@ -package main - -import ( - "DNA/crypto" - "DNA/core/ledger" - "DNA/core/store" - ."DNA/common" - "DNA/common/log" - "encoding/hex" - "os" - "fmt" -) - -const ( - path string = "./Log" -) - -var Usage = func() { - fmt.Println("Usage:") - fmt.Println(" dump"); - fmt.Println(" block "); - fmt.Println(" tx "); - fmt.Println(" asset "); -} - -func DumpDB() { - fd,_:=os.OpenFile("dump.txt",os.O_RDWR|os.O_CREATE,0644) - - i := 0 - for (true) { - hash, err := ledger.DefaultLedger.Store.GetBlockHash(uint32(i)) - if err != nil { - fmt.Println("Dump() ok.") - return - } - - block,err := ledger.DefaultLedger.Store.GetBlock(hash) - if err != nil { - fmt.Println("GetBlock() err!") - return - } - - fd.Write( []byte(fmt.Sprintf("Block height: %d\n", block.Blockdata.Height)) ) - h := block.Blockdata.Hash() - fd.Write( []byte(fmt.Sprintf( "Block hash: %x\n", h.ToArray() )) ) - fd.Write( []byte(fmt.Sprintf( "Block timestamp: %d\n", block.Blockdata.Timestamp )) ) - fd.Write( []byte(fmt.Sprintf( "Block transactionsRoot :%x\n", block.Blockdata.TransactionsRoot )) ) - fd.Write( []byte(fmt.Sprintf( "Tx Len: %d\n", len(block.Transcations) )) ) - - for k:=0; k