initial loki -> oxen pass

This commit is contained in:
Sean Darcy 2021-01-04 11:09:45 +11:00
parent b59ee4f84a
commit 0396698ee7
91 changed files with 588 additions and 588 deletions

View File

@ -1562,7 +1562,7 @@ void BlockchainLMDB::open(const fs::path& filename, cryptonote::network_type net
if (mdb_flags & MDB_RDONLY)
{
MFATAL("Existing lmdb database needs to be converted, which cannot be done on a read-only database.");
MFATAL("Please run lokid once to convert the database.");
MFATAL("Please run oxend once to convert the database.");
failed = true;
}
else

View File

@ -13,16 +13,16 @@ See also each utility's "--help" option.
### Export an existing blockchain database
`$ loki-blockchain-export`
`$ oxen-blockchain-export`
This loads the existing blockchain and exports it to `$LOKI_DATA_DIR/export/blockchain.raw`
### Import the exported file
`$ loki-blockchain-import`
`$ oxen-blockchain-import`
This imports blocks from `$LOKI_DATA_DIR/export/blockchain.raw` (exported using the
`loki-blockchain-export` tool as described above) into the current database.
`oxen-blockchain-export` tool as described above) into the current database.
Defaults: `--batch on`, `--batch size 20000`, `--verify on`
@ -31,14 +31,14 @@ Batch size refers to number of blocks and can be adjusted for performance based
Verification should only be turned off if importing from a trusted blockchain.
If you encounter an error like "resizing not supported in batch mode", you can just re-run
the `loki-blockchain-import` command again, and it will restart from where it left off.
the `oxen-blockchain-import` command again, and it will restart from where it left off.
```bash
## use default settings to import blockchain.raw into database
$ loki-blockchain-import
$ oxen-blockchain-import
## fast import with large batch size, database mode "fastest", verification off
$ loki-blockchain-import --batch-size 20000 --database lmdb#fastest --verify off
$ oxen-blockchain-import --batch-size 20000 --database lmdb#fastest --verify off
```
@ -81,9 +81,9 @@ LMDB flags (more than one may be specified):
## Examples:
```bash
$ loki-blockchain-import --database lmdb#fastest
$ oxen-blockchain-import --database lmdb#fastest
$ loki-blockchain-import --database lmdb#nosync
$ oxen-blockchain-import --database lmdb#nosync
$ loki-blockchain-import --database lmdb#nosync,nometasync
$ oxen-blockchain-import --database lmdb#nosync,nometasync
```

View File

@ -27,7 +27,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef _WIN32
#define __STDC_FORMAT_MACROS // NOTE(loki): Explicitly define the SCNu64 macro on Mingw
#define __STDC_FORMAT_MACROS // NOTE(oxen): Explicitly define the SCNu64 macro on Mingw
#endif
#include <unordered_map>
@ -388,7 +388,7 @@ int main(int argc, char* argv[])
return 1;
}
mlog_configure(mlog_get_default_log_path("loki-blockchain-ancestry.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-ancestry.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -28,7 +28,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef _WIN32
#define __STDC_FORMAT_MACROS // NOTE(loki): Explicitly define the PRIu64 macro on Mingw
#define __STDC_FORMAT_MACROS // NOTE(oxen): Explicitly define the PRIu64 macro on Mingw
#endif
#include "common/unordered_containers_boost_serialization.h"
@ -135,7 +135,7 @@ static bool parse_db_sync_mode(std::string db_sync_mode)
static fs::path get_default_db_path()
{
// remove .loki, replace with .shared-ringdb
// remove .oxen, replace with .shared-ringdb
fs::path p = tools::get_default_data_dir();
p.replace_filename(".shared-ringdb");
return p;
@ -963,7 +963,7 @@ static void open_db(const fs::path& filename, MDB_env** env, MDB_txn** txn, MDB_
CHECK_AND_ASSERT_THROW_MES(!dbr, "Failed to create LDMB environment: " + std::string(mdb_strerror(dbr)));
dbr = mdb_env_set_maxdbs(*env, 1);
CHECK_AND_ASSERT_THROW_MES(!dbr, "Failed to set max env dbs: " + std::string(mdb_strerror(dbr)));
MINFO("Opening loki blockchain at " << filename);
MINFO("Opening oxen blockchain at " << filename);
dbr = mdb_env_open(*env, filename.string().c_str(), flags, 0664);
CHECK_AND_ASSERT_THROW_MES(!dbr, "Failed to open rings database file '"
+ filename.u8string() + "': " + std::string(mdb_strerror(dbr)));
@ -1239,7 +1239,7 @@ int main(int argc, char* argv[])
return 1;
}
mlog_configure(mlog_get_default_log_path("loki-blockchain-mark-spent-outputs.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-mark-spent-outputs.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -88,7 +88,7 @@ int main(int argc, char* argv[])
return 1;
}
mlog_configure(mlog_get_default_log_path("loki-blockchain-depth.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-depth.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -91,7 +91,7 @@ int main(int argc, char* argv[])
return 1;
}
mlog_configure(mlog_get_default_log_path("loki-blockchain-export.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-export.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -640,7 +640,7 @@ int main(int argc, char* argv[])
}
m_config_folder = command_line::get_arg(vm, cryptonote::arg_data_dir);
mlog_configure(mlog_get_default_log_path("loki-blockchain-import.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-import.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -6,7 +6,7 @@
#include "cryptonote_core/service_node_list.h"
#include "cryptonote_core/service_node_voting.h"
// NOTE(loki): This is done this way because of the circular constructors.
// NOTE(oxen): This is done this way because of the circular constructors.
struct blockchain_objects_t
{
cryptonote::Blockchain m_blockchain;

View File

@ -484,7 +484,7 @@ int main(int argc, char* argv[])
return 1;
}
mlog_configure(mlog_get_default_log_path("loki-blockchain-prune.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-prune.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -27,7 +27,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef _WIN32
#define __STDC_FORMAT_MACROS // NOTE(loki): Explicitly define the PRIu64 macro on Mingw
#define __STDC_FORMAT_MACROS // NOTE(oxen): Explicitly define the PRIu64 macro on Mingw
#endif
#include "common/command_line.h"
@ -150,7 +150,7 @@ int main(int argc, char* argv[])
return 1;
}
mlog_configure(mlog_get_default_log_path("loki-blockchain-prune-known-spent-data.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-prune-known-spent-data.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -102,7 +102,7 @@ int main(int argc, char* argv[])
return 1;
}
mlog_configure(mlog_get_default_log_path("loki-blockchain-stats.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-stats.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -121,7 +121,7 @@ int main(int argc, char* argv[])
return 1;
}
mlog_configure(mlog_get_default_log_path("loki-blockchain-usage.log"), true);
mlog_configure(mlog_get_default_log_path("oxen-blockchain-usage.log"), true);
if (!command_line::is_arg_defaulted(vm, arg_log_level))
mlog_set_log(command_line::get_arg(vm, arg_log_level).c_str());
else

View File

@ -29,7 +29,7 @@ generate [--overwrite] FILENAME
FILENAME. If FILENAME contains the string "PUBKEY" it will be replaced
with the generated public key value (in hex).
For an active service node this file is named `key_ed25519` in the lokid
For an active service node this file is named `key_ed25519` in the oxend
data directory.
If FILENAME already exists the command will fail unless the `--overwrite`

View File

@ -39,8 +39,8 @@
#include "blockchain_db/blockchain_db.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "common/loki_integration_test_hooks.h"
#include "common/loki.h"
#include "common/oxen_integration_test_hooks.h"
#include "common/oxen.h"
#include "common/file.h"
#include "common/hex.h"
@ -81,7 +81,7 @@ namespace cryptonote
if (nettype == MAINNET)
{
uint64_t last_index = loki::array_count(HARDCODED_MAINNET_CHECKPOINTS) - 1;
uint64_t last_index = oxen::array_count(HARDCODED_MAINNET_CHECKPOINTS) - 1;
height_to_hash const &entry = HARDCODED_MAINNET_CHECKPOINTS[last_index];
if (tools::hex_to_type(entry.hash, result))
@ -149,7 +149,7 @@ namespace cryptonote
}
bool checkpoints::update_checkpoint(checkpoint_t const &checkpoint)
{
// NOTE(loki): Assumes checkpoint is valid
// NOTE(oxen): Assumes checkpoint is valid
bool result = true;
bool batch_started = false;
try
@ -312,7 +312,7 @@ namespace cryptonote
#if !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
if (nettype == MAINNET)
{
for (size_t i = 0; i < loki::array_count(HARDCODED_MAINNET_CHECKPOINTS); ++i)
for (size_t i = 0; i < oxen::array_count(HARDCODED_MAINNET_CHECKPOINTS); ++i)
{
height_to_hash const &checkpoint = HARDCODED_MAINNET_CHECKPOINTS[i];
ADD_CHECKPOINT(checkpoint.height, checkpoint.hash);

View File

@ -37,7 +37,7 @@ add_library(common
expect.cpp
file.cpp
i18n.cpp
loki.cpp
oxen.cpp
notify.cpp
password.cpp
perf_timer.cpp

View File

@ -247,7 +247,7 @@ DNSResolver::DNSResolver()
if (!DNS_PUBLIC)
{
// TODO(loki): Don't probe moneropulse for Loki
// TODO(oxen): Don't probe moneropulse for Loki
#if 0
// if no DNS_PUBLIC specified, we try a lookup to what we know
// should be a valid DNSSEC record, and switch to known good
@ -473,9 +473,9 @@ std::string address_from_txt_record(std::string_view s)
return {};
}
/**
* @brief gets a loki address from the TXT record of a DNS entry
* @brief gets a oxen address from the TXT record of a DNS entry
*
* gets the loki address from the TXT record of the DNS entry associated
* gets the oxen address from the TXT record of the DNS entry associated
* with <url>. If this lookup fails, or the TXT record does not contain an
* XMR address in the correct format, returns an empty string. <dnssec_valid>
* will be set true or false according to whether or not the DNS query passes
@ -484,7 +484,7 @@ std::string address_from_txt_record(std::string_view s)
* @param url the url to look up
* @param dnssec_valid return-by-reference for DNSSEC status of query
*
* @return a loki address (as a string) or an empty string
* @return a oxen address (as a string) or an empty string
*/
std::vector<std::string> addresses_from_url(const std::string_view url, bool& dnssec_valid)
{
@ -501,7 +501,7 @@ std::vector<std::string> addresses_from_url(const std::string_view url, bool& dn
}
else dnssec_valid = false;
// for each txt record, try to find a loki address in it.
// for each txt record, try to find a oxen address in it.
for (auto& rec : records)
{
std::string addr = address_from_txt_record(rec);

View File

@ -1,4 +1,4 @@
#include "loki.h"
#include "oxen.h"
/* Exponential base 2 function.
Copyright (C) 2012-2019 Free Software Foundation, Inc.
@ -22,7 +22,7 @@
#include <cfloat>
#include <cmath>
// TODO(loki): This is temporary until we switch to integer math for calculating
// TODO(oxen): This is temporary until we switch to integer math for calculating
// block rewards. We provide the specific implementation to minimise the risk of
// different results from math functions across different std libraries.
static_assert(std::numeric_limits<double>::is_iec559, "We require IEEE standard compliant doubles.");
@ -40,7 +40,7 @@ static_assert(std::numeric_limits<double>::is_iec559, "We require IEEE standard
#define LOG2_BY_256_INVERSE 369.329930467574632284140718336484387181
double
loki::exp2(double x)
oxen::exp2(double x)
{
/* exp2(x) = exp(x*log(2)).
If we would compute it like this, there would be rounding errors for
@ -94,7 +94,7 @@ loki::exp2(double x)
truncate the series after the z^5 term. */
{
double nm = loki::round (x * 256.0); /* = 256 * n + m */
double nm = oxen::round (x * 256.0); /* = 256 * n + m */
double z = (x * 256.0 - nm) * (LOG2_BY_256 * 0.5);
/* Coefficients of the power series for tanh(z). */
@ -116,7 +116,7 @@ loki::exp2(double x)
double exp_y = (1.0 + tanh_z) / (1.0 - tanh_z);
int n = (int) loki::round (nm * (1.0 / 256.0));
int n = (int) oxen::round (nm * (1.0 / 256.0));
int m = (int) nm - 256 * n;
/* exp_table[i] = exp((i - 128) * log(2)/256).
@ -434,7 +434,7 @@ loki::exp2(double x)
#endif
double
loki::round (double x)
oxen::round (double x)
{
/* 2^(DBL_MANT_DIG-1). */
static const double TWO_MANT_DIG =

View File

@ -36,7 +36,7 @@
#include <utility>
#define LOKI_RPC_DOC_INTROSPECT
namespace loki
namespace oxen
{
double round (double);
double exp2 (double);
@ -71,7 +71,7 @@ struct defer_helper
#define LOKI_TOKEN_COMBINE2(x, y) x ## y
#define LOKI_TOKEN_COMBINE(x, y) LOKI_TOKEN_COMBINE2(x, y)
#define LOKI_DEFER auto const LOKI_TOKEN_COMBINE(loki_defer_, __LINE__) = loki::defer_helper() + [&]()
#define LOKI_DEFER auto const LOKI_TOKEN_COMBINE(oxen_defer_, __LINE__) = oxen::defer_helper() + [&]()
template <typename T, size_t N>
constexpr size_t array_count(T (&)[N]) { return N; }

View File

@ -65,7 +65,7 @@ const command_line::arg_descriptor<std::string, false> arg_hardforks_override =
const command_line::arg_descriptor<std::string, false> arg_pipe_name = {
"integration-test-pipe-name"
, "Specify the pipe name for stdin and stdout"
, "loki-default-pipe-name"
, "oxen-default-pipe-name"
, false
};

View File

@ -45,7 +45,7 @@
#define EOT 0x4
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
namespace
{

View File

@ -1,12 +1,12 @@
#include "scoped_message_writer.h"
#define LOKI_INTEGRATION_TEST_HOOKS_IMPLEMENTATION
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
// NOTE(loki): This file only exists because I need a way to hook into the
// NOTE(oxen): This file only exists because I need a way to hook into the
// message writer for integration tests. Originally this was a header only file,
// which means it needs to know the implementation of
// loki_integration_test_hooks.h functions which isn't possible to expose in
// oxen_integration_test_hooks.h functions which isn't possible to expose in
// just the header because of the One Definition Rule.
// - doyle 2018-11-08

View File

@ -32,7 +32,7 @@
#include "epee/readline_suspend.h"
#include <iostream>
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
namespace tools
{
@ -61,7 +61,7 @@ public:
, m_log_level(log_level)
{
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
m_color = epee::console_color_default; // NOTE(loki): No ANSI color codes in the output. Makes parsing harder.
m_color = epee::console_color_default; // NOTE(oxen): No ANSI color codes in the output. Makes parsing harder.
#endif
m_oss << prefix;
}

View File

@ -39,7 +39,7 @@
#include "epee/misc_log_ex.h"
#include "util.h"
#include "spawn.h"
#include "loki.h"
#include "oxen.h"
#include "string_util.h"
#undef LOKI_DEFAULT_LOG_CATEGORY

View File

@ -63,10 +63,10 @@ namespace tools
{
ub_ctx *ctx = ub_ctx_create();
if (!ctx) return false; // cheat a bit, should not happen unless OOM
char *loki = strdup("loki"), *unbound = strdup("unbound");
ub_ctx_zone_add(ctx, loki, unbound); // this calls ub_ctx_finalize first, then errors out with UB_SYNTAX
char *oxen = strdup("oxen"), *unbound = strdup("unbound");
ub_ctx_zone_add(ctx, oxen, unbound); // this calls ub_ctx_finalize first, then errors out with UB_SYNTAX
free(unbound);
free(loki);
free(oxen);
// if no threads, bails out early with UB_NOERROR, otherwise fails with UB_AFTERFINAL id already finalized
bool with_threads = ub_ctx_async(ctx, 1) != 0; // UB_AFTERFINAL is not defined in public headers, check any error
ub_ctx_delete(ctx);
@ -311,7 +311,7 @@ namespace tools
// Devnet blocks
return num_blocks;
// TODO(loki):
// TODO(oxen):
#if 0
// The following is a table of average blocks sizes in bytes over the Monero mainnet
// blockchain, where the block size is averaged over ranges of 10,000 blocks

View File

@ -184,7 +184,7 @@ namespace cryptonote
txversion version;
txtype type;
bool is_transfer() const { return type == txtype::standard || type == txtype::stake || type == txtype::loki_name_system; }
bool is_transfer() const { return type == txtype::standard || type == txtype::stake || type == txtype::oxen_name_system; }
// not used after version 2, but remains for compatibility
uint64_t unlock_time; //number of block (or time), used as a limitation like: spend this tx not early then block/time
@ -529,7 +529,7 @@ namespace cryptonote
constexpr txtype transaction_prefix::get_max_type_for_hf(uint8_t hf_version)
{
txtype result = txtype::standard;
if (hf_version >= network_version_15_lns) result = txtype::loki_name_system;
if (hf_version >= network_version_15_lns) result = txtype::oxen_name_system;
else if (hf_version >= network_version_14_blink) result = txtype::stake;
else if (hf_version >= network_version_11_infinite_staking) result = txtype::key_image_unlock;
else if (hf_version >= network_version_9_service_nodes) result = txtype::state_change;
@ -557,7 +557,7 @@ namespace cryptonote
case txtype::state_change: return "state_change";
case txtype::key_image_unlock: return "key_image_unlock";
case txtype::stake: return "stake";
case txtype::loki_name_system: return "loki_name_system";
case txtype::oxen_name_system: return "oxen_name_system";
default: assert(false); return "xx_unhandled_type";
}
}

View File

@ -40,7 +40,7 @@
#include "crypto/hash.h"
#include "epee/int-util.h"
#include "common/dns_utils.h"
#include "common/loki.h"
#include "common/oxen.h"
#include <cfenv>
#undef LOKI_DEFAULT_LOG_CATEGORY
@ -91,7 +91,7 @@ namespace cryptonote {
return CRYPTONOTE_MAX_TX_SIZE;
}
//-----------------------------------------------------------------------------------------------
// TODO(loki): Move into loki_economy, this will require access to loki::exp2
// TODO(oxen): Move into oxen_economy, this will require access to oxen::exp2
uint64_t block_reward_unpenalized_formula_v7(uint64_t already_generated_coins, uint64_t height)
{
uint64_t emission_supply_component = (already_generated_coins * EMISSION_SUPPLY_MULTIPLIER) / EMISSION_SUPPLY_DIVISOR;
@ -106,7 +106,7 @@ namespace cryptonote {
uint64_t block_reward_unpenalized_formula_v8(uint64_t height)
{
std::fesetround(FE_TONEAREST);
uint64_t result = 28'000'000'000. + 100'000'000'000. / loki::exp2(height / (720. * 90)); // halve every 90 days.
uint64_t result = 28'000'000'000. + 100'000'000'000. / oxen::exp2(height / (720. * 90)); // halve every 90 days.
return result;
}

View File

@ -48,7 +48,7 @@
#include "ringct/rctSigs.h"
#include "cryptonote_basic/verification_context.h"
#include "cryptonote_core/service_node_voting.h"
#include "cryptonote_core/loki_name_system.h"
#include "cryptonote_core/oxen_name_system.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "cn"
@ -787,7 +787,7 @@ namespace cryptonote
return crypto::null_pkey;
}
//---------------------------------------------------------------
void add_loki_name_system_to_tx_extra(std::vector<uint8_t> &tx_extra, tx_extra_loki_name_system const &entry)
void add_oxen_name_system_to_tx_extra(std::vector<uint8_t> &tx_extra, tx_extra_oxen_name_system const &entry)
{
tx_extra_field field = entry;
add_tx_extra_field_to_tx_extra(tx_extra, field);
@ -1058,7 +1058,7 @@ namespace cryptonote
switch (decimal_point)
{
case 9:
return "loki";
return "oxen";
case 6:
return "megarok";
case 3:
@ -1260,7 +1260,7 @@ namespace cryptonote
const blobdata blob = tx_to_blob(t);
CHECK_AND_ASSERT_MES(!blob.empty(), false, "Failed to convert tx to blob");
// TODO(loki): Not sure if this is the right fix, we may just want to set
// TODO(oxen): Not sure if this is the right fix, we may just want to set
// unprunable size to the size of the prefix because technically that is
// what it is and then keep this code path.
if (t.is_transfer())

View File

@ -146,7 +146,7 @@ namespace cryptonote
void add_service_node_contributor_to_tx_extra(std::vector<uint8_t>& tx_extra, const cryptonote::account_public_address& address);
crypto::public_key get_service_node_winner_from_tx_extra(const std::vector<uint8_t>& tx_extra);
void add_loki_name_system_to_tx_extra(std::vector<uint8_t> &tx_extra, tx_extra_loki_name_system const &entry);
void add_oxen_name_system_to_tx_extra(std::vector<uint8_t> &tx_extra, tx_extra_oxen_name_system const &entry);
std::vector<crypto::public_key> get_additional_tx_pub_keys_from_extra(const std::vector<uint8_t>& tx_extra);
std::vector<crypto::public_key> get_additional_tx_pub_keys_from_extra(const transaction_prefix& tx);

View File

@ -31,7 +31,7 @@
#include <algorithm>
#include "common/loki.h"
#include "common/oxen.h"
#include "epee/int-util.h"
#include "crypto/hash.h"
#include "difficulty.h"
@ -236,7 +236,7 @@ namespace cryptonote {
harmonic_mean_D = N / sum_inverse_D;
// Keep LWMA sane in case something unforeseen occurs.
if (static_cast<int64_t>(loki::round(LWMA)) < T / 20)
if (static_cast<int64_t>(oxen::round(LWMA)) < T / 20)
LWMA = static_cast<double>(T / 20);
nextDifficulty = harmonic_mean_D * T / LWMA * adjust;

View File

@ -30,7 +30,7 @@
#include <algorithm>
#include <cstdio>
#include "common/loki.h"
#include "common/oxen.h"
#include "cryptonote_basic/cryptonote_basic.h"
#include "blockchain_db/blockchain_db.h"
#include "hardfork.h"
@ -56,7 +56,7 @@ static uint8_t get_block_version(const cryptonote::block &b)
return b.major_version;
}
// TODO(loki): Re-evaluate Hardfork as a class. Originally designed to
// TODO(oxen): Re-evaluate Hardfork as a class. Originally designed to
// handle voting, hardforks are now locked in, maybe we just need helper
// functions on the hardcoded table instead of hiding everything behind
// a class.

View File

@ -33,7 +33,7 @@
#include <boost/serialization/version.hpp>
#include <ostream>
#include "common/loki.h"
#include "common/oxen.h"
namespace cryptonote
{

View File

@ -2,7 +2,7 @@
namespace cryptonote {
tx_extra_loki_name_system tx_extra_loki_name_system::make_buy(
tx_extra_oxen_name_system tx_extra_oxen_name_system::make_buy(
lns::generic_owner const& owner,
lns::generic_owner const* backup_owner,
lns::mapping_type type,
@ -10,7 +10,7 @@ tx_extra_loki_name_system tx_extra_loki_name_system::make_buy(
const std::string& encrypted_value,
const crypto::hash& prev_txid)
{
tx_extra_loki_name_system result{};
tx_extra_oxen_name_system result{};
result.fields = lns::extra_field::buy;
result.owner = owner;
@ -26,12 +26,12 @@ tx_extra_loki_name_system tx_extra_loki_name_system::make_buy(
return result;
}
tx_extra_loki_name_system tx_extra_loki_name_system::make_renew(
tx_extra_oxen_name_system tx_extra_oxen_name_system::make_renew(
lns::mapping_type type, crypto::hash const &name_hash, crypto::hash const &prev_txid)
{
assert(is_lokinet_type(type) && prev_txid);
assert(is_oxennet_type(type) && prev_txid);
tx_extra_loki_name_system result{};
tx_extra_oxen_name_system result{};
result.fields = lns::extra_field::none;
result.type = type;
result.name_hash = name_hash;
@ -39,7 +39,7 @@ tx_extra_loki_name_system tx_extra_loki_name_system::make_renew(
return result;
}
tx_extra_loki_name_system tx_extra_loki_name_system::make_update(
tx_extra_oxen_name_system tx_extra_oxen_name_system::make_update(
const lns::generic_signature& signature,
lns::mapping_type type,
const crypto::hash& name_hash,
@ -48,7 +48,7 @@ tx_extra_loki_name_system tx_extra_loki_name_system::make_update(
const lns::generic_owner* backup_owner,
const crypto::hash& prev_txid)
{
tx_extra_loki_name_system result{};
tx_extra_oxen_name_system result{};
result.signature = signature;
result.type = type;
result.name_hash = name_hash;

View File

@ -36,7 +36,7 @@
#include "serialization/variant.h"
#include "crypto/crypto.h"
#include "common/hex.h"
#include "loki_economy.h"
#include "oxen_economy.h"
#include "cryptonote_basic.h"
@ -470,7 +470,7 @@ namespace cryptonote
END_SERIALIZE()
};
struct tx_extra_loki_name_system
struct tx_extra_oxen_name_system
{
uint8_t version = 0;
lns::mapping_type type;
@ -489,11 +489,11 @@ namespace cryptonote
bool is_updating() const { return field_is_set(lns::extra_field::signature) && field_any_set(lns::extra_field::updatable_fields); }
// True if this is buying a new LNS record
bool is_buying() const { return (fields == lns::extra_field::buy || fields == lns::extra_field::buy_no_backup); }
// True if this is renewing an existing LNS: has no fields at all, is a renewal registration (i.e. lokinet),
// True if this is renewing an existing LNS: has no fields at all, is a renewal registration (i.e. oxennet),
// and has a non-null txid set (which should point to the most recent registration or update).
bool is_renewing() const { return fields == lns::extra_field::none && prev_txid && is_lokinet_type(type); }
bool is_renewing() const { return fields == lns::extra_field::none && prev_txid && is_oxennet_type(type); }
static tx_extra_loki_name_system make_buy(
static tx_extra_oxen_name_system make_buy(
lns::generic_owner const& owner,
lns::generic_owner const* backup_owner,
lns::mapping_type type,
@ -501,9 +501,9 @@ namespace cryptonote
const std::string& encrypted_value,
const crypto::hash& prev_txid);
static tx_extra_loki_name_system make_renew(lns::mapping_type type, const crypto::hash& name_hash, const crypto::hash& prev_txid);
static tx_extra_oxen_name_system make_renew(lns::mapping_type type, const crypto::hash& name_hash, const crypto::hash& prev_txid);
static tx_extra_loki_name_system make_update(
static tx_extra_oxen_name_system make_update(
const lns::generic_signature& signature,
lns::mapping_type type,
const crypto::hash& name_hash,
@ -544,7 +544,7 @@ namespace cryptonote
tx_extra_service_node_contributor,
tx_extra_service_node_pubkey,
tx_extra_tx_secret_key,
tx_extra_loki_name_system,
tx_extra_oxen_name_system,
tx_extra_tx_key_image_proofs,
tx_extra_tx_key_image_unlock,
tx_extra_burn,
@ -573,4 +573,4 @@ BINARY_VARIANT_TAG(cryptonote::tx_extra_tx_secret_key, cryptonote:
BINARY_VARIANT_TAG(cryptonote::tx_extra_tx_key_image_proofs, cryptonote::TX_EXTRA_TAG_TX_KEY_IMAGE_PROOFS);
BINARY_VARIANT_TAG(cryptonote::tx_extra_tx_key_image_unlock, cryptonote::TX_EXTRA_TAG_TX_KEY_IMAGE_UNLOCK);
BINARY_VARIANT_TAG(cryptonote::tx_extra_burn, cryptonote::TX_EXTRA_TAG_BURN);
BINARY_VARIANT_TAG(cryptonote::tx_extra_loki_name_system, cryptonote::TX_EXTRA_TAG_LOKI_NAME_SYSTEM);
BINARY_VARIANT_TAG(cryptonote::tx_extra_oxen_name_system, cryptonote::TX_EXTRA_TAG_LOKI_NAME_SYSTEM);

View File

@ -17,7 +17,7 @@ enum class txversion : uint16_t {
state_change,
key_image_unlock,
stake,
loki_name_system,
oxen_name_system,
_count
};

View File

@ -76,7 +76,7 @@ static_assert(STAKING_PORTIONS % 12 == 0, "Use a multiple of twelve, so that it
#define LOKINET_PING_LIFETIME UPTIME_PROOF_FREQUENCY_IN_SECONDS
#define CRYPTONOTE_REWARD_BLOCKS_WINDOW 100
#define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1 20000 // NOTE(loki): For testing suite, //size of block (bytes) after which reward for block calculated using block size - before first fork
#define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V1 20000 // NOTE(oxen): For testing suite, //size of block (bytes) after which reward for block calculated using block size - before first fork
#define CRYPTONOTE_BLOCK_GRANTED_FULL_REWARD_ZONE_V5 300000 //size of block (bytes) after which reward for block calculated using block size - second change, from v5
#define CRYPTONOTE_LONG_TERM_BLOCK_WEIGHT_WINDOW_SIZE 100000 // size in blocks of the long term block weight median window
#define CRYPTONOTE_SHORT_TERM_BLOCK_WEIGHT_SURGE_FACTOR 50
@ -171,7 +171,7 @@ constexpr uint64_t BLOCKS_EXPECTED_IN_YEARS(int years) { return BLOCKS_EXPECTED_
#define P2P_SUPPORT_FLAG_FLUFFY_BLOCKS 0x01
#define P2P_SUPPORT_FLAGS P2P_SUPPORT_FLAG_FLUFFY_BLOCKS
#define CRYPTONOTE_NAME "loki"
#define CRYPTONOTE_NAME "oxen"
#define CRYPTONOTE_POOLDATA_FILENAME "poolstate.bin"
#define CRYPTONOTE_BLOCKCHAINDATA_FILENAME "data.mdb"
#define CRYPTONOTE_BLOCKCHAINDATA_LOCK_FILENAME "lock.mdb"

View File

@ -36,7 +36,7 @@ add_library(cryptonote_core
service_node_quorum_cop.cpp
service_node_swarm.cpp
tx_blink.cpp
loki_name_system.cpp
oxen_name_system.cpp
tx_pool.cpp
tx_sanity_check.cpp
cryptonote_tx_utils.cpp

View File

@ -296,7 +296,7 @@ uint64_t Blockchain::get_current_blockchain_height(bool lock) const
return m_db->height();
}
//------------------------------------------------------------------
bool Blockchain::load_missing_blocks_into_loki_subsystems()
bool Blockchain::load_missing_blocks_into_oxen_subsystems()
{
uint64_t const snl_height = std::max(m_hardfork->get_earliest_ideal_height_for_version(network_version_9_service_nodes), m_service_node_list.height() + 1);
uint64_t const lns_height = std::max(m_hardfork->get_earliest_ideal_height_for_version(network_version_15_lns), m_lns_db.height() + 1);
@ -306,7 +306,7 @@ bool Blockchain::load_missing_blocks_into_loki_subsystems()
int64_t const total_blocks = static_cast<int64_t>(end_height) - static_cast<int64_t>(start_height);
if (total_blocks <= 0) return true;
if (total_blocks > 1)
MGINFO("Loading blocks into loki subsystems, scanning blockchain from height: " << start_height << " to: " << end_height << " (snl: " << snl_height << ", lns: " << lns_height << ")");
MGINFO("Loading blocks into oxen subsystems, scanning blockchain from height: " << start_height << " to: " << end_height << " (snl: " << snl_height << ", lns: " << lns_height << ")");
using clock = std::chrono::steady_clock;
using work_time = std::chrono::duration<float>;
@ -345,7 +345,7 @@ bool Blockchain::load_missing_blocks_into_loki_subsystems()
uint64_t height = start_height + (index * BLOCK_COUNT);
if (!get_blocks_only(height, static_cast<uint64_t>(BLOCK_COUNT), blocks))
{
LOG_ERROR("Unable to get checkpointed historical blocks for updating loki subsystems");
LOG_ERROR("Unable to get checkpointed historical blocks for updating oxen subsystems");
return false;
}
@ -394,7 +394,7 @@ bool Blockchain::load_missing_blocks_into_loki_subsystems()
if (total_blocks > 1)
{
auto duration = work_time{clock::now() - scan_start};
MGINFO("Done recalculating loki subsystems (" << duration.count() << "s) (snl: " << snl_duration.count() << "s; lns: " << lns_duration.count() << "s)");
MGINFO("Done recalculating oxen subsystems (" << duration.count() << "s) (snl: " << snl_duration.count() << "s; lns: " << lns_duration.count() << "s)");
}
if (total_blocks > 0)
@ -583,9 +583,9 @@ bool Blockchain::init(BlockchainDB* db, sqlite3 *lns_db, const network_type nett
for (InitHook* hook : m_init_hooks)
hook->init();
if (!m_db->is_read_only() && !load_missing_blocks_into_loki_subsystems())
if (!m_db->is_read_only() && !load_missing_blocks_into_oxen_subsystems())
{
MERROR("Failed to load blocks into loki subsystems");
MERROR("Failed to load blocks into oxen subsystems");
return false;
}
@ -711,7 +711,7 @@ void Blockchain::pop_blocks(uint64_t nblocks)
auto split_height = m_db->height();
for (BlockchainDetachedHook* hook : m_blockchain_detached_hooks)
hook->blockchain_detached(split_height, true /*by_pop_blocks*/);
load_missing_blocks_into_loki_subsystems();
load_missing_blocks_into_oxen_subsystems();
if (stop_batch)
m_db->batch_stop();
@ -1035,7 +1035,7 @@ bool Blockchain::rollback_blockchain_switching(const std::list<block_and_checkpo
// Revert all changes from switching to the alt chain before adding the original chain back in
for (BlockchainDetachedHook* hook : m_blockchain_detached_hooks)
hook->blockchain_detached(rollback_height, false /*by_pop_blocks*/);
load_missing_blocks_into_loki_subsystems();
load_missing_blocks_into_oxen_subsystems();
// make sure the hard fork object updates its current version
m_hardfork->reorganize_from_chain_height(rollback_height);
@ -1089,7 +1089,7 @@ bool Blockchain::switch_to_alternative_blockchain(const std::list<block_extended
// pop blocks from the blockchain until the top block is the parent
// of the front block of the alt chain.
std::list<block_and_checkpoint> disconnected_chain; // TODO(loki): use a vector and rbegin(), rend() because we don't have push_front
std::list<block_and_checkpoint> disconnected_chain; // TODO(oxen): use a vector and rbegin(), rend() because we don't have push_front
while (m_db->top_block_hash() != alt_chain.front().bl.prev_id)
{
block_and_checkpoint entry = {};
@ -1101,7 +1101,7 @@ bool Blockchain::switch_to_alternative_blockchain(const std::list<block_extended
auto split_height = m_db->height();
for (BlockchainDetachedHook* hook : m_blockchain_detached_hooks)
hook->blockchain_detached(split_height, false /*by_pop_blocks*/);
load_missing_blocks_into_loki_subsystems();
load_missing_blocks_into_oxen_subsystems();
//connecting new alternative chain
for(auto alt_ch_iter = alt_chain.begin(); alt_ch_iter != alt_chain.end(); alt_ch_iter++)
@ -1340,7 +1340,7 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl
}
uint64_t height = cryptonote::get_block_height(b);
loki_block_reward_context block_reward_context = {};
oxen_block_reward_context block_reward_context = {};
block_reward_context.fee = fee;
block_reward_context.height = height;
block_reward_context.testnet_override = nettype() == TESTNET && height < 386000;
@ -1351,7 +1351,7 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl
}
block_reward_parts reward_parts;
if (!get_loki_block_reward(median_weight, cumulative_block_weight, already_generated_coins, version, reward_parts, block_reward_context))
if (!get_oxen_block_reward(median_weight, cumulative_block_weight, already_generated_coins, version, reward_parts, block_reward_context))
{
MERROR_VER("block weight " << cumulative_block_weight << " is bigger than allowed for this blockchain");
return false;
@ -1390,7 +1390,7 @@ bool Blockchain::validate_miner_transaction(const block& b, size_t cumulative_bl
}
// +1 here to allow a 1 atomic unit error in the calculation (which can happen because of floating point errors or rounding)
// TODO(loki): eliminate all floating point math in reward calculations.
// TODO(oxen): eliminate all floating point math in reward calculations.
uint64_t max_base_reward = reward_parts.base_miner + reward_parts.governance_paid + reward_parts.service_node_total + 1;
uint64_t max_money_in_use = max_base_reward + reward_parts.miner_fee;
if (money_in_use > max_money_in_use)
@ -1610,8 +1610,8 @@ bool Blockchain::create_block_template_internal(block& b, const crypto::hash *fr
uint8_t hf_version = b.major_version;
auto miner_tx_context =
info.is_miner
? loki_miner_tx_context::miner_block(m_nettype, info.miner_address, m_service_node_list.get_block_leader())
: loki_miner_tx_context::pulse_block(m_nettype, info.service_node_payout, m_service_node_list.get_block_leader());
? oxen_miner_tx_context::miner_block(m_nettype, info.miner_address, m_service_node_list.get_block_leader())
: oxen_miner_tx_context::pulse_block(m_nettype, info.service_node_payout, m_service_node_list.get_block_leader());
if (!calc_batched_governance_reward(height, miner_tx_context.batched_governance))
{
LOG_ERROR("Failed to calculate batched governance reward");
@ -2475,7 +2475,7 @@ void Blockchain::get_output_key_mask_unlocked(const uint64_t& amount, const uint
//------------------------------------------------------------------
bool Blockchain::get_output_distribution(uint64_t amount, uint64_t from_height, uint64_t to_height, uint64_t &start_height, std::vector<uint64_t> &distribution, uint64_t &base) const
{
// rct outputs don't exist before v4, NOTE(loki): we started from v7 so our start is always 0
// rct outputs don't exist before v4, NOTE(oxen): we started from v7 so our start is always 0
start_height = 0;
base = 0;
@ -3048,12 +3048,12 @@ bool Blockchain::check_tx_outputs(const transaction& tx, tx_verification_context
std::unique_lock lock{*this};
for (const auto &o: tx.vout) {
if (o.amount != 0) { // in a v2 tx, all outputs must have 0 amount NOTE(loki): All loki tx's are atleast v2 from the beginning
if (o.amount != 0) { // in a v2 tx, all outputs must have 0 amount NOTE(oxen): All oxen tx's are atleast v2 from the beginning
tvc.m_invalid_output = true;
return false;
}
// from hardfork v4, forbid invalid pubkeys NOTE(loki): We started from hf7 so always execute branch
// from hardfork v4, forbid invalid pubkeys NOTE(oxen): We started from hf7 so always execute branch
if (auto* out_to_key = std::get_if<txout_to_key>(&o.target); out_to_key && !crypto::check_key(out_to_key->key)) {
tvc.m_invalid_output = true;
return false;
@ -3085,7 +3085,7 @@ bool Blockchain::check_tx_outputs(const transaction& tx, tx_verification_context
uint64_t curr_height = this->get_current_blockchain_height();
if (curr_height == hf10_height)
{
// NOTE(loki): Allow the hardforking block to contain a borromean proof
// NOTE(oxen): Allow the hardforking block to contain a borromean proof
// incase there were some transactions in the TX Pool that were
// generated pre-HF10 rules. Note, this isn't bulletproof. If there were
// more than 1 blocks worth of borromean proof TX's sitting in the pool
@ -3274,7 +3274,7 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc,
if (tx.is_transfer())
{
if (tx.type != txtype::loki_name_system && hf_version >= HF_VERSION_MIN_2_OUTPUTS && tx.vout.size() < 2)
if (tx.type != txtype::oxen_name_system && hf_version >= HF_VERSION_MIN_2_OUTPUTS && tx.vout.size() < 2)
{
MERROR_VER("Tx " << get_transaction_hash(tx) << " has fewer than two outputs, which is not allowed as of hardfork " << +HF_VERSION_MIN_2_OUTPUTS);
tvc.m_too_few_outputs = true;
@ -3537,9 +3537,9 @@ bool Blockchain::check_tx_inputs(transaction& tx, tx_verification_context &tvc,
}
}
if (tx.type == txtype::loki_name_system)
if (tx.type == txtype::oxen_name_system)
{
cryptonote::tx_extra_loki_name_system data;
cryptonote::tx_extra_oxen_name_system data;
std::string fail_reason;
if (!m_lns_db.validate_lns_tx(hf_version, get_current_blockchain_height(), tx, data, &fail_reason))
{
@ -4008,7 +4008,7 @@ Blockchain::block_pow_verified Blockchain::verify_block_pow(cryptonote::block co
crypto::hash const blk_hash = cryptonote::get_block_hash(blk);
uint64_t const blk_height = cryptonote::get_block_height(blk);
// There is a difficulty bug in lokid that caused a network disagreement at height 526483 where
// There is a difficulty bug in oxend that caused a network disagreement at height 526483 where
// somewhere around half the network had a slightly-too-high difficulty value and accepted the
// block while nodes with the correct difficulty value rejected it. However this not-quite-enough
// difficulty chain had enough of the network following it that it got checkpointed several times
@ -4421,14 +4421,14 @@ bool Blockchain::handle_block_to_main_chain(const block& bl, const crypto::hash&
MGINFO_RED("Blocks that failed verification should not reach here");
}
auto abort_block = loki::defer([&]() {
auto abort_block = oxen::defer([&]() {
pop_block_from_blockchain();
auto old_height = m_db->height();
for (BlockchainDetachedHook* hook : m_blockchain_detached_hooks)
hook->blockchain_detached(old_height, false /*by_pop_blocks*/);
});
// TODO(loki): Not nice, making the hook take in a vector of pair<transaction,
// TODO(oxen): Not nice, making the hook take in a vector of pair<transaction,
// blobdata> messes with service_node_list::init which only constructs
// a vector of transactions and then subsequently calls block_added, so the
// init step would have to intentionally allocate the blobs or retrieve them

View File

@ -63,7 +63,7 @@
#include "checkpoints/checkpoints.h"
#include "cryptonote_basic/hardfork.h"
#include "blockchain_db/blockchain_db.h"
#include "cryptonote_core/loki_name_system.h"
#include "cryptonote_core/oxen_name_system.h"
#include "pulse.h"
struct sqlite3;
@ -1113,7 +1113,7 @@ namespace cryptonote
bool create_block_template_internal(block& b, const crypto::hash *from_block, block_template_info const &info, difficulty_type& di, uint64_t& height, uint64_t& expected_reward, const blobdata& ex_nonce);
bool load_missing_blocks_into_loki_subsystems();
bool load_missing_blocks_into_oxen_subsystems();
// TODO: evaluate whether or not each of these typedefs are left over from blockchain_storage
typedef std::unordered_set<crypto::key_image> key_images_container;

View File

@ -69,7 +69,7 @@ extern "C" {
#include "common/i18n.h"
#include "epee/net/local_ip.h"
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "cn"
@ -234,7 +234,7 @@ namespace cryptonote
"block-rate-notify"
, "Run a program when the block rate undergoes large fluctuations. This might "
"be a sign of large amounts of hash rate going on and off the Loki network, "
"or could be a sign that lokid is not properly synchronizing with the network. %t will be replaced "
"or could be a sign that oxend is not properly synchronizing with the network. %t will be replaced "
"by the number of minutes for the observation window, %b by the number of "
"blocks observed within that window, and %e by the number of blocks that was "
"expected in that window."
@ -282,7 +282,7 @@ namespace cryptonote
, m_last_json_checkpoints_update(0)
, m_nettype(UNDEFINED)
, m_last_storage_server_ping(0)
, m_last_lokinet_ping(0)
, m_last_oxennet_ping(0)
, m_pad_transactions(false)
{
m_checkpoints_updating.clear();
@ -349,7 +349,7 @@ namespace cryptonote
command_line::add_arg(desc, arg_pad_transactions);
command_line::add_arg(desc, arg_block_notify);
#if 0 // TODO(loki): Pruning not supported because of Service Node List
#if 0 // TODO(oxen): Pruning not supported because of Service Node List
command_line::add_arg(desc, arg_prune_blockchain);
#endif
command_line::add_arg(desc, arg_reorg_notify);
@ -431,7 +431,7 @@ namespace cryptonote
}
if (!storage_ok) {
MERROR("IMPORTANT: All service node operators are now required to run the loki storage "
MERROR("IMPORTANT: All service node operators are now required to run the oxen storage "
<< "server and provide the public ip and ports on which it can be accessed on the internet.");
return false;
}
@ -527,7 +527,7 @@ namespace cryptonote
}
// Returns a string for systemd status notifications such as:
// Height: 1234567, SN: active, proof: 55m12s, storage: 4m48s, lokinet: 47s
// Height: 1234567, SN: active, proof: 55m12s, storage: 4m48s, oxennet: 47s
std::string core::get_status_string() const
{
std::string s;
@ -562,8 +562,8 @@ namespace cryptonote
s += time_ago_str(now, last_proof);
s += ", storage: ";
s += time_ago_str(now, m_last_storage_server_ping);
s += ", lokinet: ";
s += time_ago_str(now, m_last_lokinet_ping);
s += ", oxennet: ";
s += time_ago_str(now, m_last_oxennet_ping);
}
}
return s;
@ -824,7 +824,7 @@ namespace cryptonote
// Checkpoints
m_checkpoints_path = m_config_folder / fs::u8path(JSON_HASH_FILE_NAME);
sqlite3 *lns_db = lns::init_loki_name_system(lns_db_file_path, db->is_read_only());
sqlite3 *lns_db = lns::init_oxen_name_system(lns_db_file_path, db->is_read_only());
if (!lns_db) return false;
init_lokimq(vm);
@ -983,7 +983,7 @@ namespace cryptonote
MGINFO_YELLOW("- primary: " << tools::type_to_hex(keys.pub));
MGINFO_YELLOW("- ed25519: " << tools::type_to_hex(keys.pub_ed25519));
// .snode address is the ed25519 pubkey, encoded with base32z and with .snode appended:
MGINFO_YELLOW("- lokinet: " << lokimq::to_base32z(tools::view_guts(keys.pub_ed25519)) << ".snode");
MGINFO_YELLOW("- oxennet: " << lokimq::to_base32z(tools::view_guts(keys.pub_ed25519)) << ".snode");
MGINFO_YELLOW("- x25519: " << tools::type_to_hex(keys.pub_x25519));
} else {
// Only print the x25519 version because it's the only thing useful for a non-SN (for
@ -1749,7 +1749,7 @@ namespace cryptonote
if (count == 0)
return result;
auto& [emission_amount, total_fee_amount, burnt_loki] = result;
auto& [emission_amount, total_fee_amount, burnt_oxen] = result;
// Caching.
//
@ -1774,7 +1774,7 @@ namespace cryptonote
if (count >= m_coinbase_cache.height) {
emission_amount = m_coinbase_cache.emissions;
total_fee_amount = m_coinbase_cache.fees;
burnt_loki = m_coinbase_cache.burnt;
burnt_oxen = m_coinbase_cache.burnt;
start_offset = m_coinbase_cache.height;
count -= m_coinbase_cache.height;
}
@ -1804,7 +1804,7 @@ namespace cryptonote
// The cache is updated and we can still use it, so update our variables.
emission_amount = m_coinbase_cache.emissions;
total_fee_amount = m_coinbase_cache.fees;
burnt_loki = m_coinbase_cache.burnt;
burnt_oxen = m_coinbase_cache.burnt;
count -= m_coinbase_cache.height - start_offset;
start_offset = m_coinbase_cache.height;
}
@ -1820,7 +1820,7 @@ namespace cryptonote
const uint64_t end = start_offset + count - 1;
m_blockchain_storage.for_blocks_range(start_offset, end,
[this, &cache_to, &result, &cache_build_started](uint64_t height, const crypto::hash& hash, const block& b){
auto& [emission_amount, total_fee_amount, burnt_loki] = result;
auto& [emission_amount, total_fee_amount, burnt_oxen] = result;
std::vector<transaction> txs;
std::vector<crypto::hash> missed_txs;
uint64_t coinbase_amount = get_outs_money_amount(b.miner_tx);
@ -1831,7 +1831,7 @@ namespace cryptonote
tx_fee_amount += get_tx_miner_fee(tx, b.major_version >= HF_VERSION_FEE_BURNING);
if(b.major_version >= HF_VERSION_FEE_BURNING)
{
burnt_loki += get_burned_amount_from_tx_extra(tx.extra);
burnt_oxen += get_burned_amount_from_tx_extra(tx.extra);
}
}
@ -1845,7 +1845,7 @@ namespace cryptonote
m_coinbase_cache.height = height;
m_coinbase_cache.emissions = emission_amount;
m_coinbase_cache.fees = total_fee_amount;
m_coinbase_cache.burnt = burnt_loki;
m_coinbase_cache.burnt = burnt_oxen;
}
if (m_coinbase_cache.building)
{
@ -2213,7 +2213,7 @@ namespace cryptonote
void core::update_lmq_sns()
{
// TODO: let callers (e.g. lokinet, ss) subscribe to callbacks when this fires
// TODO: let callers (e.g. oxennet, ss) subscribe to callbacks when this fires
lokimq::pubkey_set active_sns;
m_service_node_list.copy_active_x25519_pubkeys(std::inserter(active_sns, active_sns.end()));
m_lmq->set_active_sns(std::move(active_sns));
@ -2321,10 +2321,10 @@ namespace cryptonote
"is running! It is required to run alongside the Loki daemon");
return;
}
if (!check_external_ping(m_last_lokinet_ping, LOKINET_PING_LIFETIME, "Lokinet"))
if (!check_external_ping(m_last_oxennet_ping, LOKINET_PING_LIFETIME, "Lokinet"))
{
MGINFO_RED(
"Failed to submit uptime proof: have not heard from lokinet recently. Make sure that it "
"Failed to submit uptime proof: have not heard from oxennet recently. Make sure that it "
"is running! It is required to run alongside the Loki daemon");
return;
}

View File

@ -56,7 +56,7 @@
PUSH_WARNINGS
DISABLE_VS_WARNINGS(4355)
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
namespace cryptonote
{
struct test_options {
@ -1008,8 +1008,8 @@ namespace cryptonote
*/
bool set_storage_server_peer_reachable(crypto::public_key const &pubkey, bool value);
/// Time point at which the storage server and lokinet last pinged us
std::atomic<time_t> m_last_storage_server_ping, m_last_lokinet_ping;
/// Time point at which the storage server and oxennet last pinged us
std::atomic<time_t> m_last_storage_server_ping, m_last_oxennet_ping;
std::atomic<uint16_t> m_storage_lmq_port;
uint32_t sn_public_ip() const { return m_sn_public_ip; }
@ -1024,7 +1024,7 @@ namespace cryptonote
bool relay_txpool_transactions();
/**
* @brief returns the lokid config directory
* @brief returns the oxend config directory
*/
const fs::path& get_config_directory() const { return m_config_folder; }

View File

@ -262,7 +262,7 @@ namespace cryptonote
size_t current_block_weight,
uint64_t fee,
transaction& tx,
const loki_miner_tx_context &miner_tx_context,
const oxen_miner_tx_context &miner_tx_context,
const blobdata& extra_nonce,
uint8_t hard_fork_version)
{
@ -294,13 +294,13 @@ namespace cryptonote
block_reward_parts reward_parts = {};
{
loki_block_reward_context block_reward_context = {};
oxen_block_reward_context block_reward_context = {};
block_reward_context.fee = fee;
block_reward_context.height = height;
block_reward_context.block_leader_payouts = miner_tx_context.block_leader.payouts;
block_reward_context.batched_governance = miner_tx_context.batched_governance;
if(!get_loki_block_reward(median_weight, current_block_weight, already_generated_coins, hard_fork_version, reward_parts, block_reward_context))
if(!get_oxen_block_reward(median_weight, current_block_weight, already_generated_coins, hard_fork_version, reward_parts, block_reward_context))
{
LOG_PRINT_L0("Failed to calculate block reward");
return false;
@ -493,11 +493,11 @@ namespace cryptonote
return true;
}
bool get_loki_block_reward(size_t median_weight, size_t current_block_weight, uint64_t already_generated_coins, int hard_fork_version, block_reward_parts &result, const loki_block_reward_context &loki_context)
bool get_oxen_block_reward(size_t median_weight, size_t current_block_weight, uint64_t already_generated_coins, int hard_fork_version, block_reward_parts &result, const oxen_block_reward_context &oxen_context)
{
result = {};
uint64_t base_reward, base_reward_unpenalized;
if (!get_base_block_reward(median_weight, current_block_weight, already_generated_coins, base_reward, base_reward_unpenalized, hard_fork_version, loki_context.height))
if (!get_base_block_reward(median_weight, current_block_weight, already_generated_coins, base_reward, base_reward_unpenalized, hard_fork_version, oxen_context.height))
{
MERROR("Failed to calculate base block reward");
return false;
@ -525,33 +525,33 @@ namespace cryptonote
// accumulated payments. (Before hardfork 10 they are included in every block, unbatched).
result.governance_due = governance_reward_formula(result.original_base_reward, hard_fork_version);
result.governance_paid = hard_fork_version >= network_version_10_bulletproofs
? loki_context.batched_governance
? oxen_context.batched_governance
: result.governance_due;
uint64_t const service_node_reward = service_node_reward_formula(result.original_base_reward, hard_fork_version);
if (hard_fork_version < cryptonote::network_version_16_pulse)
{
result.service_node_total = calculate_sum_of_portions(loki_context.block_leader_payouts, service_node_reward);
result.service_node_total = calculate_sum_of_portions(oxen_context.block_leader_payouts, service_node_reward);
// The base_miner amount is everything left in the base reward after subtracting off the service
// node and governance fee amounts (the due amount in the latter case). (Any penalty for
// exceeding the block limit is already removed from base_reward).
uint64_t non_miner_amounts = result.governance_due + result.service_node_total;
result.base_miner = base_reward > non_miner_amounts ? base_reward - non_miner_amounts : 0;
result.miner_fee = loki_context.fee;
result.miner_fee = oxen_context.fee;
}
else
{
result.service_node_total = service_node_reward;
if (loki_context.testnet_override)
if (oxen_context.testnet_override)
{
result.miner_fee = loki_context.fee;
result.miner_fee = oxen_context.fee;
}
else
{
uint64_t const penalty = base_reward_unpenalized - base_reward;
result.miner_fee = penalty >= loki_context.fee ? 0 : loki_context.fee - penalty;
result.miner_fee = penalty >= oxen_context.fee ? 0 : oxen_context.fee - penalty;
}
// In HF16, the block producer changes between the Miner and Service Node
@ -568,7 +568,7 @@ namespace cryptonote
if (allocated > base_reward_unpenalized)
MERROR("We allocated more reward " << cryptonote::print_money(allocated) << " than what was available " << cryptonote::print_money(base_reward_unpenalized));
else
MERROR("We allocated reward but there was still " << cryptonote::print_money(remainder) << " loki left to distribute.");
MERROR("We allocated reward but there was still " << cryptonote::print_money(remainder) << " oxen left to distribute.");
return false;
}
}
@ -602,7 +602,7 @@ namespace cryptonote
return addr.m_view_public_key;
}
//---------------------------------------------------------------
bool construct_tx_with_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const std::optional<tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, const rct::RCTConfig &rct_config, rct::multisig_out *msout, bool shuffle_outs, loki_construct_tx_params const &tx_params)
bool construct_tx_with_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const std::optional<tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, const rct::RCTConfig &rct_config, rct::multisig_out *msout, bool shuffle_outs, oxen_construct_tx_params const &tx_params)
{
hw::device &hwdev = sender_account_keys.get_device();
@ -855,8 +855,8 @@ namespace cryptonote
if (tx.type == txtype::stake)
{
CHECK_AND_ASSERT_MES(dst_entr.addr == sender_account_keys.m_account_address, false, "A staking contribution must return back to the original sendee otherwise the pre-calculated key image is incorrect");
CHECK_AND_ASSERT_MES(dst_entr.is_subaddress == false, false, "Staking back to a subaddress is not allowed"); // TODO(loki): Maybe one day, revisit this
CHECK_AND_ASSERT_MES(need_additional_txkeys == false, false, "Staking TX's can not required additional TX Keys"); // TODO(loki): Maybe one day, revisit this
CHECK_AND_ASSERT_MES(dst_entr.is_subaddress == false, false, "Staking back to a subaddress is not allowed"); // TODO(oxen): Maybe one day, revisit this
CHECK_AND_ASSERT_MES(need_additional_txkeys == false, false, "Staking TX's can not required additional TX Keys"); // TODO(oxen): Maybe one day, revisit this
if (!(change_addr && *change_addr == dst_entr))
{
@ -1004,7 +1004,7 @@ namespace cryptonote
return true;
}
//---------------------------------------------------------------
bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys, const rct::RCTConfig &rct_config, rct::multisig_out *msout, loki_construct_tx_params const &tx_params)
bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys, const rct::RCTConfig &rct_config, rct::multisig_out *msout, oxen_construct_tx_params const &tx_params)
{
hw::device &hwdev = sender_account_keys.get_device();
hwdev.open_tx(tx_key, transaction::get_max_version_for_hf(tx_params.hf_version), tx_params.tx_type);
@ -1031,7 +1031,7 @@ namespace cryptonote
}
}
//---------------------------------------------------------------
bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry> &sources, const std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const loki_construct_tx_params &tx_params)
bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry> &sources, const std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const oxen_construct_tx_params &tx_params)
{
std::unordered_map<crypto::public_key, cryptonote::subaddress_index> subaddresses;
subaddresses[sender_account_keys.m_account_address.m_spend_public_key] = {0,0};

View File

@ -51,24 +51,24 @@ namespace cryptonote
uint64_t get_portion_of_reward (uint64_t portions, uint64_t total_service_node_reward);
uint64_t service_node_reward_formula (uint64_t base_reward, uint8_t hard_fork_version);
struct loki_miner_tx_context
struct oxen_miner_tx_context
{
static loki_miner_tx_context miner_block(network_type nettype,
static oxen_miner_tx_context miner_block(network_type nettype,
cryptonote::account_public_address const &block_producer,
service_nodes::payout const &block_leader = service_nodes::null_payout)
{
loki_miner_tx_context result = {};
oxen_miner_tx_context result = {};
result.nettype = nettype;
result.miner_block_producer = block_producer;
result.block_leader = block_leader;
return result;
}
static loki_miner_tx_context pulse_block(network_type nettype,
static oxen_miner_tx_context pulse_block(network_type nettype,
service_nodes::payout const &block_producer,
service_nodes::payout const &block_leader = service_nodes::null_payout)
{
loki_miner_tx_context result = {};
oxen_miner_tx_context result = {};
result.pulse = true;
result.nettype = nettype;
result.pulse_block_producer = block_producer;
@ -93,7 +93,7 @@ namespace cryptonote
size_t current_block_weight,
uint64_t fee,
transaction& tx,
const loki_miner_tx_context &miner_context,
const oxen_miner_tx_context &miner_context,
const blobdata& extra_nonce = blobdata(),
uint8_t hard_fork_version = 1);
@ -113,7 +113,7 @@ namespace cryptonote
uint64_t original_base_reward;
};
struct loki_block_reward_context
struct oxen_block_reward_context
{
using portions = uint64_t;
bool testnet_override;
@ -123,12 +123,12 @@ namespace cryptonote
std::vector<service_nodes::payout_entry> block_leader_payouts = {service_nodes::null_payout_entry};
};
// NOTE(loki): I would combine this into get_base_block_reward, but
// NOTE(oxen): I would combine this into get_base_block_reward, but
// cryptonote_basic as a library is to be able to trivially link with
// cryptonote_core since it would have a circular dependency on Blockchain
// NOTE: Block reward function that should be called after hard fork v10
bool get_loki_block_reward(size_t median_weight, size_t current_block_weight, uint64_t already_generated_coins, int hard_fork_version, block_reward_parts &result, const loki_block_reward_context &loki_context);
bool get_oxen_block_reward(size_t median_weight, size_t current_block_weight, uint64_t already_generated_coins, int hard_fork_version, block_reward_parts &result, const oxen_block_reward_context &oxen_context);
struct tx_source_entry
{
@ -203,7 +203,7 @@ namespace cryptonote
END_SERIALIZE()
};
struct loki_construct_tx_params
struct oxen_construct_tx_params
{
uint8_t hf_version = cryptonote::network_version_7;
txtype tx_type = txtype::standard;
@ -222,9 +222,9 @@ namespace cryptonote
//---------------------------------------------------------------
crypto::public_key get_destination_view_key_pub(const std::vector<tx_destination_entry> &destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr);
bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry> &sources, const std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const loki_construct_tx_params &tx_params = {});
bool construct_tx_with_tx_key (const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, const rct::RCTConfig &rct_config, rct::multisig_out *msout = NULL, bool shuffle_outs = true, loki_construct_tx_params const &tx_params = {});
bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys, const rct::RCTConfig &rct_config, rct::multisig_out *msout = NULL, loki_construct_tx_params const &tx_params = {});
bool construct_tx(const account_keys& sender_account_keys, std::vector<tx_source_entry> &sources, const std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const oxen_construct_tx_params &tx_params = {});
bool construct_tx_with_tx_key (const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, const crypto::secret_key &tx_key, const std::vector<crypto::secret_key> &additional_tx_keys, const rct::RCTConfig &rct_config, rct::multisig_out *msout = NULL, bool shuffle_outs = true, oxen_construct_tx_params const &tx_params = {});
bool construct_tx_and_get_tx_key(const account_keys& sender_account_keys, const std::unordered_map<crypto::public_key, subaddress_index>& subaddresses, std::vector<tx_source_entry>& sources, std::vector<tx_destination_entry>& destinations, const std::optional<cryptonote::tx_destination_entry>& change_addr, const std::vector<uint8_t> &extra, transaction& tx, uint64_t unlock_time, crypto::secret_key &tx_key, std::vector<crypto::secret_key> &additional_tx_keys, const rct::RCTConfig &rct_config, rct::multisig_out *msout = NULL, oxen_construct_tx_params const &tx_params = {});
bool generate_output_ephemeral_keys(const size_t tx_version, bool &found_change,
const cryptonote::account_keys &sender_account_keys, const crypto::public_key &txkey_pub, const crypto::secret_key &tx_key,
const cryptonote::tx_destination_entry &dst_entr, const std::optional<cryptonote::tx_destination_entry> &change_addr, const size_t output_index,

View File

@ -1,9 +1,9 @@
#include <bitset>
#include <variant>
#include "common/hex.h"
#include "loki_name_system.h"
#include "oxen_name_system.h"
#include "common/loki.h"
#include "common/oxen.h"
#include "common/string_util.h"
#include "crypto/hash.h"
#include "cryptonote_basic/cryptonote_basic.h"
@ -11,7 +11,7 @@
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "cryptonote_basic/tx_extra.h"
#include "cryptonote_core/blockchain.h"
#include "loki_economy.h"
#include "oxen_economy.h"
#include <lokimq/hex.h>
#include <lokimq/base32z.h>
@ -103,9 +103,9 @@ std::pair<std::basic_string_view<unsigned char>, std::basic_string_view<unsigned
std::string lns::mapping_value::to_readable_value(cryptonote::network_type nettype, lns::mapping_type type) const
{
std::string result;
if (is_lokinet_type(type))
if (is_oxennet_type(type))
{
result = lokimq::to_base32z(to_view()) + ".loki";
result = lokimq::to_base32z(to_view()) + ".oxen";
}
else if (type == lns::mapping_type::wallet)
{
@ -128,7 +128,7 @@ std::string lns::mapping_value::to_readable_value(cryptonote::network_type netty
namespace {
std::string lns_extra_string(cryptonote::network_type nettype, cryptonote::tx_extra_loki_name_system const &data)
std::string lns_extra_string(cryptonote::network_type nettype, cryptonote::tx_extra_oxen_name_system const &data)
{
std::stringstream stream;
stream << "LNS Extra={";
@ -555,7 +555,7 @@ sql_compiled_statement::~sql_compiled_statement()
sqlite3_finalize(statement);
}
sqlite3 *init_loki_name_system(const fs::path& file_path, bool read_only)
sqlite3 *init_oxen_name_system(const fs::path& file_path, bool read_only)
{
sqlite3 *result = nullptr;
int sql_init = sqlite3_initialize();
@ -611,23 +611,23 @@ std::vector<mapping_type> all_mapping_types(uint8_t hf_version) {
if (hf_version >= cryptonote::network_version_15_lns)
result.push_back(mapping_type::session);
if (hf_version >= cryptonote::network_version_16_pulse)
result.push_back(mapping_type::lokinet);
result.push_back(mapping_type::oxennet);
return result;
}
std::optional<uint64_t> expiry_blocks(cryptonote::network_type nettype, mapping_type type)
{
std::optional<uint64_t> result;
if (is_lokinet_type(type))
if (is_oxennet_type(type))
{
// For testnet we shorten 1-, 2-, and 5-year renewals to 1/2/5 days with 1-day renewal, but
// leave 10 years alone to allow long-term registrations on testnet.
const bool testnet_short = nettype == cryptonote::TESTNET && type != mapping_type::lokinet_10years;
const bool testnet_short = nettype == cryptonote::TESTNET && type != mapping_type::oxennet_10years;
if (type == mapping_type::lokinet) result = BLOCKS_EXPECTED_IN_DAYS(1 * REGISTRATION_YEAR_DAYS);
else if (type == mapping_type::lokinet_2years) result = BLOCKS_EXPECTED_IN_DAYS(2 * REGISTRATION_YEAR_DAYS);
else if (type == mapping_type::lokinet_5years) result = BLOCKS_EXPECTED_IN_DAYS(5 * REGISTRATION_YEAR_DAYS);
else if (type == mapping_type::lokinet_10years) result = BLOCKS_EXPECTED_IN_DAYS(10 * REGISTRATION_YEAR_DAYS);
if (type == mapping_type::oxennet) result = BLOCKS_EXPECTED_IN_DAYS(1 * REGISTRATION_YEAR_DAYS);
else if (type == mapping_type::oxennet_2years) result = BLOCKS_EXPECTED_IN_DAYS(2 * REGISTRATION_YEAR_DAYS);
else if (type == mapping_type::oxennet_5years) result = BLOCKS_EXPECTED_IN_DAYS(5 * REGISTRATION_YEAR_DAYS);
else if (type == mapping_type::oxennet_10years) result = BLOCKS_EXPECTED_IN_DAYS(10 * REGISTRATION_YEAR_DAYS);
assert(result);
if (testnet_short)
@ -744,10 +744,10 @@ static bool check_condition(bool condition, std::string* reason, T&&... args) {
bool validate_lns_name(mapping_type type, std::string name, std::string *reason)
{
bool const is_lokinet = is_lokinet_type(type);
bool const is_oxennet = is_oxennet_type(type);
size_t max_name_len = 0;
if (is_lokinet)
if (is_oxennet)
max_name_len = name.find('-') != std::string::npos
? LOKINET_DOMAIN_NAME_MAX
: LOKINET_DOMAIN_NAME_MAX_NOHYPHEN;
@ -772,37 +772,37 @@ bool validate_lns_name(mapping_type type, std::string name, std::string *reason)
std::string_view name_view{name}; // Will chop this down as we validate each part
// NOTE: Validate domain specific requirements
if (is_lokinet)
if (is_oxennet)
{
// LOKINET
// Domain has to start with an alphanumeric, and can have (alphanumeric or hyphens) in between, the character before the suffix <char>'.loki' must be alphanumeric followed by the suffix '.loki'
// Domain has to start with an alphanumeric, and can have (alphanumeric or hyphens) in between, the character before the suffix <char>'.oxen' must be alphanumeric followed by the suffix '.oxen'
// It's *approximately* this regex, but there are some extra restrictions below
// ^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.loki$
// ^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.oxen$
// Reserved names:
// - localhost.loki has special meaning within lokinet (it is always a CNAME to the local
// - localhost.oxen has special meaning within oxennet (it is always a CNAME to the local
// address)
// - loki.loki and snode.loki are prohibited in case someone added .loki or .snode as search
// domains (in which case the user looking up "foo.loki" would try end up trying to resolve
// "foo.loki.loki").
for (auto& reserved : {"localhost.loki"sv, "loki.loki"sv, "snode.loki"sv})
// - oxen.oxen and snode.oxen are prohibited in case someone added .oxen or .snode as search
// domains (in which case the user looking up "foo.oxen" would try end up trying to resolve
// "foo.oxen.oxen").
for (auto& reserved : {"localhost.oxen"sv, "oxen.oxen"sv, "snode.oxen"sv})
if (check_condition(name == reserved, reason, "LNS type=", type, ", specifies mapping from name->value using protocol reserved name=", name))
return false;
auto constexpr SHORTEST_DOMAIN = "a.loki"sv;
auto constexpr SHORTEST_DOMAIN = "a.oxen"sv;
if (check_condition(name.size() < SHORTEST_DOMAIN.size(), reason, "LNS type=", type, ", specifies mapping from name->value where the name is shorter than the shortest possible name=", SHORTEST_DOMAIN, ", given name=", name))
return false;
// Must end with .loki
auto constexpr SUFFIX = ".loki"sv;
if (check_condition(!tools::ends_with(name_view, SUFFIX), reason, "LNS type=", type, ", specifies mapping from name->value where the name does not end with the domain .loki, name=", name))
// Must end with .oxen
auto constexpr SUFFIX = ".oxen"sv;
if (check_condition(!tools::ends_with(name_view, SUFFIX), reason, "LNS type=", type, ", specifies mapping from name->value where the name does not end with the domain .oxen, name=", name))
return false;
name_view.remove_suffix(SUFFIX.size());
// All domains containing '--' as 3rd/4th letter are reserved except for xn-- punycode domains
if (check_condition(name_view.size() >= 4 && name_view.substr(2, 2) == "--"sv && !tools::starts_with(name_view, "xn--"sv),
reason, "LNS type=", type, ", specifies reserved name `?\?--*.loki': ", name))
reason, "LNS type=", type, ", specifies reserved name `?\?--*.oxen': ", name))
return false;
// Must start with alphanumeric
@ -812,8 +812,8 @@ bool validate_lns_name(mapping_type type, std::string name, std::string *reason)
name_view.remove_prefix(1);
if (!name_view.empty()) {
// Character preceding .loki must be alphanumeric
if (check_condition(!char_is_alphanum(name_view.back()), reason, "LNS type=", type ,", specifies mapping from name->value where the character preceding the .loki is not alphanumeric, char=", name_view.back(), ", name=", name))
// Character preceding .oxen must be alphanumeric
if (check_condition(!char_is_alphanum(name_view.back()), reason, "LNS type=", type ,", specifies mapping from name->value where the character preceding the .oxen is not alphanumeric, char=", name_view.back(), ", name=", name))
return false;
name_view.remove_suffix(1);
}
@ -907,13 +907,13 @@ bool mapping_value::validate(cryptonote::network_type nettype, mapping_type type
std::memcpy(blob->buffer.data(), &addr_info, blob->len);
}
}
else if (is_lokinet_type(type))
else if (is_oxennet_type(type))
{
// We need a 52 char base32z string that decodes to a 32-byte value, which really means we need
// 51 base32z chars (=255 bits) followed by a 1-bit value ('y'=0, or 'o'=0b10000); anything else
// in the last spot isn't a valid lokinet address.
if (check_condition(value.size() != 57 || !tools::ends_with(value, ".loki") || !lokimq::is_base32z(value.substr(0, 52)) || !(value[51] == 'y' || value[51] == 'o'),
reason, "'", value, "' is not a valid lokinet address"))
// in the last spot isn't a valid oxennet address.
if (check_condition(value.size() != 57 || !tools::ends_with(value, ".oxen") || !lokimq::is_base32z(value.substr(0, 52)) || !(value[51] == 'y' || value[51] == 'o'),
reason, "'", value, "' is not a valid oxennet address"))
return false;
if (blob)
@ -955,7 +955,7 @@ bool mapping_value::validate_encrypted(mapping_type type, std::string_view value
if (blob) *blob = {};
std::stringstream err_stream;
int value_len = crypto_aead_xchacha20poly1305_ietf_ABYTES + crypto_aead_xchacha20poly1305_ietf_NPUBBYTES;
if (is_lokinet_type(type)) value_len += LOKINET_ADDRESS_BINARY_LENGTH;
if (is_oxennet_type(type)) value_len += LOKINET_ADDRESS_BINARY_LENGTH;
else if (type == mapping_type::wallet) value_len += WALLET_ACCOUNT_BINARY_LENGTH;
else if (type == mapping_type::session)
{
@ -1028,7 +1028,7 @@ static bool verify_lns_signature(crypto::hash const &hash, lns::generic_signatur
}
}
static bool validate_against_previous_mapping(lns::name_system_db &lns_db, uint64_t blockchain_height, cryptonote::transaction const &tx, cryptonote::tx_extra_loki_name_system const &lns_extra, std::string *reason)
static bool validate_against_previous_mapping(lns::name_system_db &lns_db, uint64_t blockchain_height, cryptonote::transaction const &tx, cryptonote::tx_extra_oxen_name_system const &lns_extra, std::string *reason)
{
std::stringstream err_stream;
LOKI_DEFER { if (reason && reason->empty()) *reason = err_stream.str(); };
@ -1107,16 +1107,16 @@ static bool validate_against_previous_mapping(lns::name_system_db &lns_db, uint6
// Sanity check value to disallow the empty name hash
static const crypto::hash null_name_hash = name_to_hash("");
bool name_system_db::validate_lns_tx(uint8_t hf_version, uint64_t blockchain_height, cryptonote::transaction const &tx, cryptonote::tx_extra_loki_name_system &lns_extra, std::string *reason)
bool name_system_db::validate_lns_tx(uint8_t hf_version, uint64_t blockchain_height, cryptonote::transaction const &tx, cryptonote::tx_extra_oxen_name_system &lns_extra, std::string *reason)
{
// -----------------------------------------------------------------------------------------------
// Pull out LNS Extra from TX
// -----------------------------------------------------------------------------------------------
{
if (check_condition(tx.type != cryptonote::txtype::loki_name_system, reason, tx, ", uses wrong tx type, expected=", cryptonote::txtype::loki_name_system))
if (check_condition(tx.type != cryptonote::txtype::oxen_name_system, reason, tx, ", uses wrong tx type, expected=", cryptonote::txtype::oxen_name_system))
return false;
if (check_condition(!cryptonote::get_field_from_tx_extra(tx.extra, lns_extra), reason, tx, ", didn't have loki name service in the tx_extra"))
if (check_condition(!cryptonote::get_field_from_tx_extra(tx.extra, lns_extra), reason, tx, ", didn't have oxen name service in the tx_extra"))
return false;
}
@ -1190,7 +1190,7 @@ bool name_system_db::validate_lns_tx(uint8_t hf_version, uint64_t blockchain_hei
if (burn != burn_required)
{
char const *over_or_under = burn > burn_required ? "too much " : "insufficient ";
if (check_condition(true, reason, tx, ", ", lns_extra_string(nettype, lns_extra), " burned ", over_or_under, "loki=", burn, ", require=", burn_required))
if (check_condition(true, reason, tx, ", ", lns_extra_string(nettype, lns_extra), " burned ", over_or_under, "oxen=", burn, ", require=", burn_required))
return false;
}
}
@ -1206,28 +1206,28 @@ bool validate_mapping_type(std::string_view mapping_type_str, uint8_t hf_version
mapping_type_ = lns::mapping_type::session;
else if (hf_version >= cryptonote::network_version_16_pulse)
{
if (tools::string_iequal(mapping, "lokinet"))
mapping_type_ = lns::mapping_type::lokinet;
if (tools::string_iequal(mapping, "oxennet"))
mapping_type_ = lns::mapping_type::oxennet;
else if (txtype == lns_tx_type::buy || txtype == lns_tx_type::renew)
{
if (tools::string_iequal_any(mapping, "lokinet_1y", "lokinet_1years")) // Can also specify "lokinet"
mapping_type_ = lns::mapping_type::lokinet;
else if (tools::string_iequal_any(mapping, "lokinet_2y", "lokinet_2years"))
mapping_type_ = lns::mapping_type::lokinet_2years;
else if (tools::string_iequal_any(mapping, "lokinet_5y", "lokinet_5years"))
mapping_type_ = lns::mapping_type::lokinet_5years;
else if (tools::string_iequal_any(mapping, "lokinet_10y", "lokinet_10years"))
mapping_type_ = lns::mapping_type::lokinet_10years;
if (tools::string_iequal_any(mapping, "oxennet_1y", "oxennet_1years")) // Can also specify "oxennet"
mapping_type_ = lns::mapping_type::oxennet;
else if (tools::string_iequal_any(mapping, "oxennet_2y", "oxennet_2years"))
mapping_type_ = lns::mapping_type::oxennet_2years;
else if (tools::string_iequal_any(mapping, "oxennet_5y", "oxennet_5years"))
mapping_type_ = lns::mapping_type::oxennet_5years;
else if (tools::string_iequal_any(mapping, "oxennet_10y", "oxennet_10years"))
mapping_type_ = lns::mapping_type::oxennet_10years;
}
}
if (!mapping_type_)
{
if (reason) *reason = "Unsupported LNS type \"" + std::string{mapping_type_str} + "\"; supported " + (
txtype == lns_tx_type::update ? "update types are: session, lokinet" :
txtype == lns_tx_type::renew ? "renew types are: lokinet_1y, lokinet_2y, lokinet_5y, lokinet_10y" :
txtype == lns_tx_type::buy ? "buy types are session, lokinet_1y, lokinet_2y, lokinet_5y, lokinet_10y"
: "lookup types are session, lokinet");
txtype == lns_tx_type::update ? "update types are: session, oxennet" :
txtype == lns_tx_type::renew ? "renew types are: oxennet_1y, oxennet_2y, oxennet_5y, oxennet_10y" :
txtype == lns_tx_type::buy ? "buy types are session, oxennet_1y, oxennet_2y, oxennet_5y, oxennet_10y"
: "lookup types are session, oxennet");
return false;
}
@ -1383,7 +1383,7 @@ bool mapping_value::decrypt(std::string_view name, mapping_type type, const cryp
{
switch(type) {
case mapping_type::session: dec_length = SESSION_PUBLIC_KEY_BINARY_LENGTH; break;
case mapping_type::lokinet: dec_length = LOKINET_ADDRESS_BINARY_LENGTH; break;
case mapping_type::oxennet: dec_length = LOKINET_ADDRESS_BINARY_LENGTH; break;
case mapping_type::wallet: dec_length = WALLET_ACCOUNT_BINARY_LENGTH; break;
default: MERROR("Invalid mapping_type passed to mapping_value::decrypt"); return false;
}
@ -1807,7 +1807,7 @@ name_system_db::~name_system_db()
namespace {
std::optional<int64_t> add_or_get_owner_id(lns::name_system_db &lns_db, crypto::hash const &tx_hash, cryptonote::tx_extra_loki_name_system const &entry, lns::generic_owner const &key)
std::optional<int64_t> add_or_get_owner_id(lns::name_system_db &lns_db, crypto::hash const &tx_hash, cryptonote::tx_extra_oxen_name_system const &entry, lns::generic_owner const &key)
{
int64_t result = 0;
if (owner_record owner = lns_db.get_owner_by_key(key)) result = owner.id;
@ -1827,7 +1827,7 @@ std::optional<int64_t> add_or_get_owner_id(lns::name_system_db &lns_db, crypto::
// Build a query and bind values that will create a new row at the given height by copying the
// current highest-height row values and/or updating the given update fields.
using update_variant = std::variant<uint16_t, int64_t, uint64_t, blob_view, std::string>;
std::pair<std::string, std::vector<update_variant>> update_record_query(name_system_db& lns_db, uint64_t height, const cryptonote::tx_extra_loki_name_system& entry, const crypto::hash& tx_hash)
std::pair<std::string, std::vector<update_variant>> update_record_query(name_system_db& lns_db, uint64_t height, const cryptonote::tx_extra_oxen_name_system& entry, const crypto::hash& tx_hash)
{
assert(entry.is_updating() || entry.is_renewing());
@ -1903,7 +1903,7 @@ FROM "mappings" WHERE "type" = ? AND "name_hash" = ? ORDER BY "update_height" DE
return result;
}
bool add_lns_entry(lns::name_system_db &lns_db, uint64_t height, cryptonote::tx_extra_loki_name_system const &entry, crypto::hash const &tx_hash)
bool add_lns_entry(lns::name_system_db &lns_db, uint64_t height, cryptonote::tx_extra_oxen_name_system const &entry, crypto::hash const &tx_hash)
{
// -----------------------------------------------------------------------------------------------
// New Mapping Insert or Completely Replace
@ -1983,10 +1983,10 @@ bool name_system_db::add_block(const cryptonote::block &block, const std::vector
{
for (cryptonote::transaction const &tx : txs)
{
if (tx.type != cryptonote::txtype::loki_name_system)
if (tx.type != cryptonote::txtype::oxen_name_system)
continue;
cryptonote::tx_extra_loki_name_system entry = {};
cryptonote::tx_extra_oxen_name_system entry = {};
std::string fail_reason;
if (!validate_lns_tx(block.major_version, height, tx, entry, &fail_reason))
{
@ -2019,11 +2019,11 @@ struct lns_update_history
uint64_t owner_last_update_height = static_cast<uint64_t>(-1);
uint64_t backup_owner_last_update_height = static_cast<uint64_t>(-1);
void update(uint64_t height, cryptonote::tx_extra_loki_name_system const &lns_extra);
void update(uint64_t height, cryptonote::tx_extra_oxen_name_system const &lns_extra);
uint64_t newest_update_height() const;
};
void lns_update_history::update(uint64_t height, cryptonote::tx_extra_loki_name_system const &lns_extra)
void lns_update_history::update(uint64_t height, cryptonote::tx_extra_oxen_name_system const &lns_extra)
{
if (lns_extra.field_is_set(lns::extra_field::encrypted_value))
value_last_update_height = height;
@ -2045,7 +2045,7 @@ struct replay_lns_tx
{
uint64_t height;
crypto::hash tx_hash;
cryptonote::tx_extra_loki_name_system entry;
cryptonote::tx_extra_oxen_name_system entry;
};
void name_system_db::block_detach(cryptonote::Blockchain const &blockchain, uint64_t new_blockchain_height)
@ -2062,7 +2062,7 @@ bool name_system_db::save_owner(lns::generic_owner const &owner, int64_t *row_id
return result;
}
bool name_system_db::save_mapping(crypto::hash const &tx_hash, cryptonote::tx_extra_loki_name_system const &src, uint64_t height, std::optional<uint64_t> expiration, int64_t owner_id, std::optional<int64_t> backup_owner_id)
bool name_system_db::save_mapping(crypto::hash const &tx_hash, cryptonote::tx_extra_oxen_name_system const &src, uint64_t height, std::optional<uint64_t> expiration, int64_t owner_id, std::optional<int64_t> backup_owner_id)
{
if (!src.is_buying())
return false;

View File

@ -19,7 +19,7 @@ struct checkpoint_t;
struct block;
class transaction;
struct account_address;
struct tx_extra_loki_name_system;
struct tx_extra_oxen_name_system;
class Blockchain;
}; // namespace cryptonote
@ -28,8 +28,8 @@ namespace lns
constexpr size_t WALLET_NAME_MAX = 97; // mainnet addresses are 95 but testnet/devnet are 97
constexpr size_t WALLET_ACCOUNT_BINARY_LENGTH = 2 * sizeof(crypto::public_key);
constexpr size_t LOKINET_DOMAIN_NAME_MAX = 63 + 5; // DNS components name must be at most 63 (+ 5 for .loki); this limit applies if there is at least one hyphen (and thus includes punycode)
constexpr size_t LOKINET_DOMAIN_NAME_MAX_NOHYPHEN = 32 + 5; // If the name does not contain a - then we restrict it to 32 characters so that it cannot be (and is obviously not) an encoded .loki address (52 characters)
constexpr size_t LOKINET_DOMAIN_NAME_MAX = 63 + 5; // DNS components name must be at most 63 (+ 5 for .oxen); this limit applies if there is at least one hyphen (and thus includes punycode)
constexpr size_t LOKINET_DOMAIN_NAME_MAX_NOHYPHEN = 32 + 5; // If the name does not contain a - then we restrict it to 32 characters so that it cannot be (and is obviously not) an encoded .oxen address (52 characters)
constexpr size_t LOKINET_ADDRESS_BINARY_LENGTH = sizeof(crypto::ed25519_public_key);
constexpr size_t SESSION_DISPLAY_NAME_MAX = 64;
constexpr size_t SESSION_PUBLIC_KEY_BINARY_LENGTH = 1 + sizeof(crypto::ed25519_public_key); // Session keys at prefixed with 0x05 + ed25519 key
@ -96,7 +96,7 @@ struct mapping_value
// Validate a human readable mapping value representation in 'value' and write the binary form into 'blob'.
// value: if type is session, 66 character hex string of an ed25519 public key (with 05 prefix)
// lokinet, 52 character base32z string of an ed25519 public key
// oxennet, 52 character base32z string of an ed25519 public key
// wallet, the wallet public address string
// blob: (optional) if function returns true, validate will load the binary data into blob (ready for encryption via encrypt())
static bool validate(cryptonote::network_type nettype, mapping_type type, std::string_view value, mapping_value *blob = nullptr, std::string *reason = nullptr);
@ -110,10 +110,10 @@ inline std::string_view mapping_type_str(mapping_type type)
{
switch(type)
{
case mapping_type::lokinet: return "lokinet"sv; // general type stored in the database; 1 year when in a purchase tx
case mapping_type::lokinet_2years: return "lokinet_2years"sv; // Only used in a buy tx, not in the DB
case mapping_type::lokinet_5years: return "lokinet_5years"sv; // "
case mapping_type::lokinet_10years: return "lokinet_10years"sv; // "
case mapping_type::oxennet: return "oxennet"sv; // general type stored in the database; 1 year when in a purchase tx
case mapping_type::oxennet_2years: return "oxennet_2years"sv; // Only used in a buy tx, not in the DB
case mapping_type::oxennet_5years: return "oxennet_5years"sv; // "
case mapping_type::oxennet_10years: return "oxennet_10years"sv; // "
case mapping_type::session: return "session"sv;
case mapping_type::wallet: return "wallet"sv;
default: assert(false); return "xx_unhandled_type"sv;
@ -123,22 +123,22 @@ inline std::ostream &operator<<(std::ostream &os, mapping_type type) { return os
constexpr bool mapping_type_allowed(uint8_t hf_version, mapping_type type) {
return (type == mapping_type::session && hf_version >= cryptonote::network_version_15_lns)
|| (is_lokinet_type(type) && hf_version >= cryptonote::network_version_16_pulse);
|| (is_oxennet_type(type) && hf_version >= cryptonote::network_version_16_pulse);
}
// Returns all mapping types supported for lookup as of the given hardfork. (Note that this does
// not return the dedicated length types such as mapping_type::lokinet_5years as those are only
// not return the dedicated length types such as mapping_type::oxennet_5years as those are only
// relevant within a LNS buy tx).
std::vector<mapping_type> all_mapping_types(uint8_t hf_version);
sqlite3 *init_loki_name_system(const fs::path& file_path, bool read_only);
sqlite3 *init_oxen_name_system(const fs::path& file_path, bool read_only);
/// Returns the integer value used in the database and in RPC lookup calls for the given mapping
/// type. In particularly this maps all mapping_type::lokinet_Xyears values to the underlying value
/// of mapping_type::lokinet.
/// type. In particularly this maps all mapping_type::oxennet_Xyears values to the underlying value
/// of mapping_type::oxennet.
constexpr uint16_t db_mapping_type(lns::mapping_type type) {
if (is_lokinet_type(type))
return static_cast<uint16_t>(mapping_type::lokinet);
if (is_oxennet_type(type))
return static_cast<uint16_t>(mapping_type::oxennet);
return static_cast<uint16_t>(type);
}
@ -170,7 +170,7 @@ std::string tx_extra_signature(std::string_view value, generic_owner cons
enum struct lns_tx_type { lookup, buy, update, renew };
// Converts a human readable case-insensitive string denoting the mapping type into a value suitable for storing into the LNS DB.
// Currently accepts "session" or "lokinet" for lookups, buys, updates, and renewals; for buys and renewals also accepts "lokinet_Ny[ear]" for N=2,5,10
// Currently accepts "session" or "oxennet" for lookups, buys, updates, and renewals; for buys and renewals also accepts "oxennet_Ny[ear]" for N=2,5,10
// Lookups are implied by none of buy/update/renew.
// mapping_type: (optional) if function returns true, the uint16_t value of the 'type' will be set
bool validate_mapping_type(std::string_view type, uint8_t hf_version, lns_tx_type txtype, mapping_type *mapping_type, std::string *reason);
@ -272,7 +272,7 @@ struct name_system_db
// Signifies the blockchain has reorganized commences the rollback and pruning procedures.
void block_detach (cryptonote::Blockchain const &blockchain, uint64_t new_blockchain_height);
bool save_owner (generic_owner const &owner, int64_t *row_id);
bool save_mapping (crypto::hash const &tx_hash, cryptonote::tx_extra_loki_name_system const &src, uint64_t height, std::optional<uint64_t> expiration_height, int64_t owner_id, std::optional<int64_t> backup_owner_id);
bool save_mapping (crypto::hash const &tx_hash, cryptonote::tx_extra_oxen_name_system const &src, uint64_t height, std::optional<uint64_t> expiration_height, int64_t owner_id, std::optional<int64_t> backup_owner_id);
bool save_settings (uint64_t top_height, crypto::hash const &top_hash, int version);
// Delete all mappings that are registered on height or newer followed by deleting all owners no longer referenced in the DB
@ -295,7 +295,7 @@ struct name_system_db
// Validates an LNS transaction. If the function returns true then entry will be populated with
// the LNS details. On a false return, `reason` is instead populated with the failure reason.
bool validate_lns_tx(uint8_t hf_version, uint64_t blockchain_height, cryptonote::transaction const &tx, cryptonote::tx_extra_loki_name_system &entry, std::string *reason);
bool validate_lns_tx(uint8_t hf_version, uint64_t blockchain_height, cryptonote::transaction const &tx, cryptonote::tx_extra_oxen_name_system &entry, std::string *reason);
// Destructor; closes the sqlite3 database if one is open
~name_system_db();

View File

@ -488,7 +488,7 @@ void pulse::handle_message(void *quorumnet_state, pulse::message const &msg)
return;
}
// TODO(loki): We don't support messages from future rounds. A round
// TODO(oxen): We don't support messages from future rounds. A round
// mismatch will be detected in the signature as the round is included in the
// signature hash.
@ -885,7 +885,7 @@ Yes +-----[Block can not be added to blockchain]
Genesis Pulse Block for the base timestamp and the top block hash and
height for signatures.
- // TODO(loki): After the Genesis Pulse Block is checkpointed, we can
- // TODO(oxen): After the Genesis Pulse Block is checkpointed, we can
// remove it from the event loop. Right now we recheck every block incase
// of (the very unlikely event) reorgs that might change the block at the
// hardfork.

View File

@ -834,7 +834,7 @@ namespace service_nodes
});
if (cit != contributor.locked_contributions.end())
{
// NOTE(loki): This should be checked in blockchain check_tx_inputs already
// NOTE(oxen): This should be checked in blockchain check_tx_inputs already
if (crypto::check_signature(service_nodes::generate_request_stake_unlock_hash(unlock.nonce),
cit->key_image_pub_key, unlock.signature))
{
@ -1003,7 +1003,7 @@ namespace service_nodes
if (hf_version >= cryptonote::network_version_11_infinite_staking)
{
// NOTE(loki): Grace period is not used anymore with infinite staking. So, if someone somehow reregisters, we just ignore it
// NOTE(oxen): Grace period is not used anymore with infinite staking. So, if someone somehow reregisters, we just ignore it
const auto iter = service_nodes_infos.find(key);
if (iter != service_nodes_infos.end())
return false;
@ -1902,7 +1902,7 @@ namespace service_nodes
size_t total_nodes = active_snode_list.size();
// TODO(loki): Soft fork, remove when testnet gets reset
// TODO(oxen): Soft fork, remove when testnet gets reset
if (nettype == cryptonote::TESTNET && state.height < 85357)
total_nodes = active_snode_list.size() + decomm_snode_list.size();
@ -2178,7 +2178,7 @@ namespace service_nodes
m_transient.state_history.erase(std::next(it), m_transient.state_history.end());
}
// TODO(loki): We should loop through the prev 10k heights for robustness, but avoid for v4.0.5. Already enough changes going in
// TODO(oxen): We should loop through the prev 10k heights for robustness, but avoid for v4.0.5. Already enough changes going in
if (reinitialise) // Try finding the next closest old state at 10k intervals
{
uint64_t prev_interval = revert_to_height - (revert_to_height % STORE_LONG_TERM_STATE_INTERVAL);
@ -2214,7 +2214,7 @@ namespace service_nodes
std::vector<crypto::public_key> expired_nodes;
uint64_t const lock_blocks = staking_num_lock_blocks(nettype);
// TODO(loki): This should really use the registration height instead of getting the block and expiring nodes.
// TODO(oxen): This should really use the registration height instead of getting the block and expiring nodes.
// But there's something subtly off when using registration height causing syncing problems.
if (hf_version == cryptonote::network_version_9_service_nodes)
{
@ -2331,7 +2331,7 @@ namespace service_nodes
// Because FP math is involved in reward calculations (and compounded by CPUs, compilers,
// expression contraction, and RandomX fiddling with the rounding modes) we can end up with a
// 1 ULP difference in the reward calculations.
// TODO(loki): eliminate all FP math from reward calculations
// TODO(oxen): eliminate all FP math from reward calculations
if (!within_one(output.amount, reward))
{
MGINFO_RED("Service node reward amount incorrect. Should be " << cryptonote::print_money(reward) << ", is: " << cryptonote::print_money(output.amount));
@ -2375,7 +2375,7 @@ namespace service_nodes
cryptonote::transaction const &miner_tx = block.miner_tx;
// NOTE: Basic queued service node list winner checks
// NOTE(loki): Service node reward distribution is calculated from the
// NOTE(oxen): Service node reward distribution is calculated from the
// original amount, i.e. 50% of the original base reward goes to service
// nodes not 50% of the reward after removing the governance component (the
// adjusted base reward post hardfork 10).
@ -2700,7 +2700,7 @@ namespace service_nodes
it != m_transient.state_history.end() && it->height <= max_short_term_height;
it++)
{
// TODO(loki): There are 2 places where we convert a state_t to be a serialized state_t without quorums. We should only do this in one location for clarity.
// TODO(oxen): There are 2 places where we convert a state_t to be a serialized state_t without quorums. We should only do this in one location for clarity.
m_transient.cache_short_term_data.states.push_back(serialize_service_node_state_object(hf_version, *it, it->height < max_short_term_height /*only_serialize_quorums*/));
}
@ -2870,7 +2870,7 @@ namespace service_nodes
for (auto const &min : MIN_UPTIME_PROOF_VERSIONS)
if (hf_version >= min.hardfork && proof.snode_version < min.version)
REJECT_PROOF("v" << min.version[0] << "." << min.version[1] << "." << min.version[2] << "+ loki version is required for v" << std::to_string(hf_version) << "+ network proofs");
REJECT_PROOF("v" << min.version[0] << "." << min.version[1] << "." << min.version[2] << "+ oxen version is required for v" << std::to_string(hf_version) << "+ network proofs");
if (!debug_allow_local_ips && !epee::net_utils::is_ip_public(proof.public_ip))
REJECT_PROOF("public_ip is not actually public");
@ -3150,7 +3150,7 @@ namespace service_nodes
}
if (info.version < version_t::v5_pulse_recomm_credit)
{
// If it's an old record then assume it's from before loki 8, in which case there were only
// If it's an old record then assume it's from before oxen 8, in which case there were only
// two valid values here: initial for a node that has never been recommissioned, or 0 for a recommission.
auto was = info.recommission_credit;
@ -3460,7 +3460,7 @@ namespace service_nodes
}
//
// FIXME(doyle): FIXME(loki) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// FIXME(doyle): FIXME(oxen) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// This is temporary code to redistribute the insufficient portion dust
// amounts between contributors. It should be removed in HF12.
//
@ -3468,13 +3468,13 @@ namespace service_nodes
std::array<uint64_t, MAX_NUMBER_OF_CONTRIBUTORS> min_contributions;
{
// NOTE: Calculate excess portions from each contributor
uint64_t loki_reserved = 0;
uint64_t oxen_reserved = 0;
for (size_t index = 0; index < addr_to_portions.size(); ++index)
{
addr_to_portion_t const &addr_to_portion = addr_to_portions[index];
uint64_t min_contribution_portions = service_nodes::get_min_node_contribution_in_portions(hf_version, staking_requirement, loki_reserved, index);
uint64_t loki_amount = service_nodes::portions_to_amount(staking_requirement, addr_to_portion.portions);
loki_reserved += loki_amount;
uint64_t min_contribution_portions = service_nodes::get_min_node_contribution_in_portions(hf_version, staking_requirement, oxen_reserved, index);
uint64_t oxen_amount = service_nodes::portions_to_amount(staking_requirement, addr_to_portion.portions);
oxen_reserved += oxen_amount;
uint64_t excess = 0;
if (addr_to_portion.portions > min_contribution_portions)
@ -3543,8 +3543,8 @@ namespace service_nodes
portions_left += portions_to_steal;
result.addresses.push_back(addr_to_portion.info.address);
result.portions.push_back(addr_to_portion.portions);
uint64_t loki_amount = service_nodes::portions_to_amount(addr_to_portion.portions, staking_requirement);
total_reserved += loki_amount;
uint64_t oxen_amount = service_nodes::portions_to_amount(addr_to_portion.portions, staking_requirement);
total_reserved += oxen_amount;
}
result.success = true;

View File

@ -392,7 +392,7 @@ namespace service_nodes
/// The service node key pair used for registration-related data on the chain; is
/// curve25519-based but with Monero-specific changes that make it useless for external tools
/// supporting standard ed25519 or x25519 keys.
/// TODO(loki) - eventually drop this key and just do everything with the ed25519 key.
/// TODO(oxen) - eventually drop this key and just do everything with the ed25519 key.
crypto::secret_key key;
crypto::public_key pub;

View File

@ -32,12 +32,12 @@
#include "cryptonote_config.h"
#include "cryptonote_core.h"
#include "version.h"
#include "common/loki.h"
#include "common/oxen.h"
#include "common/util.h"
#include "epee/net/local_ip.h"
#include <boost/endian/conversion.hpp>
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "quorum_cop"
@ -326,7 +326,7 @@ namespace service_nodes
if (m_core.get_nettype() == cryptonote::MAINNET && m_core.get_current_blockchain_height() < 646151)
{
// TODO(loki): Pulse grace period, temporary code to be deleted
// TODO(oxen): Pulse grace period, temporary code to be deleted
// once the grace height has transpired to give Service Nodes time
// to upgrade for the Pulse sorting key hot fix.
continue;
@ -335,7 +335,7 @@ namespace service_nodes
auto quorum = m_core.get_quorum(quorum_type::obligations, m_obligations_height);
if (!quorum)
{
// TODO(loki): Fatal error
// TODO(oxen): Fatal error
LOG_ERROR("Obligations quorum for height: " << m_obligations_height << " was not cached in daemon!");
continue;
}
@ -490,7 +490,7 @@ namespace service_nodes
auto quorum = m_core.get_quorum(quorum_type::checkpointing, m_last_checkpointed_height);
if (!quorum)
{
// TODO(loki): Fatal error
// TODO(oxen): Fatal error
LOG_ERROR("Checkpoint quorum for height: " << m_last_checkpointed_height << " was not cached in daemon!");
continue;
}

View File

@ -1,5 +1,5 @@
#include "cryptonote_config.h"
#include "common/loki.h"
#include "common/oxen.h"
#include "epee/int-util.h"
#include <boost/endian/conversion.hpp>
#include <limits>
@ -11,7 +11,7 @@
namespace service_nodes {
// TODO(loki): Move to loki_economy, this will also need access to loki::exp2
// TODO(oxen): Move to oxen_economy, this will also need access to oxen::exp2
uint64_t get_staking_requirement(cryptonote::network_type m_nettype, uint64_t height, uint8_t hf_version)
{
if (m_nettype == cryptonote::TESTNET || m_nettype == cryptonote::FAKECHAIN)
@ -49,13 +49,13 @@ uint64_t get_staking_requirement(cryptonote::network_type m_nettype, uint64_t he
};
assert(static_cast<int64_t>(height) >= heights[0]);
constexpr uint64_t LAST_HEIGHT = heights[loki::array_count(heights) - 1];
constexpr uint64_t LAST_REQUIREMENT = lsr [loki::array_count(lsr) - 1];
constexpr uint64_t LAST_HEIGHT = heights[oxen::array_count(heights) - 1];
constexpr uint64_t LAST_REQUIREMENT = lsr [oxen::array_count(lsr) - 1];
if (height >= LAST_HEIGHT)
return LAST_REQUIREMENT;
size_t i = 0;
for (size_t index = 1; index < loki::array_count(heights); index++)
for (size_t index = 1; index < oxen::array_count(heights); index++)
{
if (heights[index] > static_cast<int64_t>(height))
{
@ -78,12 +78,12 @@ uint64_t get_staking_requirement(cryptonote::network_type m_nettype, uint64_t he
if (hf_version >= cryptonote::network_version_11_infinite_staking)
{
base = 15000 * COIN;
variable = (25007.0 * COIN) / loki::exp2(height_adjusted/129600.0);
variable = (25007.0 * COIN) / oxen::exp2(height_adjusted/129600.0);
}
else
{
base = 10000 * COIN;
variable = (35000.0 * COIN) / loki::exp2(height_adjusted/129600.0);
variable = (35000.0 * COIN) / oxen::exp2(height_adjusted/129600.0);
}
uint64_t result = base + variable;

View File

@ -268,7 +268,7 @@ namespace service_nodes {
constexpr uint8_t MAXIMUM_EXTERNAL_OUT_OF_SYNC = 80;
static_assert(STAKING_PORTIONS != UINT64_MAX, "UINT64_MAX is used as the invalid value for failing to calculate the min_node_contribution");
// return: UINT64_MAX if (num_contributions > the max number of contributions), otherwise the amount in loki atomic units
// return: UINT64_MAX if (num_contributions > the max number of contributions), otherwise the amount in oxen atomic units
uint64_t get_min_node_contribution (uint8_t version, uint64_t staking_requirement, uint64_t total_reserved, size_t num_contributions);
uint64_t get_min_node_contribution_in_portions(uint8_t version, uint64_t staking_requirement, uint64_t total_reserved, size_t num_contributions);

View File

@ -242,7 +242,7 @@ namespace service_nodes
assert(!"Invalid Code Path");
break;
// TODO(loki): DRY quorum verification with state change obligations.
// TODO(oxen): DRY quorum verification with state change obligations.
case quorum_type::checkpointing:
{

View File

@ -92,7 +92,7 @@ namespace service_nodes
KV_MAP_SERIALIZABLE
// TODO(loki): idk exactly if I want to implement this, but need for core tests to compile. Not sure I care about serializing for core tests at all.
// TODO(oxen): idk exactly if I want to implement this, but need for core tests to compile. Not sure I care about serializing for core tests at all.
private:
friend class boost::serialization::access;
template <class Archive>
@ -126,7 +126,7 @@ namespace service_nodes
// return: The vector of votes if the vote is valid (and even if it is not unique) otherwise nullptr
std::vector<pool_vote_entry> add_pool_vote_if_unique(const quorum_vote_t &vote, cryptonote::vote_verification_context &vvc);
// TODO(loki): Review relay behaviour and all the cases when it should be triggered
// TODO(oxen): Review relay behaviour and all the cases when it should be triggered
void set_relayed (const std::vector<quorum_vote_t>& votes);
void remove_expired_votes(uint64_t height);
void remove_used_votes (std::vector<cryptonote::transaction> const &txs, uint8_t hard_fork_version);

View File

@ -186,9 +186,9 @@ namespace cryptonote
}
}
else if (tx.type == txtype::loki_name_system)
else if (tx.type == txtype::oxen_name_system)
{
tx_extra_loki_name_system data;
tx_extra_oxen_name_system data;
if (!cryptonote::get_field_from_tx_extra(tx.extra, data))
{
MERROR("Could not get acquire name service from tx: " << get_transaction_hash(tx) << ", tx to add is possibly invalid, rejecting");
@ -202,7 +202,7 @@ namespace cryptonote
if (pool_tx.type != tx.type)
continue;
tx_extra_loki_name_system pool_data;
tx_extra_oxen_name_system pool_data;
if (!cryptonote::get_field_from_tx_extra(pool_tx.extra, pool_data))
{
LOG_PRINT_L1("Could not get acquire name service from tx: " << get_transaction_hash(tx) << ", possibly corrupt tx in the pool");
@ -220,7 +220,7 @@ namespace cryptonote
{
if (tx.type != txtype::standard && tx.type != txtype::stake)
{
// NOTE(loki): This is a developer error. If we come across this in production, be conservative and just reject
// NOTE(oxen): This is a developer error. If we come across this in production, be conservative and just reject
MERROR("Unrecognised transaction type: " << tx.type << " for tx: " << get_transaction_hash(tx));
return true;
}
@ -1404,7 +1404,7 @@ namespace cryptonote
if (pool_tx.type == txtype::state_change &&
get_service_node_state_change_from_tx_extra(pool_tx.extra, state_change, blk.major_version))
{
// TODO(loki): PERF(loki): On pop_blocks we return all the TXs to the
// TODO(oxen): PERF(oxen): On pop_blocks we return all the TXs to the
// pool. The greater the pop_blocks, the more txs that are queued in the
// pool, and for every subsequent block you sync, get_transactions has
// to allocate these transactions and we have to search every
@ -1768,11 +1768,11 @@ end:
uint64_t best_reward = 0;
{
// NOTE: Calculate base line empty block reward
loki_block_reward_context block_reward_context = {};
oxen_block_reward_context block_reward_context = {};
block_reward_context.height = height;
block_reward_parts reward_parts = {};
if (!get_loki_block_reward(median_weight, total_weight, already_generated_coins, version, reward_parts, block_reward_context))
if (!get_oxen_block_reward(median_weight, total_weight, already_generated_coins, version, reward_parts, block_reward_context))
{
MERROR("Failed to get block reward for empty block");
return false;
@ -1809,12 +1809,12 @@ end:
}
// NOTE: Calculate the next block reward for the block producer
loki_block_reward_context next_block_reward_context = {};
oxen_block_reward_context next_block_reward_context = {};
next_block_reward_context.height = height;
next_block_reward_context.fee = raw_fee + meta.fee;
block_reward_parts next_reward_parts = {};
if(!get_loki_block_reward(median_weight, total_weight + meta.weight, already_generated_coins, version, next_reward_parts, next_block_reward_context))
if(!get_oxen_block_reward(median_weight, total_weight + meta.weight, already_generated_coins, version, next_reward_parts, next_block_reward_context))
{
LOG_PRINT_L2("Block reward calculation bug");
return false;

View File

@ -45,7 +45,7 @@
#include "crypto/hash.h"
#include "rpc/core_rpc_server_commands_defs.h"
#include "tx_blink.h"
#include "loki_economy.h"
#include "oxen_economy.h"
namespace cryptonote
{

View File

@ -36,7 +36,7 @@
#include "epee/net/net_utils_base.h"
#include "cryptonote_basic/blobdatatype.h"
#include "common/loki.h"
#include "common/oxen.h"
namespace service_nodes
{

View File

@ -2325,7 +2325,7 @@ skip:
}
}
MGINFO_YELLOW("\n**********************************************************************\n"
<< "You are now synchronized with the network. You may now start loki-wallet-cli.\n"
<< "You are now synchronized with the network. You may now start oxen-wallet-cli.\n"
<< "\n"
<< "Use the \"help\" command to see the list of available commands.\n"
<< "**********************************************************************");
@ -2687,7 +2687,7 @@ skip:
MINFO("Target height decreasing from " << previous_target << " to " << target);
m_core.set_target_blockchain_height(target);
if (target == 0 && context.m_state > cryptonote_connection_context::state_before_handshake && !m_stopping)
MCWARNING("global", "lokid is now disconnected from the network");
MCWARNING("global", "oxend is now disconnected from the network");
}
m_block_queue.flush_spans(context.m_connection_id, false);

View File

@ -28,7 +28,7 @@
#pragma once
// This file (plus .cpp) contains the glue layer between cryptonote_core and loki-mq.
// This file (plus .cpp) contains the glue layer between cryptonote_core and oxen-mq.
#include <vector>

View File

@ -932,10 +932,10 @@ bool command_parser_executor::prune_blockchain(const std::vector<std::string>& a
if (args.empty() || args[0] != "confirm")
{
std::cout << "Warning: pruning from within lokid will not shrink the database file size." << std::endl;
std::cout << "Warning: pruning from within oxend will not shrink the database file size." << std::endl;
std::cout << "Instead, parts of the file will be marked as free, so the file will not grow" << std::endl;
std::cout << "until that newly free space is used up. If you want a smaller file size now," << std::endl;
std::cout << "exit lokid and run loki-blockchain-prune (you will temporarily need more" << std::endl;
std::cout << "exit oxend and run oxen-blockchain-prune (you will temporarily need more" << std::endl;
std::cout << "disk space for the database conversion though). If you are OK with the database" << std::endl;
std::cout << "file keeping the same size, re-run this command with the \"confirm\" parameter." << std::endl;
return true;

View File

@ -33,7 +33,7 @@
#include "epee/string_tools.h"
#include "daemon/command_server.h"
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#include <thread>
@ -320,7 +320,7 @@ void command_server::init_commands(cryptonote::rpc::core_rpc_server* rpc_server)
, "bc_dyn_stats <last_block_count>"
, "Print the information about current blockchain dynamic state."
);
// TODO(loki): Implement
// TODO(oxen): Implement
#if 0
m_command_lookup.set_handler(
"update"
@ -351,7 +351,7 @@ void command_server::init_commands(cryptonote::rpc::core_rpc_server* rpc_server)
, [this](const auto &x) { return m_parser.version(x); }
, "Print version information."
);
#if 0 // TODO(loki): Pruning not supported because of Service Node List
#if 0 // TODO(oxen): Pruning not supported because of Service Node List
m_command_lookup.set_handler(
"prune_blockchain"
, [this](const auto &x) { return m_parser.prune_blockchain(x); }

View File

@ -127,7 +127,7 @@ daemon::daemon(boost::program_options::variables_map vm_) :
auto rpc_config = cryptonote::rpc_args::process(vm);
bool new_rpc_options = !is_arg_defaulted(vm, cryptonote::rpc::http_server::arg_rpc_admin)
|| !is_arg_defaulted(vm, cryptonote::rpc::http_server::arg_rpc_public);
// TODO: Remove these options, perhaps starting in loki 9.0
// TODO: Remove these options, perhaps starting in oxen 9.0
bool deprecated_rpc_options = !is_arg_defaulted(vm, cryptonote::rpc::http_server::arg_rpc_bind_port)
|| !is_arg_defaulted(vm, cryptonote::rpc::http_server::arg_rpc_restricted_bind_port)
|| !is_arg_defaulted(vm, cryptonote::rpc::http_server::arg_restricted_rpc)
@ -145,7 +145,7 @@ daemon::daemon(boost::program_options::variables_map vm_) :
std::vector<std::tuple<std::string, uint16_t, bool>> rpc_listen_admin, rpc_listen_public;
if (deprecated_rpc_options)
{
MGINFO_RED(deprecated_option_names << " options are deprecated and will be removed from a future lokid version; use --rpc-public/--rpc-admin instead");
MGINFO_RED(deprecated_option_names << " options are deprecated and will be removed from a future oxend version; use --rpc-public/--rpc-admin instead");
// These old options from Monero are really janky: --restricted-rpc turns the main port
// restricted, but then we also have --rpc-restricted-bind-port but both are stuck with
@ -297,7 +297,7 @@ bool daemon::run(bool interactive)
try
{
MGINFO_BLUE("Starting up lokid services...");
MGINFO_BLUE("Starting up oxend services...");
cryptonote::GetCheckpointsCallback get_checkpoints;
#if defined(PER_BLOCK_CHECKPOINT)
get_checkpoints = blocks::GetCheckpointsData;

View File

@ -169,7 +169,7 @@ int main(int argc, char const * argv[])
}
// data_dir
// default: e.g. ~/.loki/ or ~/.loki/testnet
// default: e.g. ~/.oxen/ or ~/.oxen/testnet
// if data-dir argument given:
// absolute path
// relative path: relative to cwd
@ -223,7 +223,7 @@ int main(int argc, char const * argv[])
{
auto rpc_config = cryptonote::rpc_args::process(vm);
std::string rpc_addr;
// TODO: remove this in loki 9.x and only use rpc-admin
// TODO: remove this in oxen 9.x and only use rpc-admin
if (!is_arg_defaulted(vm, cryptonote::rpc::http_server::arg_rpc_bind_port) ||
rpc_config.bind_ip.has_value()) {
auto rpc_port = command_line::get_arg(vm, cryptonote::rpc::http_server::arg_rpc_bind_port);
@ -236,7 +236,7 @@ int main(int argc, char const * argv[])
} else {
rpc_addr = command_line::get_arg(vm, cryptonote::rpc::http_server::arg_rpc_admin)[0];
if (rpc_addr == "none")
throw std::runtime_error{"Cannot invoke lokid command: --rpc-admin is disabled"};
throw std::runtime_error{"Cannot invoke oxend command: --rpc-admin is disabled"};
}
{

View File

@ -42,7 +42,7 @@
#include "checkpoints/checkpoints.h"
#include <boost/format.hpp>
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
#include <fstream>
#include <ctime>
@ -560,11 +560,11 @@ bool rpc_command_executor::show_status() {
str << "NOT RECEIVED";
str << " (storage), ";
if (*ires.last_lokinet_ping > 0)
str << get_human_time_ago(*ires.last_lokinet_ping, time(nullptr), true /*abbreviate*/);
if (*ires.last_oxennet_ping > 0)
str << get_human_time_ago(*ires.last_oxennet_ping, time(nullptr), true /*abbreviate*/);
else
str << "NOT RECEIVED";
str << " (lokinet)";
str << " (oxennet)";
tools::success_msg_writer() << str.str();
}
@ -1115,8 +1115,8 @@ bool rpc_command_executor::print_status()
// Make a request to get_height because it is public and relatively simple
GET_HEIGHT::response res;
if (invoke<GET_HEIGHT>({}, res, "lokid is NOT running")) {
tools::success_msg_writer() << "lokid is running (height: " << res.height << ")";
if (invoke<GET_HEIGHT>({}, res, "oxend is NOT running")) {
tools::success_msg_writer() << "oxend is running (height: " << res.height << ")";
return true;
}
return false;
@ -2067,7 +2067,7 @@ bool rpc_command_executor::prepare_registration()
case register_step::is_solo_stake__operator_address_to_reserve:
{
std::string address_str;
last_input_result = input_line_back_cancel_get_input("Enter the loki address for the solo staker", address_str);
last_input_result = input_line_back_cancel_get_input("Enter the oxen address for the solo staker", address_str);
if (last_input_result == input_line_result::back)
continue;
@ -2172,7 +2172,7 @@ bool rpc_command_executor::prepare_registration()
case register_step::is_open_stake__operator_address_to_reserve:
{
std::string address_str;
last_input_result = input_line_back_cancel_get_input("Enter the loki address for the operator", address_str);
last_input_result = input_line_back_cancel_get_input("Enter the oxen address for the operator", address_str);
if (last_input_result == input_line_result::back)
continue;
@ -2196,7 +2196,7 @@ bool rpc_command_executor::prepare_registration()
std::cout << "Minimum amount that can be reserved: " << cryptonote::print_money(min_contribution) << " " << cryptonote::get_unit() << std::endl;
std::string contribution_str;
last_input_result = input_line_back_cancel_get_input("How much loki does the operator want to reserve in the stake?", contribution_str);
last_input_result = input_line_back_cancel_get_input("How much oxen does the operator want to reserve in the stake?", contribution_str);
if (last_input_result == input_line_result::back)
continue;
@ -2247,7 +2247,7 @@ bool rpc_command_executor::prepare_registration()
case register_step::is_open_stake__contributor_address_to_reserve:
{
std::string const prompt = "Enter the loki address for contributor " + std::to_string(state.contributions.size() + 1);
std::string const prompt = "Enter the oxen address for contributor " + std::to_string(state.contributions.size() + 1);
std::string address_str;
last_input_result = input_line_back_cancel_get_input(prompt.c_str(), address_str);
if (last_input_result == input_line_result::back)
@ -2277,7 +2277,7 @@ bool rpc_command_executor::prepare_registration()
std::cout << "There is " << cryptonote::print_money(amount_left) << " " << cryptonote::get_unit() << " left to meet the staking requirement." << std::endl;
std::string contribution_str;
std::string const prompt = "How much loki does contributor " + std::to_string(state.contributions.size() + 1) + " want to reserve in the stake?";
std::string const prompt = "How much oxen does contributor " + std::to_string(state.contributions.size() + 1) + " want to reserve in the stake?";
last_input_result = input_line_back_cancel_get_input(prompt.c_str(), contribution_str);
if (last_input_result == input_line_result::back)
continue;

View File

@ -31,7 +31,7 @@
#include "cryptonote_basic/tx_extra.h"
#include "cryptonote_core/blockchain.h"
#include "common/command_line.h"
#include "loki_economy.h"
#include "oxen_economy.h"
#include "common/hex.h"
#include "version.h"
#include <lokimq/hex.h>
@ -76,14 +76,14 @@ struct extra_printer {
void operator()(const tx_extra_tx_key_image_proofs& x) { std::cout << "TX key image proofs (" << x.proofs.size() << ")"; }
void operator()(const tx_extra_tx_key_image_unlock& x) { std::cout << "TX key image unlock: " << x.key_image; }
void operator()(const tx_extra_burn& x) { std::cout << "Transaction burned fee/payment: " << print_money(x.amount); }
void operator()(const tx_extra_loki_name_system& x) {
void operator()(const tx_extra_oxen_name_system& x) {
std::cout << "LNS " << (x.is_buying() ? "registration" : x.is_updating() ? "update" : "(unknown)");
switch (x.type)
{
case lns::mapping_type::lokinet: std::cout << " - Lokinet (1y)"; break;
case lns::mapping_type::lokinet_2years: std::cout << " - Lokinet (2y)"; break;
case lns::mapping_type::lokinet_5years: std::cout << " - Lokinet (5y)"; break;
case lns::mapping_type::lokinet_10years: std::cout << " - Lokinet (10y)"; break;
case lns::mapping_type::oxennet: std::cout << " - Lokinet (1y)"; break;
case lns::mapping_type::oxennet_2years: std::cout << " - Lokinet (2y)"; break;
case lns::mapping_type::oxennet_5years: std::cout << " - Lokinet (5y)"; break;
case lns::mapping_type::oxennet_10years: std::cout << " - Lokinet (10y)"; break;
case lns::mapping_type::session: std::cout << " - Session address"; break;
case lns::mapping_type::wallet: std::cout << " - Wallet address"; break;
case lns::mapping_type::update_record_internal:

View File

@ -28,7 +28,7 @@
//
#if defined(HAVE_HIDAPI)
#include "common/loki.h"
#include "common/oxen.h"
#include "log.hpp"
#include "device_io_hid.hpp"

View File

@ -1583,7 +1583,7 @@ namespace hw {
additional_txkey.sec = additional_tx_keys[output_index];
}
bool &is_change = found_change; // NOTE(loki): Alias our param into theirs so we don't have to change much code.
bool &is_change = found_change; // NOTE(oxen): Alias our param into theirs so we don't have to change much code.
if (change_addr && dst_entr == *change_addr && !is_change)
is_change = true; // sending change to yourself; derivation = a*R

View File

@ -151,7 +151,7 @@ namespace ki {
bool need_all_additionals)
{
for(auto & td : transfers){
// TODO(doyle): TODO(loki): We should use td.m_pk_index!!
// TODO(doyle): TODO(oxen): We should use td.m_pk_index!!
::crypto::public_key tx_pub_key = wallet->get_tx_pub_key_from_received_outs(td);
const std::vector<::crypto::public_key> additional_tx_pub_keys = cryptonote::get_additional_tx_pub_keys_from_extra(td.m_tx);

View File

@ -515,7 +515,7 @@ namespace trezor{
m_http_session.SetUrl(std::string{url});
m_http_session.SetTimeout(HTTP_TIMEOUT);
m_http_session.SetHeader({
{"Origin", "https://monero.trezor.io"}, // FIXME (loki) - does this matter to the bridge?
{"Origin", "https://monero.trezor.io"}, // FIXME (oxen) - does this matter to the bridge?
{"Content-Type", "application/json; charset=utf-8"}
});
m_http_session.SetBody(body);

View File

@ -51,7 +51,7 @@
#include "trezor_defs.hpp"
#include "messages_map.hpp"
#include "common/loki.h"
#include "common/oxen.h"
#include "messages/messages.pb.h"
#include "messages/messages-common.pb.h"

View File

@ -176,13 +176,13 @@ int main(int argc, char* argv[])
auto [vm, should_terminate] = wallet_args::main(
argc, argv,
"loki-gen-multisig [(--testnet|--devnet)] [--filename-base=<filename>] [--scheme=M/N] [--threshold=M] [--participants=N]",
"oxen-gen-multisig [(--testnet|--devnet)] [--filename-base=<filename>] [--scheme=M/N] [--threshold=M] [--participants=N]",
genms::tr("This program generates a set of multisig wallets - use this simpler scheme only if all the participants trust each other"),
desc_params,
po::options_description{},
boost::program_options::positional_options_description(),
[](const std::string &s, bool emphasis){ tools::scoped_message_writer(emphasis ? epee::console_color_white : epee::console_color_default, true) << s; },
"loki-gen-multisig.log"
"oxen-gen-multisig.log"
);
if (!vm)
return 1;

View File

@ -44,7 +44,7 @@
#include "epee/misc_language.h"
#include "epee/int-util.h"
#include "mnemonics/electrum-words.h"
#include "common/loki.h"
#include "common/oxen.h"
#include <boost/crc.hpp>
#include "chinese_simplified.h"

View File

@ -16,7 +16,7 @@ constexpr uint64_t FOUNDATION_REWARD_HF15 = BLOCK_REWARD_HF15 * 10 / 100;
// HF16+ money supply parameters: same as HF15 except the miner fee goes away and is redirected to
// LF to be used exclusively for Loki Chainflip liquidity seeding and incentives. See
// https://github.com/loki-project/loki-improvement-proposals/issues/24 for more details. This ends
// https://github.com/oxen-project/oxen-improvement-proposals/issues/24 for more details. This ends
// after 6 months.
constexpr uint64_t BLOCK_REWARD_HF16 = BLOCK_REWARD_HF15;
constexpr uint64_t CHAINFLIP_LIQUIDITY_HF16 = BLOCK_REWARD_HF15 * 24 / 100;
@ -63,17 +63,17 @@ enum struct mapping_type : uint16_t
{
session = 0,
wallet = 1,
lokinet = 2, // the type value stored in the database; counts as 1-year when used in a buy tx.
lokinet_2years,
lokinet_5years,
lokinet_10years,
oxennet = 2, // the type value stored in the database; counts as 1-year when used in a buy tx.
oxennet_2years,
oxennet_5years,
oxennet_10years,
_count,
update_record_internal,
};
constexpr bool is_lokinet_type(mapping_type t) { return t >= mapping_type::lokinet && t <= mapping_type::lokinet_10years; }
constexpr bool is_oxennet_type(mapping_type t) { return t >= mapping_type::oxennet && t <= mapping_type::oxennet_10years; }
// How many days we add per "year" of LNS lokinet registration. We slightly extend this to the 368
// How many days we add per "year" of LNS oxennet registration. We slightly extend this to the 368
// days per registration "year" to allow for some blockchain time drift + leap years.
constexpr uint64_t REGISTRATION_YEAR_DAYS = 368;
@ -81,7 +81,7 @@ constexpr uint64_t burn_needed(uint8_t hf_version, mapping_type type)
{
uint64_t result = 0;
// The base amount for session/wallet/lokinet-1year:
// The base amount for session/wallet/oxennet-1year:
const uint64_t basic_fee = (
hf_version >= 16 ? 15*COIN : // cryptonote::network_version_16_pulse -- but don't want to add cryptonote_config.h include
20*COIN // cryptonote::network_version_15_lns
@ -92,16 +92,16 @@ constexpr uint64_t burn_needed(uint8_t hf_version, mapping_type type)
result = 0;
break;
case mapping_type::lokinet: /* FALLTHRU */
case mapping_type::oxennet: /* FALLTHRU */
case mapping_type::session: /* FALLTHRU */
case mapping_type::wallet: /* FALLTHRU */
default:
result = basic_fee;
break;
case mapping_type::lokinet_2years: result = 2 * basic_fee; break;
case mapping_type::lokinet_5years: result = 4 * basic_fee; break;
case mapping_type::lokinet_10years: result = 6 * basic_fee; break;
case mapping_type::oxennet_2years: result = 2 * basic_fee; break;
case mapping_type::oxennet_5years: result = 4 * basic_fee; break;
case mapping_type::oxennet_10years: result = 6 * basic_fee; break;
}
return result;
}

View File

@ -275,7 +275,7 @@ namespace nodetool
private:
const std::vector<std::string> m_seed_nodes_list =
{
// TODO(loki): "seeds.loki.network"
// TODO(oxen): "seeds.oxen.network"
};
bool islimitup=false;

View File

@ -41,13 +41,13 @@
#include <lokimq/base64.h>
#include "crypto/crypto.h"
#include "cryptonote_basic/tx_extra.h"
#include "cryptonote_core/loki_name_system.h"
#include "cryptonote_core/oxen_name_system.h"
#include "cryptonote_core/pulse.h"
#include "loki_economy.h"
#include "oxen_economy.h"
#include "epee/string_tools.h"
#include "core_rpc_server.h"
#include "common/command_line.h"
#include "common/loki.h"
#include "common/oxen.h"
#include "common/sha256sum.h"
#include "common/perf_timer.h"
#include "common/random.h"
@ -420,7 +420,7 @@ namespace cryptonote { namespace rpc {
res.service_node = m_core.service_node();
res.start_time = (uint64_t)m_core.get_start_time();
res.last_storage_server_ping = (uint64_t)m_core.m_last_storage_server_ping;
res.last_lokinet_ping = (uint64_t)m_core.m_last_lokinet_ping;
res.last_oxennet_ping = (uint64_t)m_core.m_last_oxennet_ping;
res.free_space = m_core.get_free_space();
res.height_without_bootstrap = res.height;
std::shared_lock lock{m_bootstrap_daemon_mutex};
@ -774,15 +774,15 @@ namespace cryptonote { namespace rpc {
else if (owner.type == lns::generic_owner_sig_type::ed25519)
entry = tools::type_to_hex(owner.ed25519);
}
void operator()(const tx_extra_loki_name_system& x) {
void operator()(const tx_extra_oxen_name_system& x) {
auto& lns = entry.lns.emplace();
lns.blocks = lns::expiry_blocks(nettype, x.type);
switch (x.type)
{
case lns::mapping_type::lokinet: [[fallthrough]];
case lns::mapping_type::lokinet_2years: [[fallthrough]];
case lns::mapping_type::lokinet_5years: [[fallthrough]];
case lns::mapping_type::lokinet_10years: lns.type = "lokinet"; break;
case lns::mapping_type::oxennet: [[fallthrough]];
case lns::mapping_type::oxennet_2years: [[fallthrough]];
case lns::mapping_type::oxennet_5years: [[fallthrough]];
case lns::mapping_type::oxennet_10years: lns.type = "oxennet"; break;
case lns::mapping_type::session: lns.type = "session"; break;
case lns::mapping_type::wallet: lns.type = "wallet"; break;
@ -3295,7 +3295,7 @@ namespace cryptonote { namespace rpc {
{
return handle_ping<LOKINET_PING>(
req.version, service_nodes::MIN_LOKINET_VERSION,
"Lokinet", m_core.m_last_lokinet_ping, LOKINET_PING_LIFETIME,
"Lokinet", m_core.m_last_oxennet_ping, LOKINET_PING_LIFETIME,
[this](bool significant) { if (significant) m_core.reset_proof_interval(); });
}
//------------------------------------------------------------------------------------------------------------------------------
@ -3519,7 +3519,7 @@ namespace cryptonote { namespace rpc {
{
types.push_back(static_cast<lns::mapping_type>(type));
if (!lns::mapping_type_allowed(hf_version, types.back()))
throw rpc_error{ERROR_WRONG_PARAM, "Invalid lokinet type '" + std::to_string(type) + "'"};
throw rpc_error{ERROR_WRONG_PARAM, "Invalid oxennet type '" + std::to_string(type) + "'"};
}
// This also takes 32 raw bytes, but that is undocumented (because it is painful to pass
@ -3567,7 +3567,7 @@ namespace cryptonote { namespace rpc {
if (!lns::parse_owner_to_generic_owner(m_core.get_nettype(), owner, lns_owner, &errmsg))
throw rpc_error{ERROR_WRONG_PARAM, std::move(errmsg)};
// TODO(loki): We now serialize both owner and backup_owner, since if
// TODO(oxen): We now serialize both owner and backup_owner, since if
// we specify an owner that is backup owner, we don't show the (other)
// owner. For RPC compatibility we keep the request_index around until the
// next hard fork (16)
@ -3619,7 +3619,7 @@ namespace cryptonote { namespace rpc {
uint8_t hf_version = m_core.get_hard_fork_version(m_core.get_current_blockchain_height());
auto type = static_cast<lns::mapping_type>(req.type);
if (!lns::mapping_type_allowed(hf_version, type))
throw rpc_error{ERROR_WRONG_PARAM, "Invalid lokinet type '" + std::to_string(req.type) + "'"};
throw rpc_error{ERROR_WRONG_PARAM, "Invalid oxennet type '" + std::to_string(req.type) + "'"};
if (auto mapping = m_core.get_blockchain_storage().name_system_db().resolve(
type, *name_hash, m_core.get_current_blockchain_height()))

View File

@ -44,7 +44,7 @@
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
#endif
#undef LOKI_DEFAULT_LOG_CATEGORY

View File

@ -316,7 +316,7 @@ KV_SERIALIZE_MAP_CODE_BEGIN(GET_INFO::response)
KV_SERIALIZE(start_time)
KV_SERIALIZE(service_node)
KV_SERIALIZE(last_storage_server_ping)
KV_SERIALIZE(last_lokinet_ping)
KV_SERIALIZE(last_oxennet_ping)
KV_SERIALIZE(free_space)
KV_SERIALIZE(offline)
KV_SERIALIZE(untrusted)

View File

@ -49,7 +49,7 @@
#include "cryptonote_core/service_node_quorum_cop.h"
#include "cryptonote_core/service_node_list.h"
#include "common/loki.h"
#include "common/oxen.h"
namespace cryptonote {
@ -303,8 +303,8 @@ namespace rpc {
std::optional<bool> buy; // Provided and true iff this is an LNS buy record
std::optional<bool> update; // Provided and true iff this is an LNS record update
std::optional<bool> renew; // Provided and true iff this is an LNS record renewal
std::string type; // The LNS request type. For registrations: "lokinet", "session", "wallet"; for a record update: "update"
std::optional<uint64_t> blocks; // The registration length in blocks (only applies to lokinet registrations; session/wallet registrations do not expire)
std::string type; // The LNS request type. For registrations: "oxennet", "session", "wallet"; for a record update: "update"
std::optional<uint64_t> blocks; // The registration length in blocks (only applies to oxennet registrations; session/wallet registrations do not expire)
std::string name_hash; // The hashed name of the record being purchased/updated, in hex (the actual name is not provided on the blockchain).
std::optional<std::string> prev_txid; // For an update, this points at the txid of the previous lns update transaction.
std::optional<std::string> value; // The encrypted value of the record, in hex. Note that this is encrypted using the actual name itself (*not* the hashed name).
@ -639,7 +639,7 @@ namespace rpc {
std::optional<bool> service_node; // Will be true if the node is running in --service-node mode.
std::optional<uint64_t> start_time; // Start time of the daemon, as UNIX time.
std::optional<uint64_t> last_storage_server_ping; // Last ping time of the storage server (0 if never or not running as a service node)
std::optional<uint64_t> last_lokinet_ping; // Last ping time of lokinet (0 if never or not running as a service node)
std::optional<uint64_t> last_oxennet_ping; // Last ping time of oxennet (0 if never or not running as a service node)
std::optional<uint64_t> free_space; // Available disk space on the node.
bool offline; // States if the node is offline (`true`) or online (`false`).
bool untrusted; // States if the result is obtained using the bootstrap mode, and is therefore not trusted (`true`), or when the daemon is fully synced (`false`).
@ -798,8 +798,8 @@ namespace rpc {
LOKI_RPC_DOC_INTROSPECT
struct block_header_response
{
uint8_t major_version; // The major version of the loki protocol at this block height.
uint8_t minor_version; // The minor version of the loki protocol at this block height.
uint8_t major_version; // The major version of the oxen protocol at this block height.
uint8_t minor_version; // The minor version of the oxen protocol at this block height.
uint64_t timestamp; // The unix time at which the block was recorded into the blockchain.
std::string prev_hash; // The hash of the block immediately preceding this block in the chain.
uint32_t nonce; // A cryptographic random one-time number used in mining a Loki block.
@ -947,7 +947,7 @@ namespace rpc {
uint64_t id; // Peer id.
std::string host; // IP address in string format.
uint32_t ip; // IP address in integer format.
uint16_t port; // TCP port the peer is using to connect to loki network.
uint16_t port; // TCP port the peer is using to connect to oxen network.
uint16_t rpc_port; // RPC port the peer is using
uint64_t last_seen; // Unix time at which the peer has been seen for the last time
uint32_t pruning_seed; //
@ -1614,7 +1614,7 @@ namespace rpc {
std::string status; // General RPC error code. "OK" means everything looks good.
uint64_t emission_amount; // Amount of coinbase reward in atomic units.
uint64_t fee_amount; // Amount of fees in atomic units.
uint64_t burn_amount; // Amount of burnt loki.
uint64_t burn_amount; // Amount of burnt oxen.
KV_MAP_SERIALIZABLE
};
@ -2192,7 +2192,7 @@ namespace rpc {
LOKI_RPC_DOC_INTROSPECT
struct LOKINET_PING : RPC_COMMAND
{
static constexpr auto names() { return NAMES("lokinet_ping"); }
static constexpr auto names() { return NAMES("oxennet_ping"); }
struct request
{
@ -2430,7 +2430,7 @@ namespace rpc {
struct request_entry
{
std::string name_hash; // The 32-byte BLAKE2b hash of the name to resolve to a public key via Loki Name Service. The value must be provided either in hex (64 hex digits) or base64 (44 characters with padding, or 43 characters without).
std::vector<uint16_t> types; // If empty, query all types. Currently supported types are 0 (session) and 2 (lokinet). In future updates more mapping types will be available.
std::vector<uint16_t> types; // If empty, query all types. Currently supported types are 0 (session) and 2 (oxennet). In future updates more mapping types will be available.
KV_MAP_SERIALIZABLE
};
@ -2446,7 +2446,7 @@ namespace rpc {
struct response_entry
{
uint64_t entry_index; // The index in request_entry's `entries` array that was resolved via Loki Name Service.
lns::mapping_type type; // The type of Loki Name Service entry that the owner owns: currently supported values are 0 (session), 2 (lokinet)
lns::mapping_type type; // The type of Loki Name Service entry that the owner owns: currently supported values are 0 (session), 2 (oxennet)
std::string name_hash; // The hash of the name that was queried, in base64
std::string owner; // The public key that purchased the Loki Name Service entry.
std::optional<std::string> backup_owner; // The backup public key that the owner specified when purchasing the Loki Name Service entry. Omitted if no backup owner.
@ -2513,7 +2513,7 @@ namespace rpc {
// information use LNS_NAMES_TO_OWNERS instead.
//
// Technical details: the returned value is encrypted using the name itself so that neither this
// lokid responding to the RPC request nor any other blockchain observers can (easily) obtain the
// oxend responding to the RPC request nor any other blockchain observers can (easily) obtain the
// name of registered addresses or the registration details. Thus, from a client's point of view,
// resolving an LNS record involves:
//
@ -2532,7 +2532,7 @@ namespace rpc {
struct request
{
uint16_t type; // The LNS type (mandatory); currently supported values are: 0 = session, 2 = lokinet.
uint16_t type; // The LNS type (mandatory); currently supported values are: 0 = session, 2 = oxennet.
std::string name_hash; // The 32-byte BLAKE2b hash of the name to look up, encoded as 64 hex digits or 44/43 base64 characters (with/without padding).
KV_MAP_SERIALIZABLE

View File

@ -73,7 +73,7 @@ public:
{
if (!base_url_.empty())
set_base_url(std::move(base_url_));
session.SetUserAgent("loki rpc client v" + std::string{LOKI_VERSION_STR});
session.SetUserAgent("oxen rpc client v" + std::string{LOKI_VERSION_STR});
}
/// Sets the base_url to the given one. Will have / appended if it doesn't already end in /. The

View File

@ -581,7 +581,7 @@ namespace cryptonote::rpc {
throw std::logic_error{"Cannot call http_server::start() more than once"};
auto net = m_server.nettype();
m_server_header = "lokid/"s + (m_restricted ? std::to_string(LOKI_VERSION[0]) : std::string{LOKI_VERSION_FULL})
m_server_header = "oxend/"s + (m_restricted ? std::to_string(LOKI_VERSION[0]) : std::string{LOKI_VERSION_FULL})
+ (net == MAINNET ? " mainnet" : net == TESTNET ? " testnet" : net == DEVNET ? " devnet" : net == FAKECHAIN ? " fakenet" : " unknown net");
m_startup_promise.set_value(true);

View File

@ -40,7 +40,7 @@ namespace cryptonote::rpc {
bool http_server_base::check_auth(HttpRequest& req, HttpResponse& res)
{
if (auto www_auth = check_authorization(req.getHeader("authorization"), "lokid rpc",
if (auto www_auth = check_authorization(req.getHeader("authorization"), "oxend rpc",
[this] (const std::string_view user, const std::string_view pass) {
return user == m_login->username && pass == m_login->password.password().view(); }))
{

View File

@ -37,7 +37,7 @@ const command_line::arg_descriptor<std::vector<std::string>> arg_lmq_local_contr
"lmq-local-control",
"Adds an unencrypted LokiMQ RPC listener with full, unrestricted capabilities and no authentication at the given address. "
#ifndef _WIN32
"Listens at ipc://<data-dir>/lokid.sock if not specified. Specify 'none' to disable the default. "
"Listens at ipc://<data-dir>/oxend.sock if not specified. Specify 'none' to disable the default. "
#endif
"WARNING: Do not use this on a publicly accessible address!"};
@ -128,7 +128,7 @@ lmq_rpc::lmq_rpc(cryptonote::core& core, core_rpc_server& rpc, const boost::prog
// windows. In theory we could do some runtime detection to see if the Windows version is new
// enough to support unix domain sockets, but for now the Windows default is just "don't listen"
#ifndef _WIN32
locals.push_back("ipc://" + core.get_config_directory().u8string() + "/lokid.sock");
locals.push_back("ipc://" + core.get_config_directory().u8string() + "/oxend.sock");
#endif
} else if (locals.size() == 1 && locals[0] == "none") {
locals.clear();

View File

@ -36,10 +36,10 @@
*/
#include "common/string_util.h"
#include "loki_economy.h"
#include "oxen_economy.h"
#include <chrono>
#ifdef _WIN32
#define __STDC_FORMAT_MACROS // NOTE(loki): Explicitly define the PRIu64 macro on Mingw
#define __STDC_FORMAT_MACROS // NOTE(oxen): Explicitly define the PRIu64 macro on Mingw
#endif
#include <locale.h>
@ -62,11 +62,11 @@
#include "common/dns_utils.h"
#include "common/base58.h"
#include "common/scoped_message_writer.h"
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
#include "cryptonote_core/service_node_voting.h"
#include "cryptonote_core/service_node_list.h"
#include "cryptonote_core/loki_name_system.h"
#include "cryptonote_core/oxen_name_system.h"
#include "simplewallet.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "rpc/core_rpc_server_commands_defs.h"
@ -142,7 +142,7 @@ namespace
const command_line::arg_descriptor<bool> arg_allow_mismatched_daemon_version = {"allow-mismatched-daemon-version", sw::tr("Allow communicating with a daemon that uses a different RPC version"), false};
const command_line::arg_descriptor<uint64_t> arg_restore_height = {"restore-height", sw::tr("Restore from specific blockchain height"), 0};
const command_line::arg_descriptor<std::string> arg_restore_date = {"restore-date", sw::tr("Restore from estimated blockchain height on specified date"), ""};
const command_line::arg_descriptor<bool> arg_do_not_relay = {"do-not-relay", sw::tr("The newly created transaction will not be relayed to the loki network"), false};
const command_line::arg_descriptor<bool> arg_do_not_relay = {"do-not-relay", sw::tr("The newly created transaction will not be relayed to the oxen network"), false};
const command_line::arg_descriptor<bool> arg_create_address_file = {"create-address-file", sw::tr("Create an address file for new wallets"), false};
const command_line::arg_descriptor<std::string> arg_create_hwdev_txt = {"create-hwdev-txt", sw::tr("Create a .hwdev.txt file for new hardware-backed wallets containing the given comment")};
const command_line::arg_descriptor<std::string> arg_subaddress_lookahead = {"subaddress-lookahead", tools::wallet2::tr("Set subaddress lookahead sizes to <major>:<minor>"), ""};
@ -215,7 +215,7 @@ namespace
const char* USAGE_MMS("mms [<subcommand> [<subcommand_parameters>]]");
const char* USAGE_MMS_INIT("mms init <required_signers>/<authorized_signers> <own_label> <own_transport_address>");
const char* USAGE_MMS_INFO("mms info");
const char* USAGE_MMS_SIGNER("mms signer [<number> <label> [<transport_address> [<loki_address>]]]");
const char* USAGE_MMS_SIGNER("mms signer [<number> <label> [<transport_address> [<oxen_address>]]]");
const char* USAGE_MMS_LIST("mms list");
const char* USAGE_MMS_NEXT("mms next [sync]");
const char* USAGE_MMS_SYNC("mms sync");
@ -255,14 +255,14 @@ namespace
const char* USAGE_REQUEST_STAKE_UNLOCK("request_stake_unlock <service_node_pubkey>");
const char* USAGE_PRINT_LOCKED_STAKES("print_locked_stakes");
const char* USAGE_LNS_BUY_MAPPING("lns_buy_mapping [index=<N1>[,<N2>,...]] [<priority>] [type=session|lokinet|lokinet_2y|lokinet_5y|lokinet_10y] [owner=<value>] [backup_owner=<value>] <name> <value>");
const char* USAGE_LNS_RENEW_MAPPING("lns_renew_mapping [index=<N1>[,<N2>,...]] [<priority>] [type=lokinet|lokinet_2y|lokinet_5y|lokinet_10y] <name>");
const char* USAGE_LNS_UPDATE_MAPPING("lns_update_mapping [index=<N1>[,<N2>,...]] [<priority>] [type=session|lokinet] [owner=<value>] [backup_owner=<value>] [value=<lns_value>] [signature=<hex_signature>] <name>");
const char* USAGE_LNS_BUY_MAPPING("lns_buy_mapping [index=<N1>[,<N2>,...]] [<priority>] [type=session|oxennet|oxennet_2y|oxennet_5y|oxennet_10y] [owner=<value>] [backup_owner=<value>] <name> <value>");
const char* USAGE_LNS_RENEW_MAPPING("lns_renew_mapping [index=<N1>[,<N2>,...]] [<priority>] [type=oxennet|oxennet_2y|oxennet_5y|oxennet_10y] <name>");
const char* USAGE_LNS_UPDATE_MAPPING("lns_update_mapping [index=<N1>[,<N2>,...]] [<priority>] [type=session|oxennet] [owner=<value>] [backup_owner=<value>] [value=<lns_value>] [signature=<hex_signature>] <name>");
const char* USAGE_LNS_ENCRYPT("lns_encrypt [type=session|lokinet] <name> <value>");
const char* USAGE_LNS_MAKE_UPDATE_MAPPING_SIGNATURE("lns_make_update_mapping_signature [type=session|lokinet] [owner=<value>] [backup_owner=<value>] [value=<encrypted_lns_value>] <name>");
const char* USAGE_LNS_ENCRYPT("lns_encrypt [type=session|oxennet] <name> <value>");
const char* USAGE_LNS_MAKE_UPDATE_MAPPING_SIGNATURE("lns_make_update_mapping_signature [type=session|oxennet] [owner=<value>] [backup_owner=<value>] [value=<encrypted_lns_value>] <name>");
const char* USAGE_LNS_PRINT_OWNERS_TO_NAMES("lns_print_owners_to_names [<owner> ...]");
const char* USAGE_LNS_PRINT_NAME_TO_OWNERS("lns_print_name_to_owners [type=session|lokinet] <name> [<name> ...]");
const char* USAGE_LNS_PRINT_NAME_TO_OWNERS("lns_print_name_to_owners [type=session|oxennet] <name> [<name> ...]");
#if defined (LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
std::string input_line(const std::string &prompt, bool yesno = false)
@ -322,7 +322,7 @@ namespace
std::optional<tools::password_container> password_prompter(const char *prompt, bool verify)
{
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
std::cout << prompt << ": NOTE(loki): Passwords not supported, defaulting to empty password";
std::cout << prompt << ": NOTE(oxen): Passwords not supported, defaulting to empty password";
integration_test::write_buffered_stdout();
tools::password_container pwd_container(std::string(""));
#else
@ -1580,7 +1580,7 @@ bool simple_wallet::export_raw_multisig(const std::vector<std::string> &args)
for (auto &ptx: txs.m_ptx)
{
const crypto::hash txid = cryptonote::get_transaction_hash(ptx.tx);
const fs::path fn = fs::u8path("raw_multisig_loki_tx_" + tools::type_to_hex(txid));
const fs::path fn = fs::u8path("raw_multisig_oxen_tx_" + tools::type_to_hex(txid));
if (!filenames.empty())
filenames += ", ";
filenames += fn.u8string();
@ -2128,7 +2128,7 @@ bool simple_wallet::welcome(const std::vector<std::string> &args)
message_writer() << tr("Flaws in Loki may be discovered in the future, and attacks may be developed to peek under some");
message_writer() << tr("of the layers of privacy Loki provides. Be safe and practice defense in depth.");
message_writer() << "";
message_writer() << tr("Welcome to Loki and financial privacy. For more information, see https://loki.network");
message_writer() << tr("Welcome to Loki and financial privacy. For more information, see https://oxen.network");
return true;
}
@ -3122,7 +3122,7 @@ Pending or Failed: "failed"|"pending", "out", Lock, Checkpointed, Time, Amount*
m_cmd_binder.set_handler("register_service_node",
[this](const auto& x) { return register_service_node(x); },
tr(USAGE_REGISTER_SERVICE_NODE),
tr("Send <amount> to this wallet's main account and lock it as an operator stake for a new Service Node. This command is typically generated on the Service Node via the `prepare_registration' lokid command. The optional index= and <priority> parameters work as in the `transfer' command."));
tr("Send <amount> to this wallet's main account and lock it as an operator stake for a new Service Node. This command is typically generated on the Service Node via the `prepare_registration' oxend command. The optional index= and <priority> parameters work as in the `transfer' command."));
m_cmd_binder.set_handler("stake",
[this](const auto& x) { return stake(x); },
tr(USAGE_STAKE),
@ -4297,7 +4297,7 @@ std::optional<epee::wipeable_string> simple_wallet::new_wallet(const boost::prog
"To start synchronizing with the daemon, use the \"refresh\" command.\n"
"Use the \"help\" command to see the list of available commands.\n"
"Use \"help <command>\" to see a command's documentation.\n"
"Always use the \"exit\" command when closing loki-wallet-cli to save \n"
"Always use the \"exit\" command when closing oxen-wallet-cli to save \n"
"your current session's state. Otherwise, you might need to synchronize \n"
"your wallet again (your wallet keys are NOT at risk in any case).\n")
;
@ -5764,7 +5764,7 @@ bool simple_wallet::confirm_and_send_tx(std::vector<cryptonote::address_parse_in
}
else if (m_wallet->multisig())
{
bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_loki_tx");
bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_oxen_tx");
if (!r)
{
fail_msg_writer() << tr("Failed to write transaction(s) to file");
@ -5772,7 +5772,7 @@ bool simple_wallet::confirm_and_send_tx(std::vector<cryptonote::address_parse_in
}
else
{
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_loki_tx";
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_oxen_tx";
}
}
else if (m_wallet->get_account().get_device().has_tx_cold_sign())
@ -5801,7 +5801,7 @@ bool simple_wallet::confirm_and_send_tx(std::vector<cryptonote::address_parse_in
}
else if (m_wallet->watch_only())
{
bool r = m_wallet->save_tx(ptx_vector, "unsigned_loki_tx");
bool r = m_wallet->save_tx(ptx_vector, "unsigned_oxen_tx");
if (!r)
{
fail_msg_writer() << tr("Failed to write transaction(s) to file");
@ -5809,7 +5809,7 @@ bool simple_wallet::confirm_and_send_tx(std::vector<cryptonote::address_parse_in
}
else
{
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_loki_tx";
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_oxen_tx";
}
}
else
@ -5917,7 +5917,7 @@ bool simple_wallet::transfer_main(Transfer transfer_type, const std::vector<std:
}
else
{
if (boost::starts_with(local_args[i], "loki:"))
if (boost::starts_with(local_args[i], "oxen:"))
fail_msg_writer() << tr("Invalid last argument: ") << local_args.back() << ": " << error;
else
fail_msg_writer() << tr("Invalid last argument: ") << local_args.back();
@ -5995,7 +5995,7 @@ bool simple_wallet::transfer_main(Transfer transfer_type, const std::vector<std:
return false;
}
loki_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, txtype::standard, priority);
oxen_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, txtype::standard, priority);
ptx_vector = m_wallet->create_transactions_2(dsts, CRYPTONOTE_DEFAULT_TX_MIXIN, unlock_block, priority, extra, m_current_subaddress_account, subaddr_indices, tx_params);
if (ptx_vector.empty())
@ -6239,8 +6239,8 @@ bool simple_wallet::request_stake_unlock(const std::vector<std::string> &args_)
std::vector<tools::wallet2::pending_tx> ptx_vector = {unlock_result.ptx};
if (m_wallet->watch_only())
{
if (m_wallet->save_tx(ptx_vector, "unsigned_loki_tx"))
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_loki_tx";
if (m_wallet->save_tx(ptx_vector, "unsigned_oxen_tx"))
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_oxen_tx";
else
fail_msg_writer() << tr("Failed to write transaction(s) to file");
@ -6429,9 +6429,9 @@ static std::optional<lns::mapping_type> guess_lns_type(tools::wallet2& wallet, s
{
if (typestr.empty())
{
if (tools::ends_with(name, ".loki") && (tools::ends_with(value, ".loki") || value.empty()))
return lns::mapping_type::lokinet;
if (!tools::ends_with(name, ".loki") && tools::starts_with(value, "05") && value.length() == 2*lns::SESSION_PUBLIC_KEY_BINARY_LENGTH)
if (tools::ends_with(name, ".oxen") && (tools::ends_with(value, ".oxen") || value.empty()))
return lns::mapping_type::oxennet;
if (!tools::ends_with(name, ".oxen") && tools::starts_with(value, "05") && value.length() == 2*lns::SESSION_PUBLIC_KEY_BINARY_LENGTH)
return lns::mapping_type::session;
fail_msg_writer() << tr("Could not infer LNS type from name/value; trying using the type= argument or see `help' for more details");
@ -6511,13 +6511,13 @@ bool simple_wallet::lns_buy_mapping(std::vector<std::string> args)
std::cout << std::endl << tr("Buying Loki Name System Record") << std::endl << std::endl;
if (*type == lns::mapping_type::session)
std::cout << boost::format(tr("Session Name: %s")) % name << std::endl;
else if (lns::is_lokinet_type(*type))
else if (lns::is_oxennet_type(*type))
{
std::cout << boost::format(tr("Lokinet Name: %s")) % name << std::endl;
int years =
*type == lns::mapping_type::lokinet_10years ? 10 :
*type == lns::mapping_type::lokinet_5years ? 5 :
*type == lns::mapping_type::lokinet_2years ? 2 :
*type == lns::mapping_type::oxennet_10years ? 10 :
*type == lns::mapping_type::oxennet_5years ? 5 :
*type == lns::mapping_type::oxennet_2years ? 2 :
1;
int blocks = BLOCKS_EXPECTED_IN_DAYS(years * lns::REGISTRATION_YEAR_DAYS);
std::cout << boost::format(tr("Registration: %d years (%d blocks)")) % years % blocks << "\n";
@ -6605,15 +6605,15 @@ bool simple_wallet::lns_renew_mapping(std::vector<std::string> args)
dsts.push_back(info);
std::cout << "\n" << tr("Renew Loki Name System Record") << "\n\n";
if (lns::is_lokinet_type(type))
if (lns::is_oxennet_type(type))
std::cout << boost::format(tr("Lokinet Name: %s")) % name << "\n";
else
std::cout << boost::format(tr("Name: %s")) % name << "\n";
int years = 1;
if (type == lns::mapping_type::lokinet_2years) years = 2;
else if (type == lns::mapping_type::lokinet_5years) years = 5;
else if (type == lns::mapping_type::lokinet_10years) years = 10;
if (type == lns::mapping_type::oxennet_2years) years = 2;
else if (type == lns::mapping_type::oxennet_5years) years = 5;
else if (type == lns::mapping_type::oxennet_10years) years = 10;
int blocks = BLOCKS_EXPECTED_IN_DAYS(years * lns::REGISTRATION_YEAR_DAYS);
std::cout << boost::format(tr("Renewal years: %d (%d blocks)")) % years % blocks << "\n";
std::cout << boost::format(tr("New expiry: Block %d")) % (*response[0].expiration_height + blocks) << "\n";
@ -6686,8 +6686,8 @@ bool simple_wallet::lns_update_mapping(std::vector<std::string> args)
auto& enc_hex = response[0].encrypted_value;
if (!lokimq::is_hex(enc_hex) || enc_hex.size() % 2 != 0 || enc_hex.size() > 2*lns::mapping_value::BUFFER_SIZE)
{
LOG_ERROR("invalid LNS data returned from lokid");
fail_msg_writer() << tr("invalid LNS data returned from lokid");
LOG_ERROR("invalid LNS data returned from oxend");
fail_msg_writer() << tr("invalid LNS data returned from oxend");
return true;
}
@ -6711,7 +6711,7 @@ bool simple_wallet::lns_update_mapping(std::vector<std::string> args)
std::cout << std::endl << tr("Updating Loki Name System Record") << std::endl << std::endl;
if (type == lns::mapping_type::session)
std::cout << boost::format(tr("Session Name: %s")) % name << std::endl;
else if (lns::is_lokinet_type(type))
else if (lns::is_oxennet_type(type))
std::cout << boost::format(tr("Lokinet Name: %s")) % name << std::endl;
else
std::cout << boost::format(tr("Name: %s")) % name << std::endl;
@ -6926,7 +6926,7 @@ bool simple_wallet::lns_print_name_to_owners(std::vector<std::string> args)
auto& enc_hex = mapping.encrypted_value;
if (mapping.entry_index >= args.size() || !lokimq::is_hex(enc_hex) || enc_hex.size() % 2 != 0 || enc_hex.size() > 2*lns::mapping_value::BUFFER_SIZE)
{
fail_msg_writer() << "Received invalid LNS mapping data from lokid";
fail_msg_writer() << "Received invalid LNS mapping data from oxend";
return false;
}
@ -7136,26 +7136,26 @@ bool simple_wallet::sweep_unmixable(const std::vector<std::string> &args_)
// actually commit the transactions
if (m_wallet->multisig())
{
bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_loki_tx");
bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_oxen_tx");
if (!r)
{
fail_msg_writer() << tr("Failed to write transaction(s) to file");
}
else
{
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_loki_tx";
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_oxen_tx";
}
}
else if (m_wallet->watch_only())
{
bool r = m_wallet->save_tx(ptx_vector, "unsigned_loki_tx");
bool r = m_wallet->save_tx(ptx_vector, "unsigned_oxen_tx");
if (!r)
{
fail_msg_writer() << tr("Failed to write transaction(s) to file");
}
else
{
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_loki_tx";
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_oxen_tx";
}
}
else
@ -7261,14 +7261,14 @@ bool simple_wallet::sweep_main_internal(sweep_type_t sweep_type, std::vector<too
bool submitted_to_network = false;
if (m_wallet->multisig())
{
bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_loki_tx");
bool r = m_wallet->save_multisig_tx(ptx_vector, "multisig_oxen_tx");
if (!r)
{
fail_msg_writer() << tr("Failed to write transaction(s) to file");
}
else
{
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_loki_tx";
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "multisig_oxen_tx";
}
}
else if (m_wallet->get_account().get_device().has_tx_cold_sign())
@ -7298,14 +7298,14 @@ bool simple_wallet::sweep_main_internal(sweep_type_t sweep_type, std::vector<too
}
else if (m_wallet->watch_only())
{
bool r = m_wallet->save_tx(ptx_vector, "unsigned_loki_tx");
bool r = m_wallet->save_tx(ptx_vector, "unsigned_oxen_tx");
if (!r)
{
fail_msg_writer() << tr("Failed to write transaction(s) to file");
}
else
{
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_loki_tx";
success_msg_writer(true) << tr("Unsigned transaction(s) successfully written to file: ") << "unsigned_oxen_tx";
}
}
else
@ -7810,7 +7810,7 @@ bool simple_wallet::sign_transfer(const std::vector<std::string> &args_)
std::vector<tools::wallet2::pending_tx> ptx;
try
{
bool r = m_wallet->sign_tx("unsigned_loki_tx", "signed_loki_tx", ptx, [&](const tools::wallet2::unsigned_tx_set &tx){ return accept_loaded_tx(tx); }, export_raw);
bool r = m_wallet->sign_tx("unsigned_oxen_tx", "signed_oxen_tx", ptx, [&](const tools::wallet2::unsigned_tx_set &tx){ return accept_loaded_tx(tx); }, export_raw);
if (!r)
{
fail_msg_writer() << tr("Failed to sign transaction");
@ -7830,7 +7830,7 @@ bool simple_wallet::sign_transfer(const std::vector<std::string> &args_)
txids_as_text += (", ");
txids_as_text += tools::type_to_hex(get_transaction_hash(t.tx));
}
success_msg_writer(true) << tr("Transaction successfully signed to file ") << "signed_loki_tx" << ", txid " << txids_as_text;
success_msg_writer(true) << tr("Transaction successfully signed to file ") << "signed_oxen_tx" << ", txid " << txids_as_text;
if (export_raw)
{
std::string rawfiles_as_text;
@ -7838,7 +7838,7 @@ bool simple_wallet::sign_transfer(const std::vector<std::string> &args_)
{
if (i > 0)
rawfiles_as_text += ", ";
rawfiles_as_text += "signed_loki_tx_raw" + (ptx.size() == 1 ? "" : ("_" + std::to_string(i)));
rawfiles_as_text += "signed_oxen_tx_raw" + (ptx.size() == 1 ? "" : ("_" + std::to_string(i)));
}
success_msg_writer(true) << tr("Transaction raw hex data exported to ") << rawfiles_as_text;
}
@ -7858,14 +7858,14 @@ bool simple_wallet::submit_transfer(const std::vector<std::string> &args_)
try
{
std::vector<tools::wallet2::pending_tx> ptx_vector;
bool r = m_wallet->load_tx("signed_loki_tx", ptx_vector, [&](const tools::wallet2::signed_tx_set &tx){ return accept_loaded_tx(tx); });
bool r = m_wallet->load_tx("signed_oxen_tx", ptx_vector, [&](const tools::wallet2::signed_tx_set &tx){ return accept_loaded_tx(tx); });
if (!r)
{
fail_msg_writer() << tr("Failed to load transaction from file");
return true;
}
// FIXME: store the blink status in the signed_loki_tx somehow?
// FIXME: store the blink status in the signed_oxen_tx somehow?
constexpr bool FIXME_blink = false;
commit_or_save(ptx_vector, false, FIXME_blink);
@ -8011,7 +8011,7 @@ bool simple_wallet::get_tx_proof(const std::vector<std::string> &args)
try
{
std::string sig_str = m_wallet->get_tx_proof(txid, info.address, info.is_subaddress, args.size() == 3 ? args[2] : "");
const fs::path filename{"loki_tx_proof"};
const fs::path filename{"oxen_tx_proof"};
if (m_wallet->save_to_file(filename, sig_str, true))
success_msg_writer() << tr("signature file saved to: ") << filename.u8string();
else
@ -8223,7 +8223,7 @@ bool simple_wallet::get_spend_proof(const std::vector<std::string> &args)
try
{
const std::string sig_str = m_wallet->get_spend_proof(txid, args.size() == 2 ? args[1] : "");
const fs::path filename{"loki_spend_proof"};
const fs::path filename{"oxen_spend_proof"};
if (m_wallet->save_to_file(filename, sig_str, true))
success_msg_writer() << tr("signature file saved to: ") << filename.u8string();
else
@ -8312,7 +8312,7 @@ bool simple_wallet::get_reserve_proof(const std::vector<std::string> &args)
try
{
const std::string sig_str = m_wallet->get_reserve_proof(account_minreserve, args.size() == 2 ? args[1] : "");
const fs::path filename{"loki_reserve_proof"};
const fs::path filename{"oxen_reserve_proof"};
if (m_wallet->save_to_file(filename, sig_str, true))
success_msg_writer() << tr("signature file saved to: ") << filename.u8string();
else
@ -10168,7 +10168,7 @@ void simple_wallet::interrupt()
void simple_wallet::commit_or_save(std::vector<tools::wallet2::pending_tx>& ptx_vector, bool do_not_relay, bool blink)
{
size_t i = 0;
std::string msg_buf; // NOTE(loki): Buffer output so integration tests read the entire output
std::string msg_buf; // NOTE(oxen): Buffer output so integration tests read the entire output
msg_buf.reserve(128);
while (!ptx_vector.empty())
@ -10181,7 +10181,7 @@ void simple_wallet::commit_or_save(std::vector<tools::wallet2::pending_tx>& ptx_
cryptonote::blobdata blob;
tx_to_blob(ptx.tx, blob);
const std::string blob_hex = lokimq::to_hex(blob);
fs::path filename = fs::u8path("raw_loki_tx");
fs::path filename = fs::u8path("raw_oxen_tx");
if (ptx_vector.size() > 1) filename += "_" + std::to_string(i++);
bool success = m_wallet->save_to_file(filename, blob_hex, true);
@ -10251,13 +10251,13 @@ int main(int argc, char* argv[])
auto [vm, should_terminate] = wallet_args::main(
argc, argv,
"loki-wallet-cli [--wallet-file=<filename>|--generate-new-wallet=<filename>] [<COMMAND>]",
"oxen-wallet-cli [--wallet-file=<filename>|--generate-new-wallet=<filename>] [<COMMAND>]",
sw::tr("This is the command line Loki wallet. It needs to connect to a Loki\ndaemon to work correctly.\n\nWARNING: Do not reuse your Loki keys on a contentious fork, doing so will harm your privacy.\n Only consider reusing your key on a contentious fork if the fork has key reuse mitigations built in."),
desc_params,
hidden_params,
positional_options,
[](const std::string &s, bool emphasis){ tools::scoped_message_writer(emphasis ? epee::console_color_white : epee::console_color_default, true) << s; },
"loki-wallet-cli.log"
"oxen-wallet-cli.log"
);
if (!vm)
@ -10640,7 +10640,7 @@ void simple_wallet::mms_signer(const std::vector<std::string> &args)
}
if ((args.size() < 2) || (args.size() > 4))
{
fail_msg_writer() << tr("mms signer [<number> <label> [<transport_address> [<loki_address>]]]");
fail_msg_writer() << tr("mms signer [<number> <label> [<transport_address> [<oxen_address>]]]");
return;
}

View File

@ -30,7 +30,7 @@
// Parts of this file are originally copyright (c) 2012-2013 The Cryptonote developers
#ifdef _WIN32
#define __STDC_FORMAT_MACROS // NOTE(loki): Explicitly define the PRIu64 macro on Mingw
#define __STDC_FORMAT_MACROS // NOTE(oxen): Explicitly define the PRIu64 macro on Mingw
#endif
#include "wallet.h"
@ -71,7 +71,7 @@ namespace {
fs::path get_default_ringdb_path(cryptonote::network_type nettype)
{
auto dir = tools::get_default_data_dir();
// remove .loki, replace with .shared-ringdb
// remove .oxen, replace with .shared-ringdb
dir.replace_filename(".shared-ringdb");
if (nettype == cryptonote::TESTNET)
dir /= "testnet";
@ -1492,7 +1492,7 @@ PendingTransaction *WalletImpl::createTransactionMultDest(const std::vector<std:
}
if (amount) {
loki_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, txtype::standard, priority);
oxen_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, txtype::standard, priority);
transaction->m_pending_tx = m_wallet->create_transactions_2(dsts, CRYPTONOTE_DEFAULT_TX_MIXIN, 0 /* unlock_time */,
priority,
extra, subaddr_account, subaddr_indices, tx_params);

View File

@ -28,7 +28,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#include "common/loki.h"
#include "common/oxen.h"
#include <string>
#include <cstdint>
#include "epee/serialization/keyvalue_serialization.h"

View File

@ -12,7 +12,7 @@ KV_SERIALIZE_MAP_CODE_BEGIN(transfer_view)
KV_SERIALIZE(note);
KV_SERIALIZE(destinations);
// TODO(loki): This discrepancy between having to use pay_type if type is
// TODO(oxen): This discrepancy between having to use pay_type if type is
// empty and type if pay type is neither is super unintuitive.
if (this_ref.type.empty())
{

View File

@ -28,7 +28,7 @@
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#pragma once
#include "common/loki.h"
#include "common/oxen.h"
#include <string>
#include <vector>
#include "cryptonote_basic/subaddress_index.h"

View File

@ -43,7 +43,7 @@
#include "common/password.h"
#include "common/string_util.h"
#include "cryptonote_basic/tx_extra.h"
#include "cryptonote_core/loki_name_system.h"
#include "cryptonote_core/oxen_name_system.h"
#include "common/rules.h"
#include "cryptonote_config.h"
#include "cryptonote_core/tx_sanity_check.h"
@ -87,9 +87,9 @@
#include "cryptonote_core/service_node_list.h"
#include "cryptonote_core/service_node_rules.h"
#include "common/loki.h"
#include "common/loki_integration_test_hooks.h"
#include "loki_economy.h"
#include "common/oxen.h"
#include "common/oxen_integration_test_hooks.h"
#include "oxen_economy.h"
#include "epee/string_coding.h"
extern "C"
@ -160,7 +160,7 @@ namespace {
std::string get_default_ringdb_path()
{
// remove .loki, replace with .shared-ringdb
// remove .oxen, replace with .shared-ringdb
return tools::get_default_data_dir().replace_filename(".shared-ringdb").u8string();
}
@ -226,7 +226,7 @@ namespace {
}
}
size_t get_num_outputs(const std::vector<cryptonote::tx_destination_entry> &dsts, const std::vector<tools::wallet2::transfer_details> &transfers, const std::vector<size_t> &selected_transfers, const loki_construct_tx_params& tx_params)
size_t get_num_outputs(const std::vector<cryptonote::tx_destination_entry> &dsts, const std::vector<tools::wallet2::transfer_details> &transfers, const std::vector<size_t> &selected_transfers, const oxen_construct_tx_params& tx_params)
{
size_t outputs = dsts.size();
uint64_t needed_money = 0;
@ -237,14 +237,14 @@ namespace {
found_money += transfers[idx].amount();
if (found_money != needed_money)
++outputs; // change
if (outputs < (tx_params.tx_type == cryptonote::txtype::loki_name_system ? 1 : 2))
if (outputs < (tx_params.tx_type == cryptonote::txtype::oxen_name_system ? 1 : 2))
++outputs; // extra 0 dummy output
return outputs;
}
// Create on-demand to prevent static initialization order fiasco issues.
struct options {
const command_line::arg_descriptor<std::string> daemon_address = {"daemon-address", tools::wallet2::tr("Use lokid RPC at [http://]<host>[:<port>]"), ""};
const command_line::arg_descriptor<std::string> daemon_address = {"daemon-address", tools::wallet2::tr("Use oxend RPC at [http://]<host>[:<port>]"), ""};
const command_line::arg_descriptor<std::string> daemon_login = {"daemon-login", tools::wallet2::tr("Specify username[:password] for daemon RPC client"), "", true};
const command_line::arg_descriptor<std::string> proxy = {"proxy", tools::wallet2::tr("Use socks proxy at [socks4a://]<ip>:<port> for daemon connections"), "", true};
const command_line::arg_descriptor<bool> trusted_daemon = {"trusted-daemon", tools::wallet2::tr("Enable commands which rely on a trusted daemon"), false};
@ -1110,7 +1110,7 @@ std::vector<std::string> wallet2::has_deprecated_options(const boost::program_op
{
std::vector<std::string> warnings;
// These are deprecated as of loki 8.x:
// These are deprecated as of oxen 8.x:
if (!command_line::is_arg_defaulted(vm, options().daemon_host))
warnings.emplace_back("--daemon-host. Use '--daemon-address http://HOSTNAME' instead");
if (!command_line::is_arg_defaulted(vm, options().daemon_port))
@ -1860,7 +1860,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
// stored into m_transfers so we cannot determine if the entry in m_transfers
// came from this transaction or a previous transaction.
// TODO(loki): This case might be feasible at all where a key image is
// TODO(oxen): This case might be feasible at all where a key image is
// duplicated in the _same_ tx in different output indexes, because the
// algorithm for making a key image uses the output index. Investigate, and if
// it's not feasible to construct a malicious one without absolutely breaking
@ -1957,7 +1957,7 @@ void wallet2::process_new_transaction(const crypto::hash &txid, const cryptonote
continue;
}
// NOTE(loki): (miner_tx && m_refresh_type == RefreshOptimiseCoinbase) used
// NOTE(oxen): (miner_tx && m_refresh_type == RefreshOptimiseCoinbase) used
// to be an optimisation step that checks if the first output was destined
// for us otherwise skip. This is not possible for us because our
// block-reward now always has more than 1 output, mining, service node
@ -2996,7 +2996,7 @@ bool wallet2::long_poll_pool_state()
// How long we sleep (and thus prevent retrying the connection) if we get an error
const auto error_sleep = m_long_poll_local ? 500ms : 3s;
// How long we wait for a long poll response before timing out; we add a 5s buffer to the usual
// timeout to allow for network latency and lokid response time.
// timeout to allow for network latency and oxend response time.
m_long_poll_client.set_timeout(cryptonote::rpc::GET_TRANSACTION_POOL_HASHES_BIN::long_poll_timeout + 5s);
using namespace cryptonote::rpc;
@ -5002,7 +5002,7 @@ std::string wallet2::make_multisig(const epee::wipeable_string &password,
// decrypt keys
bool reencrypt = false;
crypto::chacha_key chacha_key;
auto keys_reencryptor = loki::defer([&] {
auto keys_reencryptor = oxen::defer([&] {
if (reencrypt)
{
m_account.encrypt_keys(chacha_key);
@ -6603,7 +6603,7 @@ bool wallet2::is_transfer_unlocked(uint64_t unlock_time, uint64_t block_height,
auto blockchain_height = get_blockchain_current_height();
if (block_height == 0 && unmined_blink)
{
// TODO(loki): this restriction will go away when we add Reblink support, but for now received
// TODO(oxen): this restriction will go away when we add Reblink support, but for now received
// blinks still have to be mined and confirmed like regular transactions before they can be
// spent (blink without reblink just gives you a guarantee that they will be mined).
//
@ -6621,7 +6621,7 @@ bool wallet2::is_transfer_unlocked(uint64_t unlock_time, uint64_t block_height,
if (m_offline)
return true;
if (!key_image) // TODO(loki): Try make all callees always pass in a key image for accuracy
if (!key_image) // TODO(oxen): Try make all callees always pass in a key image for accuracy
return true;
{
@ -7135,7 +7135,7 @@ bool wallet2::sign_tx(unsigned_tx_set &exported_txs, std::vector<wallet2::pendin
std::vector<crypto::secret_key> additional_tx_keys;
rct::multisig_out msout;
loki_construct_tx_params tx_params;
oxen_construct_tx_params tx_params;
tx_params.hf_version = sd.hf_version;
tx_params.tx_type = sd.tx_type;
bool r = cryptonote::construct_tx_and_get_tx_key(m_account.get_keys(), m_subaddresses, sd.sources, sd.splitted_dsts, sd.change_dts, sd.extra, ptx.tx, sd.unlock_time, tx_key, additional_tx_keys, rct_config, m_multisig ? &msout : NULL, tx_params);
@ -7607,7 +7607,7 @@ bool wallet2::sign_multisig_tx(multisig_tx_set &exported_txs, std::vector<crypto
rct::multisig_out msout = ptx.multisig_sigs.front().msout;
auto sources = sd.sources;
loki_construct_tx_params tx_params;
oxen_construct_tx_params tx_params;
tx_params.hf_version = sd.hf_version;
tx_params.tx_type = sd.tx_type;
rct::RCTConfig rct_config = sd.rct_config;
@ -7789,13 +7789,13 @@ uint64_t wallet2::get_fee_quantization_mask() const
return 1;
}
loki_construct_tx_params wallet2::construct_params(uint8_t hf_version, txtype tx_type, uint32_t priority, lns::mapping_type type)
oxen_construct_tx_params wallet2::construct_params(uint8_t hf_version, txtype tx_type, uint32_t priority, lns::mapping_type type)
{
loki_construct_tx_params tx_params;
oxen_construct_tx_params tx_params;
tx_params.hf_version = hf_version;
tx_params.tx_type = tx_type;
if (tx_type == txtype::loki_name_system)
if (tx_type == txtype::oxen_name_system)
{
assert(priority != tools::tx_priority_blink);
tx_params.burn_fixed = lns::burn_needed(hf_version, type);
@ -8155,7 +8155,7 @@ wallet2::stake_result wallet2::check_stake_allowed(const crypto::public_key& sn_
result.msg.reserve(128);
result.msg = tr("You must contribute at least ");
result.msg += print_money(min_contrib_total);
result.msg += tr(" loki to become a contributor for this service node.");
result.msg += tr(" oxen to become a contributor for this service node.");
return result;
}
}
@ -8164,7 +8164,7 @@ wallet2::stake_result wallet2::check_stake_allowed(const crypto::public_key& sn_
{
result.msg += tr("You may only contribute up to ");
result.msg += print_money(max_contrib_total);
result.msg += tr(" more loki to this service node. ");
result.msg += tr(" more oxen to this service node. ");
result.msg += tr("Reducing your stake from ");
result.msg += print_money(amount);
result.msg += tr(" to ");
@ -8245,7 +8245,7 @@ wallet2::stake_result wallet2::create_stake_tx(const crypto::public_key& service
return result;
}
loki_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, txtype::stake, priority);
oxen_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, txtype::stake, priority);
auto ptx_vector = create_transactions_2(dsts, CRYPTONOTE_DEFAULT_TX_MIXIN, unlock_at_block, priority, extra, 0, subaddr_indices, tx_params);
if (ptx_vector.size() == 1)
{
@ -8486,11 +8486,11 @@ wallet2::register_service_node_result wallet2::create_register_service_node_tx(c
try
{
// NOTE(loki): We know the address should always be a primary address and has no payment id, so we can ignore the subaddress/payment id field here
// NOTE(oxen): We know the address should always be a primary address and has no payment id, so we can ignore the subaddress/payment id field here
cryptonote::address_parse_info dest = {};
dest.address = address;
loki_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, txtype::stake, priority);
oxen_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, txtype::stake, priority);
auto ptx_vector = create_transactions_2(dsts, CRYPTONOTE_DEFAULT_TX_MIXIN, 0 /* unlock_time */, priority, extra, subaddr_account, subaddr_indices, tx_params);
if (ptx_vector.size() == 1)
{
@ -8680,7 +8680,7 @@ static bool try_generate_lns_signature(wallet2 const &wallet, std::string const
return true;
}
static lns_prepared_args prepare_tx_extra_loki_name_system_values(wallet2 const &wallet,
static lns_prepared_args prepare_tx_extra_oxen_name_system_values(wallet2 const &wallet,
lns::mapping_type type,
uint32_t priority,
std::string name,
@ -8804,7 +8804,7 @@ std::vector<wallet2::pending_tx> wallet2::lns_create_buy_mapping_tx(lns::mapping
{
std::vector<cryptonote::rpc::LNS_NAMES_TO_OWNERS::response_entry> response;
constexpr bool make_signature = false;
lns_prepared_args prepared_args = prepare_tx_extra_loki_name_system_values(*this, type, priority, name, &value, owner, backup_owner, make_signature, lns::lns_tx_type::buy, account_index, reason, &response);
lns_prepared_args prepared_args = prepare_tx_extra_oxen_name_system_values(*this, type, priority, name, &value, owner, backup_owner, make_signature, lns::lns_tx_type::buy, account_index, reason, &response);
if (!owner)
prepared_args.owner = lns::make_monero_owner(get_subaddress({account_index, 0}), account_index != 0);
@ -8812,14 +8812,14 @@ std::vector<wallet2::pending_tx> wallet2::lns_create_buy_mapping_tx(lns::mapping
return {};
std::vector<uint8_t> extra;
auto entry = cryptonote::tx_extra_loki_name_system::make_buy(
auto entry = cryptonote::tx_extra_oxen_name_system::make_buy(
prepared_args.owner,
backup_owner ? &prepared_args.backup_owner : nullptr,
type,
prepared_args.name_hash,
prepared_args.encrypted_value.to_string(),
prepared_args.prev_txid);
add_loki_name_system_to_tx_extra(extra, entry);
add_oxen_name_system_to_tx_extra(extra, entry);
std::optional<uint8_t> hf_version = get_hard_fork_version();
if (!hf_version)
@ -8828,7 +8828,7 @@ std::vector<wallet2::pending_tx> wallet2::lns_create_buy_mapping_tx(lns::mapping
return {};
}
loki_construct_tx_params tx_params = wallet2::construct_params(*hf_version, txtype::loki_name_system, priority, type);
oxen_construct_tx_params tx_params = wallet2::construct_params(*hf_version, txtype::oxen_name_system, priority, type);
auto result = create_transactions_2({} /*dests*/,
CRYPTONOTE_DEFAULT_TX_MIXIN,
0 /*unlock_at_block*/,
@ -8866,17 +8866,17 @@ std::vector<wallet2::pending_tx> wallet2::lns_create_renewal_tx(
)
{
constexpr bool make_signature = false;
lns_prepared_args prepared_args = prepare_tx_extra_loki_name_system_values(*this, type, priority, name, nullptr, nullptr, nullptr, make_signature, lns::lns_tx_type::renew, account_index, reason, response);
lns_prepared_args prepared_args = prepare_tx_extra_oxen_name_system_values(*this, type, priority, name, nullptr, nullptr, nullptr, make_signature, lns::lns_tx_type::renew, account_index, reason, response);
if (!prepared_args)
return {};
std::vector<uint8_t> extra;
auto entry = cryptonote::tx_extra_loki_name_system::make_renew(
auto entry = cryptonote::tx_extra_oxen_name_system::make_renew(
type,
prepared_args.name_hash,
prepared_args.prev_txid);
add_loki_name_system_to_tx_extra(extra, entry);
add_oxen_name_system_to_tx_extra(extra, entry);
std::optional<uint8_t> hf_version = get_hard_fork_version();
if (!hf_version)
@ -8885,7 +8885,7 @@ std::vector<wallet2::pending_tx> wallet2::lns_create_renewal_tx(
return {};
}
loki_construct_tx_params tx_params = wallet2::construct_params(*hf_version, txtype::loki_name_system, priority, type);
oxen_construct_tx_params tx_params = wallet2::construct_params(*hf_version, txtype::oxen_name_system, priority, type);
auto result = create_transactions_2({} /*dests*/,
CRYPTONOTE_DEFAULT_TX_MIXIN,
0 /*unlock_at_block*/,
@ -8917,7 +8917,7 @@ std::vector<wallet2::pending_tx> wallet2::lns_create_update_mapping_tx(lns::mapp
}
bool make_signature = signature == nullptr;
lns_prepared_args prepared_args = prepare_tx_extra_loki_name_system_values(*this, type, priority, name, value, owner, backup_owner, make_signature, lns::lns_tx_type::update, account_index, reason, response);
lns_prepared_args prepared_args = prepare_tx_extra_oxen_name_system_values(*this, type, priority, name, value, owner, backup_owner, make_signature, lns::lns_tx_type::update, account_index, reason, response);
if (!prepared_args) return {};
if (!make_signature)
@ -8930,21 +8930,21 @@ std::vector<wallet2::pending_tx> wallet2::lns_create_update_mapping_tx(lns::mapp
}
std::vector<uint8_t> extra;
auto entry = cryptonote::tx_extra_loki_name_system::make_update(prepared_args.signature,
auto entry = cryptonote::tx_extra_oxen_name_system::make_update(prepared_args.signature,
type,
prepared_args.name_hash,
prepared_args.encrypted_value.to_view(),
owner ? &prepared_args.owner : nullptr,
backup_owner ? &prepared_args.backup_owner : nullptr,
prepared_args.prev_txid);
add_loki_name_system_to_tx_extra(extra, entry);
add_oxen_name_system_to_tx_extra(extra, entry);
std::optional<uint8_t> hf_version = get_hard_fork_version();
if (!hf_version)
{
if (reason) *reason = ERR_MSG_NETWORK_VERSION_QUERY_FAILED;
return {};
}
loki_construct_tx_params tx_params = wallet2::construct_params(*hf_version, txtype::loki_name_system, priority, lns::mapping_type::update_record_internal);
oxen_construct_tx_params tx_params = wallet2::construct_params(*hf_version, txtype::oxen_name_system, priority, lns::mapping_type::update_record_internal);
auto result = create_transactions_2({} /*dests*/,
CRYPTONOTE_DEFAULT_TX_MIXIN,
@ -8994,7 +8994,7 @@ bool wallet2::lns_make_update_mapping_signature(lns::mapping_type type,
{
std::vector<cryptonote::rpc::LNS_NAMES_TO_OWNERS::response_entry> response;
constexpr bool make_signature = true;
lns_prepared_args prepared_args = prepare_tx_extra_loki_name_system_values(*this, type, tx_priority_unimportant, name, value, owner, backup_owner, make_signature, lns::lns_tx_type::update, account_index, reason, &response);
lns_prepared_args prepared_args = prepare_tx_extra_oxen_name_system_values(*this, type, tx_priority_unimportant, name, value, owner, backup_owner, make_signature, lns::lns_tx_type::update, account_index, reason, &response);
if (!prepared_args) return false;
if (prepared_args.prev_txid == crypto::null_hash)
@ -9027,7 +9027,7 @@ bool wallet2::tx_add_fake_output(std::vector<std::vector<tools::wallet2::get_out
// check the keys are valid
if (!rct::isInMainSubgroup(rct::pk2rct(output_public_key)))
{
// TODO(loki): FIXME(loki): Payouts to the null service node address are
// TODO(oxen): FIXME(oxen): Payouts to the null service node address are
// transactions constructed with an invalid public key and fail this check.
// Technically we should not be mixing them- but in test environments like
@ -9834,7 +9834,7 @@ void wallet2::get_outs(std::vector<std::vector<tools::wallet2::get_outs_entry>>
void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry> dsts, const std::vector<size_t>& selected_transfers, size_t fake_outputs_count,
std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
uint64_t unlock_time, uint64_t fee, const std::vector<uint8_t>& extra, cryptonote::transaction& tx, pending_tx &ptx, const rct::RCTConfig &rct_config, const loki_construct_tx_params &tx_params)
uint64_t unlock_time, uint64_t fee, const std::vector<uint8_t>& extra, cryptonote::transaction& tx, pending_tx &ptx, const rct::RCTConfig &rct_config, const oxen_construct_tx_params &tx_params)
{
// throw if attempting a transaction with no destinations
THROW_WALLET_EXCEPTION_IF(dsts.empty(), error::zero_destination);
@ -9848,7 +9848,7 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry
// throw if total amount overflows uint64_t
for(auto& dt: dsts)
{
THROW_WALLET_EXCEPTION_IF(0 == dt.amount && (tx_params.tx_type != txtype::loki_name_system), error::zero_destination);
THROW_WALLET_EXCEPTION_IF(0 == dt.amount && (tx_params.tx_type != txtype::oxen_name_system), error::zero_destination);
needed_money += dt.amount;
LOG_PRINT_L2("transfer: adding " << print_money(dt.amount) << ", for a total of " << print_money (needed_money));
THROW_WALLET_EXCEPTION_IF(needed_money < dt.amount, error::tx_sum_overflow, dsts, fee, m_nettype);
@ -10002,7 +10002,7 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry
bool update_splitted_dsts = true;
if (change_dts.amount == 0)
{
if (splitted_dsts.size() == 1 || tx.type == txtype::loki_name_system)
if (splitted_dsts.size() == 1 || tx.type == txtype::oxen_name_system)
{
// If the change is 0, send it to a random address, to avoid confusing
// the sender with a 0 amount output. We send a 0 amount in order to avoid
@ -10031,7 +10031,7 @@ void wallet2::transfer_selected_rct(std::vector<cryptonote::tx_destination_entry
// NOTE: If LNS, there's already a dummy destination entry in there that
// we placed in (for fake calculating the TX fees and parts) that we
// repurpose for change after the fact.
if (tx_params.tx_type == txtype::loki_name_system)
if (tx_params.tx_type == txtype::oxen_name_system)
{
assert(splitted_dsts.size() == 1);
splitted_dsts.back() = change_dts;
@ -10589,7 +10589,7 @@ void wallet2::light_wallet_get_address_txs()
address_tx.m_block_height = t.height;
address_tx.m_unlock_time = t.unlock_time;
address_tx.m_timestamp = t.timestamp;
address_tx.m_type = t.coinbase ? wallet::pay_type::miner : wallet::pay_type::in; // TODO(loki): Only accounts for miner, but wait, do we even care about this code? Looks like openmonero code
address_tx.m_type = t.coinbase ? wallet::pay_type::miner : wallet::pay_type::in; // TODO(oxen): Only accounts for miner, but wait, do we even care about this code? Looks like openmonero code
address_tx.m_mempool = t.mempool;
m_light_wallet_address_txs.emplace(tx_hash,address_tx);
@ -10605,7 +10605,7 @@ void wallet2::light_wallet_get_address_txs()
payment.m_block_height = t.height;
payment.m_unlock_time = t.unlock_time;
payment.m_timestamp = t.timestamp;
payment.m_type = t.coinbase ? wallet::pay_type::miner : wallet::pay_type::in; // TODO(loki): Only accounts for miner, but wait, do we even care about this code? Looks like openmonero code
payment.m_type = t.coinbase ? wallet::pay_type::miner : wallet::pay_type::in; // TODO(oxen): Only accounts for miner, but wait, do we even care about this code? Looks like openmonero code
if (t.mempool) {
if (std::find(unconfirmed_payments_txs.begin(), unconfirmed_payments_txs.end(), tx_hash) == unconfirmed_payments_txs.end()) {
@ -10794,18 +10794,18 @@ static constexpr uint64_t BURN_FEE_PLACEHOLDER = (1ULL << (6*7)) - 1;
// This system allows for sending (almost) the entire balance, since it does
// not generate spurious change in all txes, thus decreasing the instantaneous
// usable balance.
std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra_base, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, loki_construct_tx_params &tx_params)
std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra_base, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, oxen_construct_tx_params &tx_params)
{
//ensure device is let in NONE mode in any case
hw::device &hwdev = m_account.get_device();
std::unique_lock hwdev_lock{hwdev};
hw::mode_resetter rst{hwdev};
bool const is_lns_tx = (tx_params.tx_type == txtype::loki_name_system);
bool const is_lns_tx = (tx_params.tx_type == txtype::oxen_name_system);
auto original_dsts = dsts;
if (is_lns_tx)
{
THROW_WALLET_EXCEPTION_IF(dsts.size() != 0, error::wallet_internal_error, "loki name system txs must not have any destinations set, has: " + std::to_string(dsts.size()));
THROW_WALLET_EXCEPTION_IF(dsts.size() != 0, error::wallet_internal_error, "oxen name system txs must not have any destinations set, has: " + std::to_string(dsts.size()));
dsts.emplace_back(0, account_public_address{} /*address*/, false /*is_subaddress*/); // NOTE: Create a dummy dest that gets repurposed into the change output.
}
@ -10914,7 +10914,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_2(std::vector<cryp
// early out if we know we can't make it anyway
// we could also check for being within FEE_PER_KB, but if the fee calculation
// ever changes, this might be missed, so let this go through
const uint64_t min_outputs = tx_params.tx_type == cryptonote::txtype::loki_name_system ? 1 : 2; // if lns, only request the change output
const uint64_t min_outputs = tx_params.tx_type == cryptonote::txtype::oxen_name_system ? 1 : 2; // if lns, only request the change output
{
uint64_t min_fee = (
base_fee.first * estimate_rct_tx_size(1, fake_outs_count, min_outputs, extra.size(), clsag) +
@ -11532,15 +11532,15 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton
std::optional<uint8_t> hf_version = get_hard_fork_version();
THROW_WALLET_EXCEPTION_IF(!hf_version, error::get_hard_fork_version_error, "Failed to query current hard fork version");
loki_construct_tx_params loki_tx_params = tools::wallet2::construct_params(*hf_version, tx_type, priority);
oxen_construct_tx_params oxen_tx_params = tools::wallet2::construct_params(*hf_version, tx_type, priority);
uint64_t burn_fixed = 0, burn_percent = 0;
// Swap these out because we don't want them present for building intermediate temporary tx
// calculations (which we don't actually use); we'll set them again at the end before we build the
// real transactions.
std::swap(burn_fixed, loki_tx_params.burn_fixed);
std::swap(burn_percent, loki_tx_params.burn_percent);
std::swap(burn_fixed, oxen_tx_params.burn_fixed);
std::swap(burn_percent, oxen_tx_params.burn_percent);
bool burning = burn_fixed || burn_percent;
THROW_WALLET_EXCEPTION_IF(burning && loki_tx_params.hf_version < HF_VERSION_FEE_BURNING, error::wallet_internal_error, "cannot construct transaction: cannot burn amounts under the current hard fork");
THROW_WALLET_EXCEPTION_IF(burning && oxen_tx_params.hf_version < HF_VERSION_FEE_BURNING, error::wallet_internal_error, "cannot construct transaction: cannot burn amounts under the current hard fork");
std::vector<uint8_t> extra_plus; // Copy and modified from input if modification needed
const std::vector<uint8_t> &extra = burning ? extra_plus : extra_base;
if (burning)
@ -11607,7 +11607,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton
cryptonote::transaction test_tx;
pending_tx test_ptx;
const size_t num_outputs = get_num_outputs(tx.dsts, m_transfers, tx.selected_transfers, loki_tx_params);
const size_t num_outputs = get_num_outputs(tx.dsts, m_transfers, tx.selected_transfers, oxen_tx_params);
needed_fee = estimate_fee(tx.selected_transfers.size(), fake_outs_count, num_outputs, extra.size(), clsag, base_fee, fee_percent, fixed_fee, fee_quantization_mask);
// add N - 1 outputs for correct initial fee estimation
@ -11617,7 +11617,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton
LOG_PRINT_L2("Trying to create a tx now, with " << tx.dsts.size() << " destinations and " <<
tx.selected_transfers.size() << " outputs");
transfer_selected_rct(tx.dsts, tx.selected_transfers, fake_outs_count, outs, unlock_time, needed_fee, extra,
test_tx, test_ptx, rct_config, loki_tx_params);
test_tx, test_ptx, rct_config, oxen_tx_params);
auto txBlob = t_serializable_object_to_blob(test_ptx.tx);
needed_fee = calculate_fee(test_ptx.tx, txBlob.size(), base_fee, fee_percent, fixed_fee, fee_quantization_mask);
available_for_fee = test_ptx.fee + test_ptx.change_dts.amount;
@ -11650,7 +11650,7 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton
dt.amount = dt_amount + dt_residue;
}
transfer_selected_rct(tx.dsts, tx.selected_transfers, fake_outs_count, outs, unlock_time, needed_fee, extra,
test_tx, test_ptx, rct_config, loki_tx_params);
test_tx, test_ptx, rct_config, oxen_tx_params);
txBlob = t_serializable_object_to_blob(test_ptx.tx);
needed_fee = calculate_fee(test_ptx.tx, txBlob.size(), base_fee, fee_percent, fixed_fee, fee_quantization_mask);
LOG_PRINT_L2("Made an attempt at a final " << get_weight_string(test_ptx.tx, txBlob.size()) << " tx, with " << print_money(test_ptx.fee) <<
@ -11686,14 +11686,14 @@ std::vector<wallet2::pending_tx> wallet2::create_transactions_from(const crypton
// fee percent)
if (burning)
{
loki_tx_params.burn_fixed = burn_fixed + tx.needed_fee * burn_percent / fee_percent;
oxen_tx_params.burn_fixed = burn_fixed + tx.needed_fee * burn_percent / fee_percent;
// Make sure we can't enlarge the tx because that could make it invalid:
THROW_WALLET_EXCEPTION_IF(loki_tx_params.burn_fixed > BURN_FEE_PLACEHOLDER, error::wallet_internal_error, "attempt to burn a larger amount than is internally supported");
THROW_WALLET_EXCEPTION_IF(oxen_tx_params.burn_fixed > BURN_FEE_PLACEHOLDER, error::wallet_internal_error, "attempt to burn a larger amount than is internally supported");
}
cryptonote::transaction test_tx;
pending_tx test_ptx;
transfer_selected_rct(tx.dsts, tx.selected_transfers, fake_outs_count, tx.outs, unlock_time, tx.needed_fee, extra, test_tx, test_ptx, rct_config, loki_tx_params);
transfer_selected_rct(tx.dsts, tx.selected_transfers, fake_outs_count, tx.outs, unlock_time, tx.needed_fee, extra, test_tx, test_ptx, rct_config, oxen_tx_params);
auto txBlob = t_serializable_object_to_blob(test_ptx.tx);
tx.tx = test_tx;
tx.ptx = test_ptx;
@ -12837,7 +12837,7 @@ bool wallet2::check_reserve_proof(const cryptonote::account_public_address &addr
const cryptonote::txout_to_key* const out_key = std::get_if<cryptonote::txout_to_key>(std::addressof(tx.vout[proof.index_in_tx].target));
THROW_WALLET_EXCEPTION_IF(!out_key, error::wallet_internal_error, "Output key wasn't found");
// TODO(loki): We should make a catch-all function that gets all the public
// TODO(oxen): We should make a catch-all function that gets all the public
// keys out into an array and iterate through all insteaad of multiple code
// paths for additional keys and the main public key storage which can then
// have multiple keys ..
@ -12848,11 +12848,11 @@ bool wallet2::check_reserve_proof(const cryptonote::account_public_address &addr
const bool is_miner = tx.vin.size() == 1 && std::holds_alternative<cryptonote::txin_gen>(tx.vin[0]);
if (is_miner)
{
// NOTE(loki): The service node reward is added as a duplicate TX public
// NOTE(oxen): The service node reward is added as a duplicate TX public
// key instead of into the additional public key, so we need to check upto
// 2 public keys when we're checking miner transactions.
// TODO(loki): This might still be broken for governance rewards since it uses a deterministic key iirc.
// TODO(oxen): This might still be broken for governance rewards since it uses a deterministic key iirc.
crypto::public_key main_keys[2] = {
get_tx_pub_key_from_extra(tx, 0),
get_tx_pub_key_from_extra(tx, 1),
@ -13320,7 +13320,7 @@ std::pair<size_t, std::vector<std::pair<crypto::key_image, crypto::signature>>>
crypto::public_key tx_pub_key;
if (!try_get_tx_pub_key_using_td(td, tx_pub_key))
{
// TODO(doyle): TODO(loki): Fallback to old get tx pub key method for
// TODO(doyle): TODO(oxen): Fallback to old get tx pub key method for
// incase for now. But we need to go find out why we can't just use
// td.m_pk_index for everything? If we were able to decode the output
// using that, why not use it for everthing?
@ -13450,7 +13450,7 @@ uint64_t wallet2::import_key_images(const std::vector<std::pair<crypto::key_imag
error::wallet_internal_error, "Key image out of validity domain: input " + std::to_string(n + offset) + "/"
+ std::to_string(signed_key_images.size()) + ", key image " + key_image_str);
// TODO(loki): This can fail in a worse-case scenario. We re-sort blinks
// TODO(oxen): This can fail in a worse-case scenario. We re-sort blinks
// when they arrive out of order (i.e. blink is confirmed in mempool and
// gets inserted into m_transfers in a different order from the order they
// are committed to the blockchain).
@ -13862,7 +13862,7 @@ process:
crypto::public_key tx_pub_key;
if (!try_get_tx_pub_key_using_td(td, tx_pub_key))
{
// TODO(doyle): TODO(loki): Fallback to old get tx pub key method for
// TODO(doyle): TODO(oxen): Fallback to old get tx pub key method for
// incase for now. But we need to go find out why we can't just use
// td.m_pk_index for everything? If we were able to decode the output
// using that, why not use it for everthing?
@ -14047,7 +14047,7 @@ crypto::key_image wallet2::get_multisig_composite_key_image(size_t n) const
crypto::public_key tx_key;
if (!try_get_tx_pub_key_using_td(td, tx_key))
{
// TODO(doyle): TODO(loki): Fallback to old get tx pub key method for
// TODO(doyle): TODO(oxen): Fallback to old get tx pub key method for
// incase for now. But we need to go find out why we can't just use
// td.m_pk_index for everything? If we were able to decode the output
// using that, why not use it for everthing?
@ -14317,7 +14317,7 @@ epee::wipeable_string wallet2::decrypt_with_view_secret_key(std::string_view cip
return decrypt(ciphertext, get_account().get_keys().m_view_secret_key, authenticated);
}
static constexpr auto uri_prefix = "loki:"sv;
static constexpr auto uri_prefix = "oxen:"sv;
//----------------------------------------------------------------------------------------------------
std::string wallet2::make_uri(const std::string &address, const std::string &payment_id, uint64_t amount, const std::string &tx_description, const std::string &recipient_name, std::string &error) const
@ -14608,7 +14608,7 @@ bool wallet2::generate_signature_for_request_stake_unlock(const crypto::key_imag
crypto::public_key tx_pub_key;
if (!try_get_tx_pub_key_using_td(td, tx_pub_key))
{
// TODO(doyle): TODO(loki): Fallback to old get tx pub key method for
// TODO(doyle): TODO(oxen): Fallback to old get tx pub key method for
// incase for now. But we need to go find out why we can't just use
// td.m_pk_index for everything? If we were able to decode the output
// using that, why not use it for everthing?

View File

@ -47,7 +47,7 @@
#include "rpc/core_rpc_server_commands_defs.h"
#include "cryptonote_basic/cryptonote_format_utils.h"
#include "cryptonote_core/cryptonote_tx_utils.h"
#include "cryptonote_core/loki_name_system.h"
#include "cryptonote_core/oxen_name_system.h"
#include "common/unordered_containers_boost_serialization.h"
#include "common/file.h"
#include "crypto/chacha.h"
@ -72,7 +72,7 @@
#include "pending_tx.h"
#include "multisig_sig.h"
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
#include "epee/wipeable_string.h"
#include "rpc/http_client.h"
@ -369,7 +369,7 @@ private:
std::vector<cryptonote::tx_destination_entry> m_dests;
crypto::hash m_payment_id;
uint64_t m_timestamp;
uint64_t m_unlock_time; // NOTE(loki): Not used after TX v2.
uint64_t m_unlock_time; // NOTE(oxen): Not used after TX v2.
std::vector<uint64_t> m_unlock_times;
uint32_t m_subaddr_account; // subaddress account of your wallet to be used in this transfer
std::set<uint32_t> m_subaddr_indices; // set of address indices used as inputs in this transfer
@ -734,7 +734,7 @@ private:
uint64_t unlocked_balance_all(bool strict, uint64_t *blocks_to_unlock = NULL, uint64_t *time_to_unlock = NULL) const;
void transfer_selected_rct(std::vector<cryptonote::tx_destination_entry> dsts, const std::vector<size_t>& selected_transfers, size_t fake_outputs_count,
std::vector<std::vector<tools::wallet2::get_outs_entry>> &outs,
uint64_t unlock_time, uint64_t fee, const std::vector<uint8_t>& extra, cryptonote::transaction& tx, pending_tx &ptx, const rct::RCTConfig &rct_config, const cryptonote::loki_construct_tx_params &loki_tx_params);
uint64_t unlock_time, uint64_t fee, const std::vector<uint8_t>& extra, cryptonote::transaction& tx, pending_tx &ptx, const rct::RCTConfig &rct_config, const cryptonote::oxen_construct_tx_params &oxen_tx_params);
void commit_tx(pending_tx& ptx_vector, bool blink = false);
void commit_tx(std::vector<pending_tx>& ptx_vector, bool blink = false);
@ -756,7 +756,7 @@ private:
bool parse_unsigned_tx_from_str(std::string_view unsigned_tx_st, unsigned_tx_set &exported_txs) const;
bool load_tx(const fs::path& signed_filename, std::vector<pending_tx>& ptx, std::function<bool(const signed_tx_set&)> accept_func = NULL);
bool parse_tx_from_str(std::string_view signed_tx_st, std::vector<pending_tx> &ptx, std::function<bool(const signed_tx_set &)> accept_func);
std::vector<pending_tx> create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra_base, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, cryptonote::loki_construct_tx_params &tx_params);
std::vector<pending_tx> create_transactions_2(std::vector<cryptonote::tx_destination_entry> dsts, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra_base, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, cryptonote::oxen_construct_tx_params &tx_params);
std::vector<pending_tx> create_transactions_all(uint64_t below, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, uint32_t subaddr_account, std::set<uint32_t> subaddr_indices, cryptonote::txtype tx_type = cryptonote::txtype::standard);
std::vector<pending_tx> create_transactions_single(const crypto::key_image &ki, const cryptonote::account_public_address &address, bool is_subaddress, const size_t outputs, const size_t fake_outs_count, const uint64_t unlock_time, uint32_t priority, const std::vector<uint8_t>& extra, cryptonote::txtype tx_type = cryptonote::txtype::standard);
@ -810,7 +810,7 @@ private:
// These return pairs where .first == true if the request was successful, and .second is a
// vector of the requested entries.
//
// NOTE(loki): get_all_service_node caches the result, get_service_nodes doesn't
// NOTE(oxen): get_all_service_node caches the result, get_service_nodes doesn't
auto get_all_service_nodes() const { return m_node_rpc_proxy.get_all_service_nodes(); }
auto get_service_nodes(std::vector<std::string> const &pubkeys) const { return m_node_rpc_proxy.get_service_nodes(pubkeys); }
auto get_service_node_blacklisted_key_images() const { return m_node_rpc_proxy.get_service_node_blacklisted_key_images(); }
@ -1221,7 +1221,7 @@ private:
// params constructor, accumulates the burn amounts if the priority is
// a blink and, or a lns tx. If it is a blink TX, lns_burn_type is ignored.
static cryptonote::loki_construct_tx_params construct_params(uint8_t hf_version, cryptonote::txtype tx_type, uint32_t priority, lns::mapping_type lns_burn_type = static_cast<lns::mapping_type>(0));
static cryptonote::oxen_construct_tx_params construct_params(uint8_t hf_version, cryptonote::txtype tx_type, uint32_t priority, lns::mapping_type lns_burn_type = static_cast<lns::mapping_type>(0));
bool is_unattended() const { return m_unattended; }
@ -1399,7 +1399,7 @@ private:
// The signature is derived from the hash of the previous txid blob and previous value blob of the mapping. By default this is signed using the wallet's spend key as an ed25519 keypair.
std::vector<pending_tx> lns_create_update_mapping_tx(lns::mapping_type type, std::string name, std::string const *value, std::string const *owner, std::string const *backup_owner, std::string const *signature, std::string *reason, uint32_t priority = 0, uint32_t account_index = 0, std::set<uint32_t> subaddr_indices = {}, std::vector<cryptonote::rpc::LNS_NAMES_TO_OWNERS::response_entry> *response = {});
// LNS renewal (for lokinet registrations, not for session/wallet)
// LNS renewal (for oxennet registrations, not for session/wallet)
std::vector<pending_tx> lns_create_renewal_tx(lns::mapping_type type, std::string name, std::string *reason, uint32_t priority = 0, uint32_t account_index = 0, std::set<uint32_t> subaddr_indices = {}, std::vector<cryptonote::rpc::LNS_NAMES_TO_OWNERS::response_entry> *response = {});
// Generate just the signature required for putting into lns_update_mapping command in the wallet
@ -1697,13 +1697,13 @@ private:
inline static std::string default_daemon_address;
};
// TODO(loki): Hmm. We need this here because we make register_service_node do
// TODO(oxen): Hmm. We need this here because we make register_service_node do
// parsing on the wallet2 side instead of simplewallet. This is so that
// register_service_node RPC command doesn't make it the wallet_rpc's
// responsibility to parse out the string returned from the daemon. We're
// purposely abstracting that complexity out to just wallet2's responsibility.
// TODO(loki): The better question is if anyone is ever going to try use
// TODO(oxen): The better question is if anyone is ever going to try use
// register service node funded by multiple subaddresses. This is unlikely.
constexpr std::array<const char* const, 6> allowed_priority_strings = {{"default", "unimportant", "normal", "elevated", "priority", "blink"}};
bool parse_subaddress_indices(std::string_view arg, std::set<uint32_t>& subaddr_indices, std::string *err_msg = nullptr);

View File

@ -36,7 +36,7 @@
#include "epee/string_tools.h"
#include "version.h"
#include "common/loki_integration_test_hooks.h"
#include "common/oxen_integration_test_hooks.h"
#if defined(WIN32)
#include <crtdbg.h>
@ -132,7 +132,7 @@ namespace wallet_args
command_line::add_arg(desc_params, integration_test::arg_pipe_name);
#endif
i18n_set_language("translations", "loki", lang);
i18n_set_language("translations", "oxen", lang);
po::options_description desc_all, desc_visible;
desc_visible.add(desc_general).add(desc_params);
@ -154,7 +154,7 @@ namespace wallet_args
if (command_line::get_arg(vm, command_line::arg_help))
{
Print(print) << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n";
Print(print) << wallet_args::tr("This is the command line loki wallet. It needs to connect to a loki\n"
Print(print) << wallet_args::tr("This is the command line oxen wallet. It needs to connect to a oxen\n"
"daemon to work correctly.") << "\n";
Print(print) << wallet_args::tr("Usage:") << "\n " << usage;
Print(print) << desc_visible;

View File

@ -82,7 +82,7 @@ namespace light_rpc
std::string hash; // The hash of this transaction.
uint64_t timestamp; // The unix time at which the block was recorded into the blockchain.
uint64_t total_received; // Total Loki received in atomic units.
uint64_t total_sent; // Total loki sent in atomic units.
uint64_t total_sent; // Total oxen sent in atomic units.
uint64_t unlock_time; // Unlock time in blocks.
uint64_t height; // Block height transaction was made.
std::list<spent_output> spent_outputs; // List of spent outputs.
@ -91,7 +91,7 @@ namespace light_rpc
bool mempool; // States if the transaction is sitting in the mempool. `true if the transaction is, `false` if not.
uint32_t mixin; // The number of other signatures (aside from yours) in the ring signature that authorises the transaction.
// TODO(loki): Also the pay type, is it a stake? But since this is undocumented and not used, not implemented yet
// TODO(oxen): Also the pay type, is it a stake? But since this is undocumented and not used, not implemented yet
BEGIN_KV_SERIALIZE_MAP()
KV_SERIALIZE(id)

View File

@ -54,7 +54,7 @@
#include "rpc/rpc_args.h"
#include "rpc/core_rpc_server_commands_defs.h"
#include "daemonizer/daemonizer.h"
#include "cryptonote_core/loki_name_system.h"
#include "cryptonote_core/oxen_name_system.h"
#include "serialization/boost_std_variant.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
@ -73,7 +73,7 @@ namespace
const command_line::arg_descriptor<std::string> arg_wallet_dir = {"wallet-dir", "Directory for newly created wallets"};
const command_line::arg_descriptor<bool> arg_prompt_for_password = {"prompt-for-password", "Prompts for password when not provided", false};
constexpr const char default_rpc_username[] = "loki";
constexpr const char default_rpc_username[] = "oxen";
std::optional<tools::password_container> password_prompter(const char *prompt, bool verify)
{
@ -497,7 +497,7 @@ namespace tools
m_restricted = command_line::get_arg(m_vm, arg_restricted);
m_server_header = "loki-wallet-rpc/"s + (m_restricted ? std::to_string(LOKI_VERSION[0]) : std::string{LOKI_VERSION_STR});
m_server_header = "oxen-wallet-rpc/"s + (m_restricted ? std::to_string(LOKI_VERSION[0]) : std::string{LOKI_VERSION_STR});
m_cors = {rpc_config.access_control_origins.begin(), rpc_config.access_control_origins.end()};
@ -543,7 +543,7 @@ namespace tools
epee::string_encoding::base64_encode(rand_128bit.data(), rand_128bit.size())
);
std::string temp = "loki-wallet-rpc." + std::to_string(port) + ".login";
std::string temp = "oxen-wallet-rpc." + std::to_string(port) + ".login";
rpc_login_file = tools::private_file::create(temp);
if (!rpc_login_file.handle())
{
@ -1006,7 +1006,7 @@ namespace tools
std::optional<uint8_t> hf_version = m_wallet->get_hard_fork_version();
if (!hf_version)
throw wallet_rpc_error{error_code::HF_QUERY_FAILED, tools::ERR_MSG_NETWORK_VERSION_QUERY_FAILED};
cryptonote::loki_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, cryptonote::txtype::standard, priority);
cryptonote::oxen_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, cryptonote::txtype::standard, priority);
std::vector<wallet2::pending_tx> ptx_vector = m_wallet->create_transactions_2(dsts, CRYPTONOTE_DEFAULT_TX_MIXIN, req.unlock_time, priority, extra, req.account_index, req.subaddr_indices, tx_params);
if (ptx_vector.empty())
@ -1041,7 +1041,7 @@ namespace tools
if (!hf_version)
throw wallet_rpc_error{error_code::HF_QUERY_FAILED, tools::ERR_MSG_NETWORK_VERSION_QUERY_FAILED};
cryptonote::loki_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, cryptonote::txtype::standard, priority);
cryptonote::oxen_construct_tx_params tx_params = tools::wallet2::construct_params(*hf_version, cryptonote::txtype::standard, priority);
LOG_PRINT_L2("on_transfer_split calling create_transactions_2");
std::vector<wallet2::pending_tx> ptx_vector = m_wallet->create_transactions_2(dsts, CRYPTONOTE_DEFAULT_TX_MIXIN, req.unlock_time, priority, extra, req.account_index, req.subaddr_indices, tx_params);
LOG_PRINT_L2("on_transfer_split called create_transactions_2");
@ -1965,7 +1965,7 @@ namespace tools
for (wallet::transfer_view& entry : transfers)
{
// TODO(loki): This discrepancy between having to use pay_type if type is
// TODO(oxen): This discrepancy between having to use pay_type if type is
// empty and type if pay type is neither is super unintuitive.
if (entry.pay_type == wallet::pay_type::in ||
entry.pay_type == wallet::pay_type::miner ||
@ -2981,7 +2981,7 @@ namespace {
args.erase(args.begin());
}
// NOTE(loki): Pre-emptively set subaddr_account to 0. We don't support onwards from Infinite Staking which is when this call was implemented.
// NOTE(oxen): Pre-emptively set subaddr_account to 0. We don't support onwards from Infinite Staking which is when this call was implemented.
tools::wallet2::register_service_node_result register_result = m_wallet->create_register_service_node_tx(args, 0 /*subaddr_account*/);
if (register_result.status != tools::wallet2::register_service_node_result_status::success)
throw wallet_rpc_error{error_code::TX_NOT_POSSIBLE, register_result.msg};
@ -3008,7 +3008,7 @@ namespace {
return res;
}
// TODO(loki): Deprecate this and make it return the TX as hex? Then just transfer it as normal? But these have no fees and or amount .. so maybe not?
// TODO(oxen): Deprecate this and make it return the TX as hex? Then just transfer it as normal? But these have no fees and or amount .. so maybe not?
REQUEST_STAKE_UNLOCK::response wallet_rpc_server::invoke(REQUEST_STAKE_UNLOCK::request&& req)
{
require_open();
@ -3231,8 +3231,8 @@ namespace {
{
auto& entry = res.known_names.emplace_back();
auto& type = entry_types.emplace_back(details.type);
if (type > lns::mapping_type::lokinet && type <= lns::mapping_type::lokinet_10years)
type = lns::mapping_type::lokinet;
if (type > lns::mapping_type::oxennet && type <= lns::mapping_type::oxennet_10years)
type = lns::mapping_type::oxennet;
entry.type = lns::mapping_type_str(type);
entry.hashed = details.hashed_name;
entry.name = details.name;
@ -3244,7 +3244,7 @@ namespace {
uint64_t curr_height = req.include_expired ? m_wallet->get_blockchain_current_height() : 0;
// Query lokid for the full record info
// Query oxend for the full record info
for (auto it = res.known_names.begin(); it != res.known_names.end(); )
{
const size_t num_entries = std::distance(it, res.known_names.end());
@ -3560,12 +3560,12 @@ int main(int argc, char **argv)
auto [vm, should_terminate] = wallet_args::main(
argc, argv,
"loki-wallet-rpc [--wallet-file=<file>|--generate-from-json=<file>|--wallet-dir=<directory>] [--rpc-bind-port=<port>]",
tools::wallet_rpc_server::tr("This is the RPC loki wallet. It needs to connect to a loki\ndaemon to work correctly."),
"oxen-wallet-rpc [--wallet-file=<file>|--generate-from-json=<file>|--wallet-dir=<directory>] [--rpc-bind-port=<port>]",
tools::wallet_rpc_server::tr("This is the RPC oxen wallet. It needs to connect to a oxen\ndaemon to work correctly."),
desc_params, hidden_params,
po::positional_options_description(),
[](const std::string &s, bool emphasis){ epee::set_console_color(emphasis ? epee::console_color_white : epee::console_color_default, emphasis); std::cout << s << std::endl; if (emphasis) epee::reset_console_color(); },
"loki-wallet-rpc.log",
"oxen-wallet-rpc.log",
true
);
if (!vm)

View File

@ -37,7 +37,7 @@
#include "wallet/transfer_view.h"
#include "common/meta.h"
#include "common/loki.h"
#include "common/oxen.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "wallet.rpc"
@ -108,7 +108,7 @@ namespace tools::wallet_rpc {
uint32_t address_index; // Index of the subaddress in the account.
std::string address; // Address at this index. Base58 representation of the public keys.
uint64_t balance; // Balance for the subaddress (locked or unlocked).
uint64_t unlocked_balance; // Unlocked funds are those funds that are sufficiently deep enough in the loki blockchain to be considered safe to spend.
uint64_t unlocked_balance; // Unlocked funds are those funds that are sufficiently deep enough in the oxen blockchain to be considered safe to spend.
std::string label; // Label for the subaddress.
uint64_t num_unspent_outputs; // Number of unspent outputs available for the subaddress.
uint64_t blocks_to_unlock; // The number of blocks remaining for the balance to unlock
@ -120,7 +120,7 @@ namespace tools::wallet_rpc {
struct response
{
uint64_t balance; // The total balance (atomic units) of the currently opened wallet.
uint64_t unlocked_balance; // Unlocked funds are those funds that are sufficiently deep enough in the loki blockchain to be considered safe to spend.
uint64_t unlocked_balance; // Unlocked funds are those funds that are sufficiently deep enough in the oxen blockchain to be considered safe to spend.
bool multisig_import_needed; // True if importing multisig data is needed for returning a correct balance.
std::vector<per_subaddress_info> per_subaddress; // Balance information for each subaddress in an account.
uint64_t blocks_to_unlock; // The number of blocks remaining for the balance to unlock
@ -395,7 +395,7 @@ namespace tools::wallet_rpc {
};
LOKI_RPC_DOC_INTROSPECT
// Send loki to a number of recipients. To preview the transaction fee, set do_not_relay to true and get_tx_metadata to true.
// Send oxen to a number of recipients. To preview the transaction fee, set do_not_relay to true and get_tx_metadata to true.
// Submit the response using the data in get_tx_metadata in the RPC call, relay_tx.
struct TRANSFER : RESTRICTED
{
@ -407,10 +407,10 @@ namespace tools::wallet_rpc {
uint32_t account_index; // (Optional) Transfer from this account index. (Defaults to 0)
std::set<uint32_t> subaddr_indices; // (Optional) Transfer from this set of subaddresses. (Defaults to 0)
uint32_t priority; // Set a priority for the transaction. Accepted values are: 1 for unimportant or 5 for blink. (0 and 2-4 are accepted for backwards compatibility and are equivalent to 5)
uint64_t unlock_time; // Number of blocks before the loki can be spent (0 to use the default lock time).
uint64_t unlock_time; // Number of blocks before the oxen can be spent (0 to use the default lock time).
std::string payment_id; // (Optional) Random 64-character hex string to identify a transaction.
bool get_tx_key; // (Optional) Return the transaction key after sending.
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the loki network. (Defaults to false)
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the oxen network. (Defaults to false)
bool get_tx_hex; // Return the transaction as hex string after sending. (Defaults to false)
bool get_tx_metadata; // Return the metadata needed to relay the transaction. (Defaults to false)
@ -444,10 +444,10 @@ namespace tools::wallet_rpc {
uint32_t account_index; // (Optional) Transfer from this account index. (Defaults to 0)
std::set<uint32_t> subaddr_indices; // (Optional) Transfer from this set of subaddresses. (Defaults to 0)
uint32_t priority; // Set a priority for the transaction. Accepted values are: 1 for unimportant or 5 for blink. (0 and 2-4 are accepted for backwards compatibility and are equivalent to 5)
uint64_t unlock_time; // Number of blocks before the loki can be spent (0 to not add a lock).
uint64_t unlock_time; // Number of blocks before the oxen can be spent (0 to not add a lock).
std::string payment_id; // (Optional) Random 32-byte/64-character hex string to identify a transaction.
bool get_tx_keys; // (Optional) Return the transaction keys after sending.
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the loki network. (Defaults to false)
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the oxen network. (Defaults to false)
bool get_tx_hex; // Return the transactions as hex string after sending.
bool get_tx_metadata; // Return list of transaction metadata needed to relay the transfer later.
@ -494,7 +494,7 @@ namespace tools::wallet_rpc {
uint64_t amount_in; // Amount in, in atomic units.
uint64_t amount_out; // amount out, in atomic units.
uint32_t ring_size; // Ring size of transfer.
uint64_t unlock_time; // Number of blocks before the loki can be spent (0 represents the default network lock time).
uint64_t unlock_time; // Number of blocks before the oxen can be spent (0 represents the default network lock time).
std::list<recipient> recipients; // List of addresses and amounts.
std::string payment_id; // Payment ID matching the input parameter.
uint64_t change_amount; // Change received from transaction in atomic units.
@ -578,7 +578,7 @@ namespace tools::wallet_rpc {
struct request
{
bool get_tx_keys; // (Optional) Return the transaction keys after sending.
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the loki network. (Defaults to false)
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the oxen network. (Defaults to false)
bool get_tx_hex; // (Optional) Return the transactions as hex string after sending. (Defaults to false)
bool get_tx_metadata; // (Optional) Return list of transaction metadata needed to relay the transfer later. (Defaults to false)
@ -621,7 +621,7 @@ namespace tools::wallet_rpc {
bool subaddr_indices_all; //
uint32_t priority; // Set a priority for the transaction. Accepted values are: 1 for unimportant or 5 for blink. (0 and 2-4 are accepted for backwards compatibility and are equivalent to 5)
uint64_t outputs; //
uint64_t unlock_time; // Number of blocks before the loki can be spent (0 to not add a lock).
uint64_t unlock_time; // Number of blocks before the oxen can be spent (0 to not add a lock).
std::string payment_id; // (Optional) 64-character hex string to identify a transaction.
bool get_tx_keys; // (Optional) Return the transaction keys after sending.
uint64_t below_amount; // (Optional) Include outputs below this amount.
@ -665,7 +665,7 @@ namespace tools::wallet_rpc {
std::string address; // Destination public address.
uint32_t priority; // Set a priority for the transaction. Accepted values are: 1 for unimportant or 5 for blink. (0 and 2-4 are accepted for backwards compatibility and are equivalent to 5)
uint64_t outputs; //
uint64_t unlock_time; // Number of blocks before the loki can be spent (0 to not add a lock).
uint64_t unlock_time; // Number of blocks before the oxen can be spent (0 to not add a lock).
std::string payment_id; // (Optional) 64-character hex string to identify a transaction.
bool get_tx_key; // (Optional) Return the transaction keys after sending.
std::string key_image; // Key image of specific output to sweep.
@ -1608,7 +1608,7 @@ namespace tools::wallet_rpc {
};
LOKI_RPC_DOC_INTROSPECT
// Start mining in the loki daemon.
// Start mining in the oxen daemon.
struct START_MINING : RPC_COMMAND
{
static constexpr auto names() { return NAMES("start_mining"); }
@ -1624,7 +1624,7 @@ namespace tools::wallet_rpc {
};
LOKI_RPC_DOC_INTROSPECT
// Stop mining in the loki daemon.
// Stop mining in the oxen daemon.
struct STOP_MINING : RPC_COMMAND
{
static constexpr auto names() { return NAMES("stop_mining"); }
@ -1652,7 +1652,7 @@ namespace tools::wallet_rpc {
};
LOKI_RPC_DOC_INTROSPECT
// Create a new wallet. You need to have set the argument "'--wallet-dir" when launching loki-wallet-rpc to make this work.
// Create a new wallet. You need to have set the argument "'--wallet-dir" when launching oxen-wallet-rpc to make this work.
struct CREATE_WALLET : RPC_COMMAND
{
static constexpr auto names() { return NAMES("create_wallet"); }
@ -1673,7 +1673,7 @@ namespace tools::wallet_rpc {
};
LOKI_RPC_DOC_INTROSPECT
// Open a wallet. You need to have set the argument "--wallet-dir" when launching loki-wallet-rpc to make this work.
// Open a wallet. You need to have set the argument "--wallet-dir" when launching oxen-wallet-rpc to make this work.
// The wallet rpc executable may only open wallet files within the same directory as wallet-dir, otherwise use the
// "--wallet-file" flag to open specific wallets.
struct OPEN_WALLET : RPC_COMMAND
@ -1997,7 +1997,7 @@ namespace tools::wallet_rpc {
std::string service_node_key; // Service Node Public Address.
uint32_t priority; // Set a priority for the transaction. Accepted values are: or 0-4 for: default, unimportant, normal, elevated, priority.
bool get_tx_key; // (Optional) Return the transaction key after sending.
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the loki network. (Defaults to false)
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the oxen network. (Defaults to false)
bool get_tx_hex; // Return the transaction as hex string after sending (Defaults to false)
bool get_tx_metadata; // Return the metadata needed to relay the transaction. (Defaults to false)
@ -2029,7 +2029,7 @@ namespace tools::wallet_rpc {
{
std::string register_service_node_str; // String supplied by the prepare_registration command.
bool get_tx_key; // (Optional) Return the transaction key after sending.
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the loki network. (Defaults to false)
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the oxen network. (Defaults to false)
bool get_tx_hex; // Return the transaction as hex string after sending (Defaults to false)
bool get_tx_metadata; // Return the metadata needed to relay the transaction. (Defaults to false)
@ -2186,7 +2186,7 @@ namespace tools::wallet_rpc {
static constexpr const char *description =
R"(Buy a Loki Name System (LNS) mapping that maps a unique name to a Session ID or Lokinet address.
Currently supports Session and Lokinet registrations. Lokinet registrations can be for 1, 2, 5, or 10 years by specifying a type value of "lokinet", "lokinet_2y", "lokinet_5y", "lokinet_10y". Session registrations do not expire.
Currently supports Session and Lokinet registrations. Lokinet registrations can be for 1, 2, 5, or 10 years by specifying a type value of "oxennet", "oxennet_2y", "oxennet_5y", "oxennet_10y". Session registrations do not expire.
The owner of the LNS entry (by default, the purchasing wallet) will be permitted to submit LNS update transactions to the Loki blockchain (for example to update a Session pubkey or the target Lokinet address). You may change the primary owner or add a backup owner in the registration and can change them later with update transactions. Owner addresses can be either Loki wallets, or generic ed25519 pubkeys (for advanced uses).
@ -2198,7 +2198,7 @@ For more information on updating and signing see the LNS_UPDATE_MAPPING document
struct request
{
std::string type; // The mapping type: "session", "lokinet", "lokinet_2y", "lokinet_5y", "lokinet_10y".
std::string type; // The mapping type: "session", "oxennet", "oxennet_2y", "oxennet_5y", "oxennet_10y".
std::string owner; // (Optional): The ed25519 public key or wallet address that has authority to update the mapping.
std::string backup_owner; // (Optional): The secondary, backup public key that has authority to update the mapping.
std::string name; // The name to purchase via Loki Name Service
@ -2208,7 +2208,7 @@ For more information on updating and signing see the LNS_UPDATE_MAPPING document
std::set<uint32_t> subaddr_indices; // (Optional) Transfer from this set of subaddresses. (Defaults to 0)
uint32_t priority; // Set a priority for the transaction. Accepted values are: or 0-4 for: default, unimportant, normal, elevated, priority.
bool get_tx_key; // (Optional) Return the transaction key after sending.
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the loki network. (Defaults to false)
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the oxen network. (Defaults to false)
bool get_tx_hex; // Return the transaction as hex string after sending (Defaults to false)
bool get_tx_metadata; // Return the metadata needed to relay the transaction. (Defaults to false)
@ -2231,26 +2231,26 @@ For more information on updating and signing see the LNS_UPDATE_MAPPING document
};
LOKI_RPC_DOC_INTROSPECT
// Renew an active lokinet LNS registration
// Renew an active oxennet LNS registration
struct LNS_RENEW_MAPPING : RESTRICTED
{
static constexpr auto names() { return NAMES("lns_renew_mapping"); }
static constexpr const char *description =
R"(Renews a Loki Name System lokinet mapping by adding to the existing expiry time.
R"(Renews a Loki Name System oxennet mapping by adding to the existing expiry time.
The renewal can be for 1, 2, 5, or 10 years by specifying a `type` value of "lokinet_2y", "lokinet_10y", etc.)";
The renewal can be for 1, 2, 5, or 10 years by specifying a `type` value of "oxennet_2y", "oxennet_10y", etc.)";
struct request
{
std::string type; // The mapping type, "lokinet" (1-year), or "lokinet_2y", "lokinet_5y", "lokinet_10y" for multi-year registrations.
std::string type; // The mapping type, "oxennet" (1-year), or "oxennet_2y", "oxennet_5y", "oxennet_10y" for multi-year registrations.
std::string name; // The name to update
uint32_t account_index; // (Optional) Transfer from this account index. (Defaults to 0)
std::set<uint32_t> subaddr_indices; // (Optional) Transfer from this set of subaddresses. (Defaults to 0)
uint32_t priority; // Set a priority for the transaction. Accepted values are: 0-4 for: default, unimportant, normal, elevated, priority.
bool get_tx_key; // (Optional) Return the transaction key after sending.
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the loki network. (Defaults to false)
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the oxen network. (Defaults to false)
bool get_tx_hex; // Return the transaction as hex string after sending (Defaults to false)
bool get_tx_metadata; // Return the metadata needed to relay the transaction. (Defaults to false)
@ -2277,7 +2277,7 @@ If signing is performed externally then you must first encrypt the `value` (if b
struct request
{
std::string type; // The mapping type, "session" or "lokinet".
std::string type; // The mapping type, "session" or "oxennet".
std::string name; // The name to update via Loki Name Service
std::string value; // (Optional): The new value that the name maps to via Loki Name Service. If not specified or given the empty string "", then the mapping's value remains unchanged. If using a `signature` then this value (if non-empty) must be already encrypted.
std::string owner; // (Optional): The new owner of the mapping. If not specified or given the empty string "", then the mapping's owner remains unchanged.
@ -2288,7 +2288,7 @@ If signing is performed externally then you must first encrypt the `value` (if b
std::set<uint32_t> subaddr_indices; // (Optional) Transfer from this set of subaddresses. (Defaults to 0)
uint32_t priority; // Set a priority for the transaction. Accepted values are: 0-4 for: default, unimportant, normal, elevated, priority.
bool get_tx_key; // (Optional) Return the transaction key after sending.
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the loki network. (Defaults to false)
bool do_not_relay; // (Optional) If true, the newly created transaction will not be relayed to the oxen network. (Defaults to false)
bool get_tx_hex; // Return the transaction as hex string after sending (Defaults to false)
bool get_tx_metadata; // Return the metadata needed to relay the transaction. (Defaults to false)
@ -2323,7 +2323,7 @@ This command is only required if the open wallet is one of the owners of a LNS r
struct request
{
std::string type; // The mapping type, currently we only support "session". In future "lokinet" and "blockchain" mappings will be available.
std::string type; // The mapping type, currently we only support "session". In future "oxennet" and "blockchain" mappings will be available.
std::string name; // The desired name to update via Loki Name Service
std::string encrypted_value; // (Optional): The new encrypted value that the name maps to via Loki Name Service. If not specified or given the empty string "", then the mapping's value remains unchanged.
std::string owner; // (Optional): The new owner of the mapping. If not specified or given the empty string "", then the mapping's owner remains unchanged.
@ -2349,7 +2349,7 @@ This command is only required if the open wallet is one of the owners of a LNS r
struct request
{
std::string type; // The mapping type, "session" or "lokinet".
std::string type; // The mapping type, "session" or "oxennet".
std::string name; // The desired name to hash
KV_MAP_SERIALIZABLE
@ -2373,7 +2373,7 @@ This command is only required if the open wallet is one of the owners of a LNS r
struct known_record
{
std::string type; // The mapping type, "session" or "lokinet".
std::string type; // The mapping type, "session" or "oxennet".
std::string hashed; // The hashed name (in base64)
std::string name; // The plaintext name
std::string owner; // The public key that purchased the Loki Name Service entry.
@ -2411,7 +2411,7 @@ This command is only required if the open wallet is one of the owners of a LNS r
struct record
{
std::string type; // The LNS type (mandatory); currently support values are: "session", "lokinet"
std::string type; // The LNS type (mandatory); currently support values are: "session", "oxennet"
std::string name; // The (unhashed) name of the record
KV_MAP_SERIALIZABLE
@ -2436,7 +2436,7 @@ This command is only required if the open wallet is one of the owners of a LNS r
struct request
{
std::string name; // The LNS name with which to encrypt the value.
std::string type; // The mapping type: "session" or "lokinet".
std::string type; // The mapping type: "session" or "oxennet".
std::string value; // The value to be encrypted.
KV_MAP_SERIALIZABLE
@ -2459,7 +2459,7 @@ This command is only required if the open wallet is one of the owners of a LNS r
struct request
{
std::string name; // The LNS name of the given encrypted value.
std::string type; // The mapping type: "session" or "lokinet".
std::string type; // The mapping type: "session" or "oxennet".
std::string encrypted_value; // The encrypted value represented in hex.
KV_MAP_SERIALIZABLE