-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add rpclient implementation of getdescriptorinfo RPC
- Loading branch information
1 parent
70a0132
commit efae8e9
Showing
5 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package rpcclient | ||
|
||
import ( | ||
"fmt" | ||
) | ||
|
||
func ExampleClient_GetDescriptorInfo() { | ||
connCfg := &ConnConfig{ | ||
Host: "localhost:8332", | ||
User: "yourrpcuser", | ||
Pass: "yourrpcpass", | ||
HTTPPostMode: true, | ||
DisableTLS: true, | ||
} | ||
client, err := New(connCfg, nil) | ||
if err != nil { | ||
log.Error(err) | ||
return | ||
} | ||
defer client.Shutdown() | ||
|
||
descriptorInfo, err := client.GetDescriptorInfo( | ||
"wpkh([d34db33f/84h/0h/0h]0279be667ef9dcbbac55a06295Ce870b07029Bfcdb2dce28d959f2815b16f81798)") | ||
if err != nil { | ||
log.Error(err) | ||
return | ||
} | ||
|
||
fmt.Printf("%+v\n", descriptorInfo) | ||
// &{Descriptor:wpkh([d34db33f/84'/0'/0']0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798)#n9g43y4k Checksum:qwlqgth7 IsRange:false IsSolvable:true HasPrivateKeys:false} | ||
} |