Commit graph

26 commits

Author SHA1 Message Date
DataHoarder 910450c4a5
Added binary request for GetOIndexes 2023-04-10 03:12:08 +02:00
DataHoarder 11a2e1bccc
Update dependencies 2023-03-03 10:53:33 +01:00
DataHoarder 0c66c0fe65
Light project renovation 2022-10-05 09:37:13 +02: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 0d94df56f6 bump deps
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-09-18 11:30:07 +00: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 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
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 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 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 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 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 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 fa4589c4d2 cmd: pretty get-alternate-chains
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 12:33:09 -04:00
Ciro S. Costa 42d84b912b pkg: unexport methods; cmd: common factory
- there's no reason why we should be exporting those method names, so
  let's unexport them

- with a common factory for creating a deadlined context and client, we
  have to care less about those details inside the commands themselves

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 10:04:11 -04:00
Ciro S. Costa abdd05f886 remove crawler; add donate
well, that's not really what the library should be about, so, no reason
to have it here.

see https://github.com/cirocosta/monero-p2p-crawler

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-12 09:07:14 -04:00
Ciro S. Costa df554449ea remove unrelated utilities
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-06-10 18:33:23 -04:00
Ciro S. Costa 321f0e0383 cmd: add geoip
e.g.:

	go run ./cmd/geoip/main.go --file=db.mmdb --addr=1.1.1.1
	Continent:      Oceania
	Country:        Australia
	City:
	Coordinates:    (143.210400,-33.494000)

Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-04-25 18:09:25 -04:00
Ciro S. Costa 0ffd1c5a04 add socks5 support to levin client
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-04-24 16:33:35 -04:00
Ciro S. Costa 4ba933615e crawl: implement first pass
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-04-23 16:05:18 -04:00
Ciro S. Costa ee0f9901b8 portable_storage: fix misconstructed test
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-04-19 10:06:25 -04:00
Ciro S. Costa 2d046f2d90 levin: manually encode
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-04-18 08:04:42 -04:00
Ciro S. Costa 07e9119338 start implementing levin
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-04-17 19:59:36 -04:00
Ciro S. Costa dbd6e16581 bootstrap jsonrpc + get_block_count
Signed-off-by: Ciro S. Costa <utxobr@protonmail.com>
2021-04-16 14:54:56 -04:00