Commit graph

190 commits

Author SHA1 Message Date
DataHoarder 910450c4a5
Added binary request for GetOIndexes 2023-04-10 03:12:08 +02:00
DataHoarder 031b77423d
Added BulletproofPlus to transaction JSON response 2023-04-08 20:51:55 +02:00
DataHoarder f9cc428f9e
Added BoostSerializeTypeBool to levin portable storage 2023-03-20 21:26:21 +01:00
DataHoarder d8d87587c8
Added error to submit_block call 2023-03-05 01:40:01 +01:00
DataHoarder f6a7735b8c
Added SubmitBlock RPC method 2023-03-05 01:35:45 +01:00
DataHoarder 16f8644e01
Fix GetMinerDataResult difficulty type 2023-03-04 08:32:40 +01:00
DataHoarder 11a2e1bccc
Update dependencies 2023-03-03 10:53:33 +01:00
DataHoarder 0adf4de11a
Added GetMinerData rpc call 2023-03-03 10:53:08 +01:00
DataHoarder b6ca970f30
Change project name 2022-10-05 09:40:23 +02:00
DataHoarder 0c66c0fe65
Light project renovation 2022-10-05 09:37:13 +02:00
Ciro S. Costa 7ce06c6b02
Merge pull request #42 from cirocosta/dependabot/go_modules/github.com/golangci/golangci-lint-1.45.0
build(deps): bump github.com/golangci/golangci-lint from 1.42.1 to 1.45.0
2022-03-21 09:45:37 -04:00
dependabot[bot] 90d49d465d
build(deps): bump github.com/golangci/golangci-lint
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.42.1 to 1.45.0.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.42.1...v1.45.0)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-21 00:57:49 +00:00
Ciro S. Costa d5bf34f627 bump deps
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-10-03 09:25:01 +00: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 0d94df56f6 bump deps
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-09-18 11:30:07 +00:00
Ciro S. Costa 55438d8e90
Merge pull request #27 from cirocosta/dependabot/go_modules/github.com/golangci/golangci-lint-1.42.1
build(deps): bump github.com/golangci/golangci-lint from 1.42.0 to 1.42.1
2021-09-09 06:33:24 -04:00
dependabot[bot] 82c9624b0d
build(deps): bump github.com/golangci/golangci-lint
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.42.0 to 1.42.1.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.42.0...v1.42.1)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-07 00:33:29 +00:00
Ciro S. Costa 911ec0b7eb .github: bump go
Signed-off-by: Ciro S. Costa <ciroscosta@vmware.com>
2021-08-26 09:33:42 -04:00
Ciro S. Costa 74a9dfbdca cmd: add address generation
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>
2021-08-26 07:46:52 -04:00
Ciro S. Costa ae4d6f3a92 bump dependencies
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-20 15:58:03 -04:00
Ciro S. Costa 8d67d37218 dockerfile: bump go (1.16 -> 1.17)
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-20 15:56:03 -04:00
Ciro S. Costa f6c89fe994 bump go to 1.17
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-20 15:53:40 -04:00
Ciro S. Costa 11c3536538
Merge pull request #23 from cirocosta/dependabot/go_modules/github.com/golangci/golangci-lint-1.42.0
build(deps): bump github.com/golangci/golangci-lint from 1.41.1 to 1.42.0
2021-08-18 08:48:08 -04:00
dependabot[bot] 8a59ee374f
build(deps): bump github.com/golangci/golangci-lint
Bumps [github.com/golangci/golangci-lint](https://github.com/golangci/golangci-lint) from 1.41.1 to 1.42.0.
- [Release notes](https://github.com/golangci/golangci-lint/releases)
- [Changelog](https://github.com/golangci/golangci-lint/blob/master/CHANGELOG.md)
- [Commits](https://github.com/golangci/golangci-lint/compare/v1.41.1...v1.42.0)

---
updated-dependencies:
- dependency-name: github.com/golangci/golangci-lint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-18 00:46:52 +00:00
Ciro S. Costa 88e6ce099f readme: add docker instructions
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-03 18:23:13 -04:00
Ciro S. Costa 364caf9114 images: tag v/ current version
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-08-03 18:09:13 -04:00
Ciro S. Costa aefba5ec1e add container image
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>
2021-08-03 17:50:12 -04: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 0094b0481e pmg/rpc: make freespace and height u64
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>
2021-08-03 17:12:08 -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 dcbefcada8 readme: wording
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-28 07:54:14 -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 bc7c6484cd wallet: get-address
~ $ monero wallet get-address
        ADDRESS                                                                                         LABEL           USED
0       53G25UfvJkvKZpJk3LgKTebdLwcxVQxSrWcwLHJUtWYHPZX6PrwggUN1PisbZG81YkJNVEgpCUMBKE8Dkaqn4CpsPUA91AX Primary account true
1       75M29Zm9i3HPxTTgp3iHY2LS93eAWWBuoKDjd1L6kMmL2JYcdWoxfSnhf717WdNEZtMKGZaGEsoVnaCWVVp1PbqaBhXSKHx                 false
2       72nBssuF3a7ZVdiRuDHJZncDDf7y9WF9FTgBcixxymqVM1BAcr2q93de6nBcNAuqK21rUqB6amxSo8QWWKA7Apt7T7svKyE                 false
3       72ae7h9jYLxSmW3KHjPGPXUdg5VfM1ncscy6mDJc6ANx8xX9Usq9vGWMJoydAeqUiJ3ibpGkdtd67a6nuEtu1zWdHVU5p6r                 false
4       7A4nDhtPYTgQVGQ1tYtgzCBYw35E75ajAV6T56Px5cn6dokG53xETFHfHoL2QYeL417P1w8VAdKLoGdWvjnDpfi9LPApooa                 false
5       7BmLuTWBhzCYJbespeFTWFKRyDr66ng4TBnmUVuWYa2b6CEp8MujC5D9Gct2YAn9AK6HhhnVCBFM63Qe1Hj9qxWd5GW7EVN                 false
6       7BvGs82sgpLUSbsXPm3KgeZq4hnZJxHwgLQ3davwgPbEUkir91pLPrCcSXfGQWtuGb4N55eNCXe4BYi7L7yYdcPo548z5NF                 false
7       7AFNdb1sG6c1Mro27774PEegFbWr5bF1125SB8kHwSXe8WCokX1yTE46EqMtPviyZfSHyoPYCYB2yK6R755usqFo5ph8KWJ                 false
8       77DaGHUchBfR6hG2MokYgY4xv23iCRJxfUPZ1ZttFWz71JnLK7MtHtyYQJ2S9MYkb2QjYshcbxki34vYuQj8ioEyHErnKJw                 false
9       76dmK6eqNPagoLB5xQLyJk3cFeKWnCpRyRkC95ncRBGhKhcTiciDLzgaEqVRDd7ABe3azB1T1i5r2cftnLwngCDu7cKWAUy                 false

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-21 18:30:55 -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 8058e3dfe0 cmd: make monero addr configurable via env var
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>
2021-07-21 06:46:24 -04:00
Ciro S. Costa 26588fa4f0 wallet: add create-add
monero wallet -a http://localhost:18082 create-address --count 2
0       Address:        77GBiFupp2mbqik7wyMrz39yQZ5giJJewjbNCZE1hmkDbANhC1v2paG8R6P51rge1qaqWcVoYmDTG292D4Ri6onGNAyvhe7
~       Address Index:  12

1       Address:        72z24bJDeuyEZPQSBDezQEGzuaEuVPthZfnPWHAj1gakje2VyNECQvG1b4wa4g2eF9Z2BFeR4XHxh8vypemhQfZFVrfwmTE
~       Address Index:  13

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-20 19:32:57 -04:00
Ciro S. Costa da578aee01 wallet: improve wallet balance output
eg.

Total Balance:  241.848409 XMR

0       Address 53G25UfvJkvKZpJk3LgKTebdLwcxVQxSrWcwLHJUtWYHPZX6PrwggUN1PisbZG81YkJNVEgpCUMBKE8Dkaqn4CpsPUA91AX
~       Label:          Primary account
~       UTXOs           35
~       Balance:        241.848409 XMR

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-07-20 19:06:15 -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