diff --git a/cmd/debug/btc.go b/cmd/debug/btc.go new file mode 100644 index 0000000000..9100cc7435 --- /dev/null +++ b/cmd/debug/btc.go @@ -0,0 +1,42 @@ +package main + +import ( + "fmt" + "github.com/btcsuite/btcd/chaincfg/chainhash" + "github.com/paxosglobal/btcd/rpcclient" +) + +func main() { + fmt.Println("vim-go") + connCfg := &rpcclient.ConnConfig{ + Host: "bitcoin.qa.itbitnonprod.com:19348", + User: "itbit", + Pass: "dNcmjINarwQU75gwdrPj", + HTTPPostMode: true, // Bitcoin core only supports HTTP POST mode + DisableTLS: true, // Bitcoin core does not provide TLS by default + } + // Notice the notification parameter is nil since notifications are + // not supported in HTTP POST mode. + fmt.Println("connecting to node") + + btcClient, err := rpcclient.New(connCfg, nil) + if err != nil { + panic(err) + } + fmt.Println("connected") + + h, err := chainhash.NewHashFromStr("0000000000000f46179b523cf5ed1f0e96206592493dc455c0eba2d82b55d2c2") + if err != nil { + panic(err) + } + fmt.Println("getting block") + + block, err := btcClient.GetBlockVerboseTx(h) + if err != nil { + panic(err) + } + for _, tx := range block.Tx { + fmt.Println(tx) + } + fmt.Println(block) +} diff --git a/rpcclient/chain.go b/rpcclient/chain.go index f7fe310e27..7619e6651a 100644 --- a/rpcclient/chain.go +++ b/rpcclient/chain.go @@ -10,9 +10,9 @@ import ( "encoding/hex" "encoding/json" - "github.com/btcsuite/btcd/btcjson" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" + "github.com/paxosglobal/btcd/btcjson" ) // FutureGetBestBlockHashResult is a future promise to deliver the result of a diff --git a/rpcclient/infrastructure.go b/rpcclient/infrastructure.go index 7a8f1885d1..ed2fb8b649 100644 --- a/rpcclient/infrastructure.go +++ b/rpcclient/infrastructure.go @@ -24,9 +24,9 @@ import ( "sync/atomic" "time" - "github.com/btcsuite/btcd/btcjson" "github.com/btcsuite/go-socks/socks" "github.com/btcsuite/websocket" + "github.com/paxosglobal/btcd/btcjson" ) var ( diff --git a/rpcclient/notify.go b/rpcclient/notify.go index 2454a94696..00abf2a6c2 100644 --- a/rpcclient/notify.go +++ b/rpcclient/notify.go @@ -13,10 +13,10 @@ import ( "fmt" "time" - "github.com/btcsuite/btcd/btcjson" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" + "github.com/paxosglobal/btcd/btcjson" ) var ( diff --git a/rpcserver.go b/rpcserver.go index d6265ba8a0..463f0ef977 100644 --- a/rpcserver.go +++ b/rpcserver.go @@ -30,7 +30,6 @@ import ( "github.com/btcsuite/btcd/blockchain" "github.com/btcsuite/btcd/blockchain/indexers" "github.com/btcsuite/btcd/btcec" - "github.com/btcsuite/btcd/btcjson" "github.com/btcsuite/btcd/chaincfg" "github.com/btcsuite/btcd/chaincfg/chainhash" "github.com/btcsuite/btcd/database" @@ -42,6 +41,7 @@ import ( "github.com/btcsuite/btcd/wire" "github.com/btcsuite/btcutil" "github.com/btcsuite/websocket" + "github.com/paxosglobal/btcd/btcjson" ) // API version constants