here a new subcommand is added: `address`.
the idea here is to provide an example of how address-related
funcionality from `pkg/monero` can be used.
at the moment, the only available action is "generate", which
instantiates a new seed based on `crypto/rand` and then displaying on
stdout the result
WARNING: DO NOT USE THIS FOR ANYTHING MEANINGFUL.
you've been advised.
example:
$ monero address generate
Mnemonic: dawn repent towel taxi
cucumber muzzle romance awesome
losing yeti dogs biplane
foyer hotel tattoo dilute
gearbox later afloat purged
software ashtray cell dangerous
biplane
Primary Address: 49MYaXwy8K177bw9i1bBDvPuM...
Private Spend Key: 455f1c286ff8db620e61ca6c6...
Private View Key: b5d26a403c6cec29c3ecc8d2f...
Public Spend Key: cc06a0f6e6c6b0248d5e2c3fd...
Public View Key: bcb8d3dc372efb9071c120b72...
(output truncated to fit the commit message).
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
- `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>
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>
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>
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>
it _might_ feels a little strange that env vars would be taking
precedence over flags, but I think it's an ok tradeoff that we're making
here.
unfortunatelly, cobra & viper integration is not as great as it could be
- it doesn't natively handle this for us .. but it's alright :)
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
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>
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>
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>
- 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>
- 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>
- 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>
- 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>