Commit graph

190 commits

Author SHA1 Message Date
Ciro S. Costa dd302892fd add dependabot
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-20 08:12:09 -04:00
Ciro S. Costa 02dd7d551f cmd: get-blk-headers-range and mining-status
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-20 07:54:43 -04:00
Ciro S. Costa 4539099b20 add install guide
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-19 19:48:06 -04:00
Ciro S. Costa 06e6d6d6ec remove unused asset
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-19 19:44:03 -04:00
Ciro S. Costa 45b42a1fae source formatting
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 17:22:57 -04:00
Ciro S. Costa 87083cf533 remove unecessary status code println
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 17:15:29 -04:00
Ciro S. Costa ec284c589c readme: rephrase tor support
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 17:15:08 -04:00
Ciro S. Costa 75198b6d18 readme: shorten outputs; add tor instructions
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 17:12:24 -04:00
Ciro S. Costa 564d426f3a source formatting
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 16:48:09 -04:00
Ciro S. Costa 2136abc313 fix non-verbose auth-based requests
it turns out that the server implementation relies on the clients doing
the whole auth flow over the same connection, but `go` will only let you
reuse a given tcp connection if you've completely drained the response's
body (which `--verbose` ends up doing, despite copying everythign back
to a new reader).

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 16:46:40 -04:00
Ciro S. Costa 7012486a16 source formatting
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 15:56:51 -04:00
Ciro S. Costa 9536d945b0 pkg/http: remove non-monero auth details
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 08:38:58 -04:00
Ciro S. Costa e78b200d02 add support for rpc auth
example:

	monerod --rpc-login foo:foo  (...)
	monero daemon -u foo -p foo get-version

new flags
	  -p, --password string    password to supply for rpc auth
	  -u, --username string    name of the user to use during rpc auth

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 08:27:44 -04:00
Ciro S. Costa 096ad758c2 source formatting
no behavior changes

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-18 06:51:24 -04:00
Ciro S. Costa e94f6ae0dd address lint cases
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 20:54:50 -04:00
Ciro S. Costa dc4973801c source formatting
- restrict width to 80

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 20:18:59 -04:00
Ciro S. Costa 2f4faf8d0e cmd: add support for tls
well, `pkg/rpc` in theory already supported tls given that it relies on
an `http.Client` which could already be making use of such proxy, but at
least now we make it configurable to the CLI in a nice way

very command under `monero daemon|wallet` now takes:

	Flags:
	  -a, --address string             full address of the monero node to reach out to (default "http://localhost:18081")
	  -h, --help                       help for daemon
	      --request-timeout duration   how long to wait until considering the request a failure (default 1m0s)
	      --tls-ca-cert string         certificate authority to load
	      --tls-client-cert string     tls client certificate to use when connecting
	      --tls-client-key string      tls client key to use when connecting
	  -k, --tls-skip-verify            skip verification of certificate chain and host name
	  -v, --verbose                    dump http requests and responses to stderr

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 19:59:47 -04:00
Ciro S. Costa bebe21973c cmd: remove debug address
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 12:38:45 -04:00
Ciro S. Costa c7f82fb5db remove viper
well, it doesn't really work with `p` flags, so, get rid of it

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 12:14:54 -04:00
Ciro S. Costa 099386b765 fix small lint issues
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 12:04:11 -04:00
Ciro S. Costa 28184b21bd readme: add example
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 09:23:37 -04:00
Ciro S. Costa 249ec31a71 pretty print + readme update
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 09:21:40 -04:00
Ciro S. Costa 58a7fd031d cmd: add set-bans
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 08:48:58 -04:00
Ciro S. Costa 3df38e8a0c cmd: sort get-bans
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 08:35:54 -04:00
Ciro S. Costa 18b935e63a cmd: extra whitespace for outputs section
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 08:32:54 -04:00
Ciro S. Costa e05d673547 cmd: fix ring members retrieval; fill age column
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 08:24:03 -04:00
Ciro S. Costa 2bb2257534 cmd: retrieve block header by height
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 07:41:50 -04:00
Ciro S. Costa 4a56e5e00a cmd: display ring members in get-transaction
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 07:01:41 -04:00
Ciro S. Costa 964cca2eeb cmd: add get-outs
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-16 18:56:10 -04:00
Ciro S. Costa 85a7aaaa0a cmd/get-txn: rename fee per-kb field
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-16 08:26:44 -04:00
Ciro S. Costa bcdb8fb372 cmd: standardize use of fee/per_kb
some of the commands included fee/per-kb, others didn't - here we
standardize on always including that

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-16 08:25:00 -04:00
Ciro S. Costa 9cf4665b88 cmd: improve pretty-printing, add get-version
- update get-height's description
- update some fields to prefer uint64 rather than `int`

	all those fields would never take negative values and should be
	able to grow quite a lot

- switch commands from display to humanize

	`humanize` gives us some pretty handy human readable
	conversions, so let's just go with it rather than rolling our
	own

- add get-version command

- prettify get-transaction pool

	example out (hash reduced in size):

	AGE             HASH                FEE (µɱ)        FEE (µɱ per-kB) SIZE    in/out
	1 minute ago    1a053e4058839b21c4  9                6.4            1.5 kB  1/2
	1 minute ago    fb61680a1584ca1ec3  9                6.4            1.5 kB  1/2
	1 minute ago    a58de0d2747cdd6a5d  12               6.4            2.0 kB  2/2
	1 minute ago    c54f4b33ed81335f78  308             160.6           2.0 kB  2/2
	57 seconds ago  ab210c55bd9c3efe09  12               6.4            2.0 kB  2/2
	55 seconds ago  88df3311e19b1280b5  9                6.4            1.5 kB  1/2
	51 seconds ago  a3aa674ed3d4eb56c6  127             32.5            4.0 kB  6/2
	51 seconds ago  e896abe686d2f816fc  9                6.4            1.5 kB  1/2
	31 seconds ago  eb6ea6662ce754d025  9                6.4            1.5 kB  1/2
	31 seconds ago  592204223e607cc5d9  9                6.4            1.5 kB  1/2
	24 seconds ago  ba8d52f90fd45dd32d  12               6.4            2.0 kB  2/2
	24 seconds ago  792e68ded7805037c9  12               6.4            2.0 kB  2/2

- move response types to a single file
- rework pretty-printing of txn-based cmds

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-16 07:48:30 -04:00
Ciro S. Costa 425893dd54 pkg/rpc: use uint64 for height
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-11 07:25:05 -04:00
Ciro S. Costa 27d22281e1 readme: re-order, mention releases page
moving on, we'll have tagged commits that represent a point-in-time
release for the `cli` and the library, so, it's good to mention that one
can just fetch the binary for their dist if they'd like to consume the
cli (which, at least for me, has proven to be quite handy).

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-10 22:52:20 -04:00
Ciro S. Costa 2688c54929 prepare for release
- making use of `goreleaser`, we can make building for all platforms
easy peasy, leveraging go's ability to create reproducible builds given
a set of flags that we can have under in a declarative fashion under
`goreleaser.yaml`

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-10 22:34:32 -04:00
Ciro S. Costa edb7e1b79f improve documentation
- 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 <utxobr@protonmail.com>
2021-07-10 21:32:09 -04:00
Ciro S. Costa c61587aba0 cmd/p2p: mark node-address required
otherwise, there's no way one could connect to a daemon as we don't
provide any defaults here.

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-10 21:13:55 -04:00
Ciro S. Costa e6bc54f872 use cobra for cmds; refactor rpc to support wallet
- using `cobra` for sake of better organization when it comes to command
hierarchy

- splitting `rpc` into `daemon` and `wallet` so we can start thinking of
monero-wallet-rpc support

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-10 20:29:16 -04:00
Ciro S. Costa a67bbd5e11 readme: fix quotation
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-03 15:49:51 -04:00
Ciro S. Costa 56dcb6b176 pkg/rpc: docs
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-03 15:46:37 -04:00
Ciro S. Costa e3856606c0 make: add lint target
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-03 08:39:52 -04:00
Ciro S. Costa 6ce3a68307 add linting, update github actions
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-03 08:38:54 -04:00
Ciro S. Costa 207bd1f632 readme: update command help
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-13 18:04:51 -04:00
Ciro S. Costa eb365cb4f5 cmd: get-public-nodes
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-13 18:04:10 -04:00
Ciro S. Costa f3e71d5e6e cmd: get-block-header-by-hash
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-13 07:50:06 -04:00
Ciro S. Costa 1d4fff5e03 cmd: allow passing hash to get-block
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 16:13:58 -04:00
Ciro S. Costa 56034d55bd add pkg/pointer package
some of the methods will now start taking pointer-based values, so lets
bring a utility to help passing those.

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 16:13:23 -04:00
Ciro S. Costa 412e77f10a cmd: present get-bans time left as duration
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 15:34:35 -04:00
Ciro S. Costa d846d5c597 cmd: prettify get-bans
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 12:39:52 -04:00
Ciro S. Costa fa4589c4d2 cmd: pretty get-alternate-chains
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 12:33:09 -04:00