Skip to content

Commit

Permalink
more mod fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
connorwstein committed Dec 23, 2019
1 parent 0caea1e commit 1f3ee44
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 4 deletions.
42 changes: 42 additions & 0 deletions cmd/debug/btc.go
Original file line number Diff line number Diff line change
@@ -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)
}
2 changes: 1 addition & 1 deletion rpcclient/chain.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion rpcclient/infrastructure.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion rpcclient/notify.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion rpcserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
Expand Down

0 comments on commit 1f3ee44

Please sign in to comment.