2021-09-02 08:39:55 +02:00
|
|
|
Custom Command Example
|
|
|
|
======================
|
|
|
|
|
|
|
|
This example shows how to use custom commands with the rpcclient package, by
|
|
|
|
implementing the `name_show` command from Namecoin Core.
|
|
|
|
|
|
|
|
## Running the Example
|
|
|
|
|
|
|
|
The first step is to use `go get` to download and install the rpcclient package:
|
|
|
|
|
|
|
|
```bash
|
2021-08-19 20:41:48 +02:00
|
|
|
$ go get github.com/lbryio/lbcd/rpcclient
|
2021-09-02 08:39:55 +02:00
|
|
|
```
|
|
|
|
|
|
|
|
Next, modify the `main.go` source to specify the correct RPC username and
|
|
|
|
password for the RPC server of your Namecoin Core node:
|
|
|
|
|
|
|
|
```Go
|
|
|
|
User: "yourrpcuser",
|
|
|
|
Pass: "yourrpcpass",
|
|
|
|
```
|
|
|
|
|
|
|
|
Finally, navigate to the example's directory and run it with:
|
|
|
|
|
|
|
|
```bash
|
2021-08-19 20:41:48 +02:00
|
|
|
$ cd $GOPATH/src/github.com/lbryio/lbcd/rpcclient/examples/customcommand
|
2021-09-02 08:39:55 +02:00
|
|
|
$ go run *.go
|
|
|
|
```
|
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This example is licensed under the [copyfree](http://copyfree.org) ISC License.
|