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>
when running monero in a kubernetes cluster, it's quite useful to be
able to quickly bring up via a job or any other runner `monero demon *`
commands.
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
when using a restricted port, freespace gives back u64's max value[1]:
std::numeric_limits<uint64_t>::max()
[1]: ed506006d2/src/rpc/core_rpc_server.cpp (L511)
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>