blocknotify-dcr: use glide to build with dcrrpcclient

and remove dcrd < 0.6 dead code

glide lock set on dcrd v1.0.1
This commit is contained in:
Tanguy Pruvot 2017-04-28 23:46:14 +02:00
parent 2d4b671f30
commit fb8de32664
4 changed files with 70 additions and 27 deletions

View file

@ -1,9 +1,13 @@
OUT_GO=blocknotify-dcr OUT_GO=blocknotify-dcr
OUTPUT=blocknotify-dcr OUTPUT=blocknotify-dcr
ROOT=`pwd`
all: all:
rm -f $(OUT_GO) rm -f $(OUT_GO)
go build rm -rf vendor
glide install
ln -s ../vendor vendor/src
GOPATH="$(GOPATH):$(ROOT)/vendor" go build
install: all install: all
strip -s $(OUT_GO) strip -s $(OUT_GO)
@ -11,3 +15,7 @@ install: all
mv $(OUT_GO) ../bin/$(OUTPUT) mv $(OUT_GO) ../bin/$(OUTPUT)
sh -c "../bin/$(OUTPUT) &" sh -c "../bin/$(OUTPUT) &"
clean:
rm -f $(OUT_GO)
rm -rf vendor

View file

@ -1,9 +1,8 @@
// Copyright (c) 2015-2016 The Decred developers, YiiMP // Copyright (c) 2015-2017 YiiMP
// Use of this source code is governed by an ISC
// license that can be found in the LICENSE file. // Sample blocknotify wrapper tool compatible with decred notifications
// will call the standard bin/blocknotify yiimp tool on new block event.
// Sample blocknofify tool compatible with decred
// will call the standard blocknotify yiimp tool on new block event.
// Note: this tool is connected directly to dcrd, not to the wallet! // Note: this tool is connected directly to dcrd, not to the wallet!
package main package main
@ -14,9 +13,6 @@ import (
"os/exec" "os/exec"
"path/filepath" "path/filepath"
// "time" // dcrd < 0.6
// "github.com/decred/dcrd/chaincfg/chainhash"
"bytes" // dcrd > 0.6+ "bytes" // dcrd > 0.6+
"github.com/decred/dcrd/wire" "github.com/decred/dcrd/wire"
@ -26,7 +22,7 @@ import (
const ( const (
processName = "blocknotify" // set the full path if required processName = "blocknotify" // set the full path if required
stratumDest = "yaamp.com:5744" // stratum host:port stratumDest = "yaamp.com:3252" // stratum host:port
coinId = "1574" // decred database coin id coinId = "1574" // decred database coin id
dcrdUser = "yiimprpc" dcrdUser = "yiimprpc"
@ -61,23 +57,6 @@ func main() {
} }
}, },
// broken since 0.6.1 (Nov 2016):
// OnBlockConnected: func(hash *chainhash.Hash, height int32, time time.Time, vb uint16) {
//
// Find the process path.
// str := hash.String()
// args := []string{ stratumDest, coinId, str }
// out, err := exec.Command(processName, args...).Output()
// if err != nil {
// log.Printf("err %s", err)
// } else if debug {
// log.Printf("out %s", out)
// }
// if (debug) {
// log.Printf("Block connected: %s %d", hash, height)
// }
//},
} }
// Connect to local dcrd RPC server using websockets. // Connect to local dcrd RPC server using websockets.

48
blocknotify-dcr/glide.lock generated Normal file
View file

@ -0,0 +1,48 @@
hash: 4e74a8534cece2f2c1de27bcab0da6efba0e47d533cf8475f588e87851473e81
updated: 2017-04-28T23:45:31.334486056+02:00
imports:
- name: github.com/btcsuite/btclog
version: 73889fb79bd687870312b6e40effcecffbd57d30
- name: github.com/btcsuite/go-socks
version: 4720035b7bfd2a9bb130b1c184f8bbe41b6f0d0f
subpackages:
- socks
- name: github.com/btcsuite/seelog
version: 313961b101eb55f65ae0f03ddd4e322731763b6c
- name: github.com/btcsuite/websocket
version: 31079b6807923eb23992c421b114992b95131b55
- name: github.com/decred/blake256
version: a840e32d7c31fe2e0218607334cb120a683951a4
- name: github.com/decred/dcrd
version: 5bed758f85159b2ee76240207ba775c40000a4c1
subpackages:
- wire
- chaincfg/chainhash
- dcrjson
- blockchain/stake
- chaincfg
- chaincfg/chainec
- blockchain/stake/internal/dbnamespace
- blockchain/stake/internal/ticketdb
- blockchain/stake/internal/tickettreap
- database
- txscript
- dcrec/edwards
- dcrec/secp256k1
- dcrec/secp256k1/schnorr
- name: github.com/decred/dcrrpcclient
version: d6edcb0f8f2d01fbf9169f240f73756b41423189
- name: github.com/decred/dcrutil
version: ebd2e98736e819ac043d54439969b30144b92ced
subpackages:
- base58
- name: github.com/decred/ed25519
version: b0909d3f798b97a03c9e77023f97a5301a2a7900
subpackages:
- edwards25519
- name: golang.org/x/crypto
version: c7af5bf2638a1164f2eb5467c39c6cffbd13a02e
subpackages:
- ripemd160
devImports: []

View file

@ -0,0 +1,8 @@
package: github.com/tpruvot/yiimp/blocknotify-dcr
import:
- package: github.com/decred/dcrd
subpackages:
- wire
- package: github.com/decred/dcrrpcclient
- package: github.com/decred/dcrutil