Commit graph

13389 commits

Author SHA1 Message Date
Jason Rhinelander
db58370e87 Config file migration fixes
The loki.conf -> oxen.conf migration wasn't working right when there is
also a ~/.loki -> ~/.oxen migration happening, so this rewrites it to
work properly:

- Make loki.conf -> oxen.conf migration leave behind a symlink
- Fix config file migration to also look for ~/.loki/loki.conf, and also
  consider ~/.loki/oxen.conf as a valid load source.  (The ~/.loki
  consideration only happens when data-dir is default *and* neither
  oxen.conf nor loki.conf are found in ~/.oxen).
- *Don't* look for ~/.loki/{loki,oxen}.conf if the default data dir
  (~/.oxen) exists.

Other changes:

- remove the default handling for the config file/log file and put it in
  main instead.  This is non-trivial, and the existing default is broken
  in that if you specify `--data-dir=blah` it still tries to load
  `~/.oxen/oxen.conf` rather than `blah/oxen.conf`.  With this commit it
  now does the expected thing when a data-dir is specified.
- Append /regtest to data-dir when running in --regtest mode.  The
  existing behaviour of clobbering the mainnet data dir is nasty.
2021-01-07 18:40:22 -04:00
Jason Rhinelander
1bde385c59 Eliminate tools::create_directories_if_necessary
We shouldn't actually use it in `main.cpp` because it is called before
the log system is initialized, and it is a wrapper that saves basically
nothing, so just replace it everywhere with direct calls to
fs::create_directories and delete it.
2021-01-07 18:40:22 -04:00
Sean Darcy
abc7c5edca oxen name system back to passing tests 2021-01-07 18:40:22 -04:00
Sean Darcy
b08489648f line break 2021-01-07 18:40:22 -04:00
Sean Darcy
e3319dcfda make lokid.sock and move the .oxen folder migration to before logs initialise folder 2021-01-07 18:40:22 -04:00
Sean Darcy
ae80adb5b1 default directory migration, .loki -> .oxen moved to .main 2021-01-07 18:40:22 -04:00
Jason Rhinelander
27e205d590 Rename loki.conf -> oxen.conf when appropriate
Requires:
- config-file argument is not given
- default DATA/oxen.conf does not exist
- old DATA/loki.conf does exist
2021-01-07 18:40:22 -04:00
Jason Rhinelander
e7bbd5e2e7 Add some color in main.cpp before log init 2021-01-07 18:40:22 -04:00
Jason Rhinelander
0d51ca6bba Revert .oxen back to .loki in lns unit tests 2021-01-07 18:40:22 -04:00
Jason Rhinelander
3261f7015b Change Loki startup message from green -> cyan 2021-01-07 18:40:22 -04:00
Jason Rhinelander
d19d8dd0ee Update default ipc socket in lmq-rpc.py 2021-01-07 18:40:22 -04:00
Jason Rhinelander
942bcbef05 Change Jason.oxen -> Blocks.loki in lmq lookup example script 2021-01-07 18:40:22 -04:00
Sean Darcy
fa4e010c3f handle .loki directory, leave .loki namespace 2021-01-07 18:40:22 -04:00
Sean Darcy
e86a039260 poor grammar 2021-01-07 18:40:22 -04:00
Sean Darcy
d0c47ac339 straighten ascii 2021-01-07 18:40:22 -04:00
Sean Darcy
c04276fab4 ascii art 2021-01-07 18:40:22 -04:00
Sean Darcy
b8629f913c tests 2021-01-07 18:40:22 -04:00
Sean Darcy
d37a6e88c9 Drone static upload still looking for loki executables 2021-01-07 18:40:22 -04:00
Sean Darcy
441f412ca0 previously used an old monero log version 2021-01-07 18:40:22 -04:00
Sean Darcy
2822747a62 lokinet revert 2021-01-07 18:40:22 -04:00
Sean Darcy
ccd712542d executable names changed 2021-01-07 18:40:18 -04:00
Sean Darcy
cbc5fa917c compiles 2021-01-07 18:39:01 -04:00
Sean Darcy
0912221329 initial loki -> oxen pass 2021-01-07 18:39:01 -04:00
Jason Rhinelander
c77278173c Update dependencies to latest stable versions
I tried to update protobuf as well, but it doesn't compile on mingw, so
leave it as-is for now.
2021-01-07 18:37:52 -04:00
Jason Rhinelander
5c9ed9b61d Fix android tarfile creation 2021-01-07 18:37:52 -04:00
Jason Rhinelander
d3b08c4a5e builds.lokinet.dev -> oxen.rocks 2021-01-07 18:37:52 -04:00
Jason Rhinelander
2d2e7c53ac Add 'include' & 'lib' dirs into android deps archive
This makes it directly extractable into what the new android wallet
expects (and matches the ios archive, aside from the arch subdirs).
2021-01-07 18:37:52 -04:00
Jason Rhinelander
cdf62b2377 Remove all but the wallet2_api header for ios
The new ios wallet now uses the wallet2_api.h rather than directly
including core loki headers which greatly simplifies what we have to
package.
2021-01-07 18:37:52 -04:00
Jason Rhinelander
da1cb9803c Add optional stake amount calculation to rpc
Currently stake amounts are not exposed via RPC, although they *are*
public knowledge.  This adds an optional "stake_info" request field to
GET_TRANSACTIONS and GET_TRANSACTION_POOL which, if enabled, calculates
the staked amount and sets it in the response.
2021-01-07 18:35:49 -04:00
Jason Rhinelander
9725d8f80e Combine is_synced/is_close_to_synced
Add a `grace_blocks` (defaulting to 0) to `is_synced()`.
2021-01-07 18:35:36 -04:00
Sean Darcy
d2087c7094 Replaces check for in sync with is close to being synced
The wallet can occassionally become "out of sync" when a new block is
added so it becomes one block behind the chain height. This results in
errors in the wallet which are unnecessary because the user immediately
calls the function after it fails and it will succeed.
2021-01-07 18:35:36 -04:00
Jason Rhinelander
c0012cb5fb Fix cli wallet on Windows not saving properly
std::filesystem::rename() on windows appears buggy: it is meant to work
like POSIX rename (which atomically replaces the file if it exists), but
either mingw or Windows itself is buggy and just fails instead.  Delete
manually first, on Windows.
2021-01-07 18:35:28 -04:00
Jason Rhinelander
952543da76 Update electron wallet filename 2021-01-07 18:35:21 -04:00
Jason Rhinelander
bf426b9d00 Fix Monero P2P remote DOS
Monero serialization reserves memory before validating the size of the
incoming data, thus allowing a remote node to send malicious data that
causes the local node to run itself out of memory.

This fixes it by limiting the amount of memory we'll reserve in advance
to a sane amount.
2021-01-07 18:34:56 -04:00
Jason Rhinelander
25589b0e8a Merge dev up to '0dfc63137' into stable
(This is the commit immediately before PR #1377 which we don't want in
stable).
2021-01-07 18:33:58 -04:00
Jason Rhinelander
5cc0bec1b2
Merge pull request #1380 from darcys22/oxen-rebrand
Oxen rebrand
2021-01-07 18:25:01 -04:00
Jason Rhinelander
8c68a20556 Fix android tarfile creation 2021-01-07 17:33:04 -04:00
Jason Rhinelander
8913aecdb1 Config file migration fixes
The loki.conf -> oxen.conf migration wasn't working right when there is
also a ~/.loki -> ~/.oxen migration happening, so this rewrites it to
work properly:

- Make loki.conf -> oxen.conf migration leave behind a symlink
- Fix config file migration to also look for ~/.loki/loki.conf, and also
  consider ~/.loki/oxen.conf as a valid load source.  (The ~/.loki
  consideration only happens when data-dir is default *and* neither
  oxen.conf nor loki.conf are found in ~/.oxen).
- *Don't* look for ~/.loki/{loki,oxen}.conf if the default data dir
  (~/.oxen) exists.

Other changes:

- remove the default handling for the config file/log file and put it in
  main instead.  This is non-trivial, and the existing default is broken
  in that if you specify `--data-dir=blah` it still tries to load
  `~/.oxen/oxen.conf` rather than `blah/oxen.conf`.  With this commit it
  now does the expected thing when a data-dir is specified.
- Append /regtest to data-dir when running in --regtest mode.  The
  existing behaviour of clobbering the mainnet data dir is nasty.
2021-01-07 15:57:36 -04:00
Jason Rhinelander
95537a7e3e Eliminate tools::create_directories_if_necessary
We shouldn't actually use it in `main.cpp` because it is called before
the log system is initialized, and it is a wrapper that saves basically
nothing, so just replace it everywhere with direct calls to
fs::create_directories and delete it.
2021-01-07 15:26:30 -04:00
Jason Rhinelander
f4a0d0a22f
Merge pull request #1383 from jagerman/dep-updates-20210106
Update dependencies to latest stable versions
2021-01-07 11:34:57 -04:00
Jason Rhinelander
a103dafaa2
Merge pull request #1382 from jagerman/remove-ios-full-headers
ios & android package updates
2021-01-07 11:33:57 -04:00
Jason Rhinelander
02eda1d980
Merge pull request #1381 from jagerman/rpc-stake-amount
Add optional stake amount calculation to rpc
2021-01-07 11:32:37 -04:00
Jason Rhinelander
5e714a22d4
Merge pull request #1374 from darcys22/wallet-sync-height
Replaces check for in sync with is close to being synced
2021-01-07 11:32:13 -04:00
Jason Rhinelander
88b401cf88 Combine is_synced/is_close_to_synced
Add a `grace_blocks` (defaulting to 0) to `is_synced()`.
2021-01-07 10:45:54 -04:00
Jason Rhinelander
bf7f4aaba8
Merge pull request #1385 from jagerman/wallet-cli-windows-save-fix
Fix cli wallet on Windows not saving properly
2021-01-07 10:40:44 -04:00
Sean Darcy
eccac532ce oxen name system back to passing tests 2021-01-07 16:22:17 +11:00
Sean Darcy
d198af3de6 line break 2021-01-07 14:41:14 +11:00
Sean Darcy
04114050e3 make lokid.sock and move the .oxen folder migration to before logs initialise folder 2021-01-07 14:39:58 +11:00
Jason Rhinelander
f047c6f6bd
Merge pull request #1384 from jagerman/gui-wallet-build-fixes
Update electron wallet filename
2021-01-06 23:00:41 -04:00
Jason Rhinelander
f200c6719b Fix cli wallet on Windows not saving properly
std::filesystem::rename() on windows appears buggy: it is meant to work
like POSIX rename (which atomically replaces the file if it exists), but
either mingw or Windows itself is buggy and just fails instead.  Delete
manually first, on Windows.
2021-01-06 21:56:27 -04:00