Commit graph

35 commits

Author SHA1 Message Date
DataHoarder b6ca970f30
Change project name 2022-10-05 09:40:23 +02:00
Ciro S. Costa 48852069f5 cmd: add set-log-categories
example:

	$ monero daemon set-log-categories \
		--categories=net.http:4,net.dns:2

	Status: OK

	CATEGORY        LEVEL
	net.http        4
	net.dns         2

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-09-19 14:11:16 +00:00
Ciro S. Costa 96063a2959 cmd: json behavior for get-block-headers*
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-09-18 20:16:55 +00:00
Ciro S. Costa 17445423a6 cmd: add set/get limit (net throttling)
example:

	monero daemon set-limit --up 10
	Status:         OK
	Limit Up:       10 kB/s
	Limit Down:     1.0 GB/s

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-09-18 11:53:02 +00:00
Ciro S. Costa c0cee1b176 cmd/get-info: add missing fields
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-03 17:44:33 -04:00
Ciro S. Costa 42f30dc537 cmd/get-peer-list: allow filtering out lists
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-02 09:22:07 -04:00
Ciro S. Costa c23662a28c cmd/sync-info: sort and humanize
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-02 09:16:24 -04:00
Ciro S. Costa e926c48784 cmd: pretty printing
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-31 22:07:52 -04:00
Ciro S. Costa e84b32b615 cmd/get-block: display subsidy
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-31 10:06:04 -04:00
Ciro S. Costa 4ee9f9defa get-transaction: -t, --transaction flags
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-31 07:02:23 -04:00
Ciro S. Costa 07bb1726bd get-block: total fees; reuse blockheader printer
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-31 07:00:29 -04:00
Ciro S. Costa ad498be8f1 cmd: minor unit and flag improvements
- `get-transaction` on miner tx's now reveal the outputs in `m`
- `get-block` now includes a `--last` to allow one to easily say "get me
the last block", or "get me the last-1 block" ...
- `get-last-block-header` now shows rewards in precise `m`

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-31 06:42:08 -04:00
Ciro S. Costa ac58bd1fd1 add zmq support
here i add `pkg/zmq`, a package aimed at providing one with the ability
of subscribing to zmq topics that the monero daemon published messages
to.

as exaplined under [1], there are four topics that one can subscribe to:

	-  json-minimal-txpool_add
	-  json-full-txpool_add
	-  json-minimal-chain_main
	-  json-full-chain_main

in the implementation provided here, one goes about listening to these
by:

	1. creating a client aiming at a topic
	2. telling the client to listen
	3. consuming typed objects from a "stream" object

e.g.:

	client := zmq.NewClient(endpoint, zmq.TopicMinimalTxPoolAdd)
	defer client.Close()

	stream, _ := client.Listen(ctx)
	for {
		select {
		case err := <-stream.ErrC:
			panic(err)
		case tx := <-stream.MinimalTxPoolAddC:
			fmt.Println(tx)
		}
	}

CLI users can also make use of it via `monero daemon zmq`:

	$ monero daemon zmq \
		--topic json-minimal-chain_main  \
		--endpoint tcp://127.0.0.1:18085

[1]: https://github.com/monero-project/monero/blob/master/docs/ZMQ.md

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-28 07:37:23 -04:00
Ciro S. Costa 2eb47cf90f cmd: add --last to block-headers-range
example:

	$ monero daemon get-block-headers-range --last=10 | grep Transactions
	Number of Transactions:         6
	Number of Transactions:         79
	Number of Transactions:         93
	Number of Transactions:         15
	Number of Transactions:         74
	Number of Transactions:         73
	Number of Transactions:         11
	Number of Transactions:         2
	Number of Transactions:         20
	Number of Transactions:         124
	Number of Transactions:         158

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-23 12:44:42 -04:00
Ciro S. Costa 17ffb4aea4 cmd: remove unwanted println
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-22 20:06:41 -04:00
Ciro S. Costa 680c4ce417 add get-accounts; add addr shortener
$ monero wallet get-accounts
Total Balance:          390.31 ɱ
Total Unlocked Balance: 390.31 ɱ

        LABEL           TAG     ADDR            BALANCE         UNLOCKED BALANCE
0       Primary account         53G25..A91AX    389.31 ɱ        389.31 ɱ
1       test                    72vD5..43SXV    1.00 ɱ          1.00 ɱ

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-22 07:49:15 -04:00
Ciro S. Costa 44b1bdf069 cmd: set-bans: allow banning from fpath
e.g., given a `bans.csv`

	104.248.45.80,2400h
	104.248.45.81,2400h
	104.248.45.83,2400h
	104.248.45.84,2400h

one can ban all those 4 hosts via

	$ monero daemon set-bans -f ./bans.csv

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-21 18:57:45 -04:00
Ciro S. Costa 78745598d8 wallet: refresh,auto-refresh,get-height
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-21 07:27:10 -04:00
Ciro S. Costa 2b2bf3eba6 cmd: fix get-txn when fetching from txn pool
when looking at a transaction that's still in the pool, outputindices[@]
is empty

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-20 18:50:45 -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 e94f6ae0dd address lint cases
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-17 20:54:50 -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 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 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 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