-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- update readme so that it's up to date when it comes to package structure - add a badge that points at godoc so that one can quickly recognize where docs can be found - add an example that can be referenced via godoc (using `_test.go` example) - update sync-info to include a little description Signed-off-by: Ciro S. Costa <[email protected]>
- Loading branch information
Showing
4 changed files
with
130 additions
and
70 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package daemon_test | ||
|
||
import ( | ||
"context" | ||
"fmt" | ||
|
||
"github.com/cirocosta/go-monero/pkg/rpc" | ||
"github.com/cirocosta/go-monero/pkg/rpc/daemon" | ||
) | ||
|
||
func ExampleGetHeight() { | ||
ctx := context.Background() | ||
addr := "http://localhost:18081" | ||
|
||
// instantiate a generic RPC client | ||
// | ||
client, err := rpc.NewClient(addr) | ||
if err != nil { | ||
panic(fmt.Errorf("new client for '%s': %w", addr, err)) | ||
} | ||
|
||
// instantiate a daemon-specific client and call the `get_height` | ||
// remote procedure. | ||
// | ||
height, err := daemon.NewClient(client).GetHeight(ctx) | ||
if err != nil { | ||
panic(fmt.Errorf("get height: %w", err)) | ||
} | ||
|
||
fmt.Printf("height=%d hash=%s\n", height.Height, height.Hash) | ||
} |
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 @@ | ||
package wallet_test |