Commit graph

217 commits

Author SHA1 Message Date
Jason Rhinelander f3325f9ec8 Clean up unused/unmaintained contrib and utils
Everything removed here is unsupported and doesn't work (leftover stuff
from Monero).
2021-03-28 22:08:45 -03:00
Jason Rhinelander 91a4e7f2df Make ios static lib match android static lib name 2021-01-08 18:16:06 -04:00
Jason Rhinelander 37159b2ba0 Export symbols and strip debug symbols from android static lib
This massively reduces the size.
2021-01-08 18:15:25 -04:00
Jason Rhinelander d19d8dd0ee Update default ipc socket in lmq-rpc.py 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 2822747a62 lokinet revert 2021-01-07 18:40:22 -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 952543da76 Update electron wallet filename 2021-01-07 18:35:21 -04:00
Jason Rhinelander 9dd56bdc43 Print to stderr to not break | jq . 2020-11-26 23:55:04 -04:00
Jason Rhinelander 8e049e563a Fix encrypted connections in utils/lmq-rpc.py
- Added client key generation if no curve pubkey is specified
- Fixed missing import causing an error if you tried to specify an
x25519 privkey
2020-11-26 23:52:16 -04:00
Jason Rhinelander 3dd6bbf2ba Add snapshot gui wallet builds + uploads 2020-11-19 22:54:42 -04:00
Jason Rhinelander 8175e5e810 Run lokid test under gdb
Scripts for running under gdb + dumping a stack trace on problems from
lokinet.
2020-11-06 18:04:20 -04:00
Jason Rhinelander 7f83c58c63 Merge arm/sim libs and collect headers in ios deps package 2020-11-06 00:41:28 -04:00
Jason Rhinelander 7d0eeeff06 Also build simulator library 2020-11-06 00:41:28 -04:00
Jason Rhinelander ca1a89ded0 Add ios build & upload
Also renames the android upload script to drone-android-blahblah to be
more consistent.
2020-11-06 00:41:28 -04:00
Jason Rhinelander daaa8dbefd Lots of build hacks for iOS 2020-11-04 15:06:59 -04:00
Jason Rhinelander 0bc97684a2 Package merged wallet_api rather than plain wallet_api 2020-11-04 12:11:20 -04:00
Jason Rhinelander 7a533e19a3 Add android build to drone steps 2020-11-04 12:11:20 -04:00
Jason Rhinelander f6c3adfb8e Small tweaks to build system
- make tagged and stable branch builds not add git tag to the tar.xz
  filename
- copy apt-get tweaks (to make it less noisy) from deb branches
- do a faster shallow submodule clone
- remove exclusion for removed is_hdd test
- remove deb_builder (deb building drone code is in its own branches)
- fix upload dir for a tagged build
2020-10-03 23:24:08 -03:00
Jason Rhinelander 48e28d4c91 Improve wording on deb conversion script 2020-09-18 20:53:04 -03:00
Jason Rhinelander 5ba6197d59 Update zeromq patches for mingw 2020-09-16 13:14:24 -03:00
Jason Rhinelander 68e84c3c63 lmq-rpc.py: fix missing data parts 2020-08-17 02:44:17 -03:00
Jason Rhinelander 0a49ce5a51
Added loki-launcher-to-debs conversion script (#1203) 2020-08-17 13:12:33 +10:00
Jason Rhinelander b7a7dfc080 Add zlib + curl to static deps 2020-08-07 17:14:03 -03:00
Jason Rhinelander 300667e5f2
Add support for N=11 and N=12 quorum comms (#1178)
Previously we supported N=7 through N=10 and N=13 through N=20; with
pulse we need N=11 and N=12, so fill in the gaps so we now have a matrix
for everything from N=7 to N=20.

Connections are generated from utils/generate-quorum-matrix.py using
that same criteria as the existing connection matrices (that is, finding
a set of connections to ensure that every node is connected to every
other node twice with direct or two-hop connections).  The missing added
connection details are as follows:

┌────┬───────────────────────────────┬─────────────┬────────────────────┐
│ i  │ Connections (1 = out, x = in) │ ≤2 paths    │ Connectivity:      │
├────┼───────────────────────────────┼─────────────┼────────────────────┤
│ 0  │ -100xx1x001                   │ -3433343332 │ 6 (= 3 out + 3 in) │
│ 1  │ x-10x0011x0                   │ 3-333344322 │ 6 (= 3 out + 3 in) │
│ 2  │ 0x-11x01000                   │ 43-33232322 │ 5 (= 3 out + 2 in) │
│ 3  │ 00x-110010x                   │ 333-2322223 │ 5 (= 3 out + 2 in) │
│ 4  │ 11xx-010000                   │ 3332-424222 │ 5 (= 3 out + 2 in) │
│ 5  │ 101x0-100xx                   │ 33234-33323 │ 6 (= 3 out + 3 in) │
│ 6  │ x000xx-1010                   │ 443223-2222 │ 5 (= 2 out + 3 in) │
│ 7  │ 1xx000x-100                   │ 3422432-232 │ 5 (= 2 out + 3 in) │
│ 8  │ 0x0x000x-11                   │ 33322322-22 │ 5 (= 2 out + 3 in) │
│ 9  │ 010001x0x-0                   │ 322222232-2 │ 4 (= 2 out + 2 in) │
│ 10 │ x0010100x0-                   │ 2223232222- │ 4 (= 2 out + 2 in) │
└────┴───────────────────────────────┴─────────────┴────────────────────┘

┌────┬───────────────────────────────┬──────────────┬────────────────────┐
│ i  │ Connections (1 = out, x = in) │ ≤2 paths     │ Connectivity:      │
├────┼───────────────────────────────┼──────────────┼────────────────────┤
│ 0  │ -10xx0x00010                  │ -23332332222 │ 5 (= 2 out + 3 in) │
│ 1  │ x-110x001000                  │ 2-3422232222 │ 5 (= 3 out + 2 in) │
│ 2  │ 0x-10100001x                  │ 33-222233222 │ 5 (= 3 out + 2 in) │
│ 3  │ 1xx-1001x000                  │ 342-23323233 │ 6 (= 3 out + 3 in) │
│ 4  │ 100x-010010x                  │ 3222-2323332 │ 5 (= 3 out + 2 in) │
│ 5  │ 01x00-110x00                  │ 22232-323232 │ 5 (= 3 out + 2 in) │
│ 6  │ 1000xx-101x0                  │ 322333-32333 │ 6 (= 3 out + 3 in) │
│ 7  │ 000x0xx-1010                  │ 3332223-2322 │ 5 (= 2 out + 3 in) │
│ 8  │ 0x01000x-101                  │ 22333322-222 │ 5 (= 3 out + 2 in) │
│ 9  │ 0000x1x0x-01                  │ 222232332-23 │ 5 (= 2 out + 3 in) │
│ 10 │ x0x0001x00-1                  │ 2223333222-2 │ 5 (= 2 out + 3 in) │
│ 11 │ 00101000xxx-                  │ 22232232232- │ 5 (= 2 out + 3 in) │
└────┴───────────────────────────────┴──────────────┴────────────────────┘
2020-06-22 11:10:52 +10:00
Jason Rhinelander 5da3d2f7ef Drone: add static builds for mac/linux/windows
Adds static drone builds for linux (built on bionic), mac, and Windows
(built with mingw32).

The builds get uploaded to https://builds.lokinet.dev

The linux and mac builds use LTO (which takes longer, but significantly
reduces binary size).  The mingw32 build can probably also get there,
but currently fails with LTO when unbound tries linking against openssl
(it probably just needs a small patch to add magic -lwsock2 dep in the
right place in unbound).

The Mac binaries are built using a 10.13 deployment target.  (I'm not
100% sure that this is sufficient -- it's possible we might have to also
push the magic mac deployment flag to the built dependencies).
2020-06-15 12:49:34 -03:00
Jason Rhinelander 70b9fed4fd Static builds: make usable binaries from cmake
This adds a static dependency script for libraries like boost, unbound,
etc. to cmake, invokable with:

    cmake .. -DBUILD_STATIC_DEPS=ON

which downloads and builds static versions of all our required
dependencies (boost, unbound, openssl, ncurses, etc.).  It also implies
-DSTATIC=ON to build other vendored deps (like miniupnpc, lokimq) as
static as well.

Unlike the contrib/depends system, this is easier to maintain (one
script using nicer cmake with functions instead of raw Makefile
spaghetti code), and isn't concerned with reproducible builds -- this
doesn't rebuild the compiler, for instance.  It also works with the
existing build system so that it is simply another way to invoke the
cmake build scripts but doesn't require any external tooling.

This works on Linux, Mac, and Windows.

Some random comments on this commit (for preserving history):

- Don't use target_link_libraries on imported targets.  Newer cmake is
fine with it, but Bionic's cmake doesn't like it but seems okay with
setting the properties directly.

- This rebuilds libzmq and libsodium, even though there is some
provision already within loki-core to do so: however, the existing
embedded libzmq fails with the static deps because it uses libzmq's
cmake build script, which relies on pkg-config to find libsodium which
ends up finding the system one (or not finding any), rather than the one
we build with DownloadLibSodium.  Since both libsodium and libzmq are
faily simple builds it seemed easiest to just add them to the cmake
static build rather than trying to shoehorn the current code into the
static build script.

- Half of the protobuf build system ignores CC/CXX just because Google,
and there's no documentation anywhere except for a random closed bug
report about needing to set these other variables (CC_FOR_BUILD,
CXX_FOR_BUILD) instead, but you need to.  Thanks Google.

- The boost build is set to output very little because even the minimum
-d1 output level spams ~15k lines of output just for the headers it
installs.
2020-06-15 12:49:33 -03:00
Doyle 7c07a3e8f3 Merge commit '8136bf37e2c0a76851c0bb6482b6e4c2b653f5d7' into MergeUpstream3 2020-05-27 15:40:27 +10:00
Doyle a6db0e1baf Merge commit 'beb815a' into MergeUpstream3 2020-05-27 15:03:44 +10:00
Doyle 334f94af62 Merge commit 'c39ea48' into MergeUpstream3 2020-05-27 14:43:35 +10:00
Doyle f2f48f8815 Merge commit 'b4e1dc83d275f8ee9a8c12615cf952f05161c7a3' into MergeUpstream3 2020-05-27 14:25:14 +10:00
Doyle 836d51b7c9 Merge commit '3b0a43a' into MergeUpstream3 2020-05-25 15:35:00 +10:00
Doyle 0f818c929b Merge commit 'f253bf3' into MergeUpstream3 2020-05-25 15:17:47 +10:00
Doyle 0c3e3db2eb Merge commit 'a1736a94298fefb3c33adbf22e9333ced55c15bd' into MergeUpstream3 2020-05-22 10:44:14 +10:00
Doyle 903e80cb65 Merge commit '2ec455df1f82148733c4ac268d22e9c51a690b14' into MergeUpstream3 2020-05-21 14:29:44 +10:00
Doyle 315b6ac869 Merge commit '8501481' into MergeUpstream3 2020-05-18 16:21:45 +10:00
Doyle d890d97fe6 Merge commit '415005a' into MergeUpstream3 2020-05-18 15:40:13 +10:00
Doyle 184183f309 Merge branch 'dev' into MergeUpstream2 2020-05-18 12:58:59 +10:00
Jason Rhinelander 0e3f173c7f RPC overhaul
High-level details:

This redesigns the RPC layer to make it much easier to work with,
decouples it from an embedded HTTP server, and gets the vast majority of
the RPC serialization and dispatch code out of a very commonly included
header.

There is unfortunately rather a lot of interconnected code here that
cannot be easily separated out into separate commits.  The full details
of what happens here are as follows:

Major details:
- All of the RPC code is now in a `cryptonote::rpc` namespace; this
  renames quite a bit to be less verbose: e.g. CORE_RPC_STATUS_OK
  becomes `rpc::STATUS_OK`, and `cryptonote::COMMAND_RPC_SOME_LONG_NAME`
  becomes `rpc::SOME_LONG_NAME` (or just SOME_LONG_NAME for code already
  working in the `rpc` namespace).
- `core_rpc_server` is now completely decoupled from providing any
  request protocol: it is now *just* the core RPC call handler.
- The HTTP RPC interface now lives in a new rpc/http_server.h; this code
  handles listening for HTTP requests and dispatching them to
  core_rpc_server, then sending the results back to the caller.
- There is similarly a rpc/lmq_server.h for LMQ RPC code; more details
  on this (and other LMQ specifics) below.
- RPC implementing code now returns the response object and throws when
  things go wrong which simplifies much of the rpc error handling.  They
  can throw anything; generic exceptions get logged and a generic
  "internal error" message gets returned to the caller, but there is
  also an `rpc_error` class to return an error code and message used by
  some json-rpc commands.
- RPC implementing functions now overload `core_rpc_server::invoke`
  following the pattern:

    RPC_BLAH_BLAH::response core_rpc_server::invoke(RPC_BLAH_BLAH::request&& req, rpc_context context);

  This overloading makes the code vastly simpler: all instantiations are
  now done with a small amount of generic instantiation code in a single
  .cpp rather than needing to go to hell and back with a nest of epee
  macros in a core header.
- each RPC endpoint is now defined by the RPC types themselves,
  including its accessible names and permissions, in
  core_rpc_server_commands_defs.h:
  - every RPC structure now has a static `names()` function that returns
    the names by which the end point is accessible.  (The first one is
    the primary, the others are for deprecated aliases).
  - RPC command wrappers define their permissions and type by inheriting
    from special tag classes:
    - rpc::RPC_COMMAND is a basic, admin-only, JSON command, available
      via JSON RPC.  *All* JSON commands are now available via JSON RPC,
      instead of the previous mix of some being at /foo and others at
      /json_rpc.  (Ones that were previously at /foo are still there for
      backwards compatibility; see `rpc::LEGACY` below).
    - rpc::PUBLIC specifies that the command should be available via a
      restricted RPC connection.
    - rpc::BINARY specifies that the command is not JSON, but rather is
      accessible as /name and takes and returns values in the magic epee
      binary "portable storage" (lol) data format.
    - rpc::LEGACY specifies that the command should be available via the
      non-json-rpc interface at `/name` for backwards compatibility (in
      addition to the JSON-RPC interface).
- some epee serialization got unwrapped and de-templatized so that it
  can be moved into a .cpp file with just declarations in the .h.  (This
  makes a *huge* difference for core_rpc_server_commands_defs.h and for
  every compilation unit that includes it which previously had to
  compile all the serialization code and then throw all by one copy away
  at link time).  This required some new macros so as to not break a ton
  of places that will use the old way putting everything in the headers;
  The RPC code uses this as does a few other places; there are comments
  in contrib/epee/include/serialization/keyvalue_serialization.h as to
  how to use it.
- Detemplatized a bunch of epee/storages code.  Most of it should have
  have been using templates at all (because it can only ever be called
  with one type!), and now it isn't.  This broke some things that didn't
  properly compile because of missing headers or (in one case) a messed
  up circular dependency.
- Significantly simplified a bunch of over-templatized serialization
  code.
- All RPC serialization definitions is now out of
  core_rpc_server_commands_defs.h and into a single .cpp file
  (core_rpc_server_commands_defs.cpp).
- core RPC no longer uses the disgusting
  BEGIN_URI_MAP2/MAP_URI_BLAH_BLAH macros.  This was a terrible design
  that forced slamming tons of code into a common header that didn't
  need to be there.
- epee::struct_init is gone.  It was a horrible hack that instiated
  multiple templates just so the coder could be so lazy and write
  `some_type var;` instead of properly value initializing with
  `some_type var{};`.
- Removed a bunch of useless crap from epee.  In particular, forcing
  extra template instantiations all over the place in order to nest
  return objects inside JSON RPC values is no longer needed, as are a
  bunch of stuff related to the above de-macroization of the code.
- get_all_service_nodes, get_service_nodes, and get_n_service_nodes are
  now combined into a single `get_service_nodes` (with deprecated
  aliases for the others), which eliminates a fair amount of
  duplication.  The biggest obstacle here was getting the requested
  fields reference passed through: this is now done by a new ability to
  stash a context in the serialization object that can be retrieved by a
  sub-serialized type.

LMQ-specifics:

- The LokiMQ instance moves into `cryptonote::core` rather than being
  inside cryptonote_protocol.  Currently the instance is used both for
  qnet and rpc calls (and so needs to be in a common place), but I also
  intend future PRs to use the batching code for job processing
  (replacing the current threaded job queue).
- rpc/lmq_server.h handles the actual LMQ-request-to-core-RPC glue.
  Unlike http_server it isn't technically running the whole LMQ stack
  from here, but the parallel name with http_server seemed appropriate.
- All RPC endpoints are supported by LMQ under the same names as defined
  generically, but prefixed with `rpc.` for public commands and `admin.`
  for restricted ones.
- service node keys are now always available, even when not running in
  `--service-node` mode: this is because we want the x25519 key for
  being able to offer CURVE encryption for lmq RPC end-points, and
  because it doesn't hurt to have them available all the time.  In the
  RPC layer this is now called "get_service_keys" (with
  "get_service_node_key" as an alias) since they aren't strictly only
  for service nodes.  This also means code needs to check
  m_service_node, and not m_service_node_keys, to tell if it is running
  as a service node.  (This is also easier to notice because
  m_service_node_keys got renamed to `m_service_keys`).
- Added block and mempool monitoring LMQ RPC endpoints: `sub.block` and
  `sub.mempool` subscribes the connection for new block and new mempool
  TX notifications.  The latter can notify on just blink txes, or all
  new mempool txes (but only new ones -- txes dumped from a block don't
  trigger it).  The client gets pushed a [`notify.block`, `height`,
  `hash`] or [`notify.tx`, `txhash`, `blob`] message when something
  arrives.

Minor details:
- rpc::version_t is now a {major,minor} pair.  Forcing everyone to pack
  and unpack a uint32_t was gross.
- Changed some macros to constexprs (e.g. CORE_RPC_ERROR_CODE_...).
  (This immediately revealed a couple of bugs in the RPC code that was
  assigning CORE_RPC_ERROR_CODE_... to a string, and it worked because
  the macro allows implicit conversion to a char).
- De-templatizing useless templates in epee (i.e. a bunch of templated
  types that were never invoked with different types) revealed a painful
  circular dependency between epee and non-epee code for tor_address and
  i2p_address.  This crap is now handled in a suitably named
  `net/epee_network_address_hack.cpp` hack because it really isn't
  trivial to extricate this mess.
- Removed `epee/include/serialization/serialize_base.h`.  Amazingly the
  code somehow still all works perfectly with this previously vital
  header removed.
- Removed bitrotted, unused epee "crypted_storage" and
  "gzipped_inmemstorage" code.
- Replaced a bunch of epee::misc_utils::auto_scope_leave_caller with
  LOKI_DEFERs.  The epee version involves quite a bit more instantiation
  and is ugly as sin.  Also made the `loki::defer` class invokable for
  some edge cases that need calling before destruction in particular
  conditions.
- Moved the systemd code around; it makes much more sense to do the
  systemd started notification as in daemon.cpp as late as possible
  rather than in core (when we can still have startup failures, e.g. if
  the RPC layer can't start).
- Made the systemd short status string available in the get_info RPC
  (and no longer require building with systemd).
- during startup, print (only) the x25519 when not in SN mode, and
  continue to print all three when in SN mode.
- DRYed out some RPC implementation code (such as set_limit)
- Made wallet_rpc stop using a raw m_wallet pointer
2020-05-11 18:44:45 -03:00
Doyle e7e622e08b Merge commit '459beb5' into MergeUpstream2 2020-04-20 17:25:53 +10:00
Doyle 7162902a6d Merge commit '880ebfdeeaceab5e1ca40b748516987e9c6cecb7' into MergeUpstream2 2020-04-20 16:33:56 +10:00
Doyle 90d5330ac5 Merge commit '7d9b7fee43648b01ada2696ddf905d42a0263789' into MergeUpstream2 2020-04-20 16:15:53 +10:00
Doyle 6081b825ed Merge commit '4c4586c' into MergeUpstream 2020-04-07 15:16:58 +10:00
Jason Rhinelander 10ff717ef9 Update qnet-ping to support direct port pings 2020-03-14 16:41:01 -03:00
Doyle 2df6809214
Remove unused gpg_keys (#1068) 2020-03-12 10:54:13 +11:00
Jason Rhinelander c98688fd84 Convert quorumnet to loki-mq
This adds the loki-mq dependency and replaces SNNetwork with it (along
with some syntax updates for how loki-mq changed a bit from SNNetwork).

This also replaces common/hex.h and common/string_view.h with loki-mq's
faster (hex) and more complete and tested (string_view) implementations.
2020-03-06 00:36:57 -04:00
Alexander Blair 3b224bb99d
Merge pull request #6069
d64e5aa7 wallet: allow message sign/verify for subaddresses (moneromooo-monero)
2020-02-06 00:29:32 -08:00