Merge pull request #1380 from darcys22/oxen-rebrand

Oxen rebrand
This commit is contained in:
Jason Rhinelander 2021-01-07 18:25:01 -04:00 committed by GitHub
commit 5cc0bec1b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
190 changed files with 2221 additions and 2143 deletions

View File

@ -24,7 +24,7 @@ local debian_pipeline(name, image,
lto=false,
werror=false, // FIXME
build_tests=true,
test_lokid=true, # Simple lokid offline startup test
test_oxend=true, # Simple oxend offline startup test
run_tests=false, # Runs full test suite
cmake_extra='',
extra_cmds=[],
@ -49,7 +49,7 @@ local debian_pipeline(name, image,
apt_get_quiet + ' install -y eatmydata',
'eatmydata ' + apt_get_quiet + ' dist-upgrade -y',
'eatmydata ' + apt_get_quiet + ' install -y --no-install-recommends cmake git ca-certificates ninja-build ccache '
+ deps + (if test_lokid then ' gdb' else ''),
+ deps + (if test_oxend then ' gdb' else ''),
'mkdir build',
'cd build',
'cmake .. -G Ninja -DCMAKE_CXX_FLAGS=-fdiagnostics-color=always -DCMAKE_BUILD_TYPE='+build_type+' ' +
@ -64,12 +64,12 @@ local debian_pipeline(name, image,
else
['ninja -j' + jobs + ' -v']
) + (
if test_lokid then [
'(sleep 3; echo "status\ndiff\nexit") | TERM=xterm ../utils/build_scripts/drone-gdb.sh ./bin/lokid --offline --data-dir=startuptest'
if test_oxend then [
'(sleep 3; echo "status\ndiff\nexit") | TERM=xterm ../utils/build_scripts/drone-gdb.sh ./bin/oxend --offline --data-dir=startuptest'
] else []
) + (
if run_tests then [
'mkdir -v -p $$HOME/.loki',
'mkdir -v -p $$HOME/.oxen',
'GTEST_COLOR=1 ctest --output-on-failure -j'+jobs
] else []
) + extra_cmds,
@ -112,7 +112,7 @@ local mac_builder(name,
'ninja -j' + jobs + ' -v'
] + (
if run_tests then [
'mkdir -v -p $$HOME/.loki',
'mkdir -v -p $$HOME/.oxen',
'GTEST_COLOR=1 ctest --output-on-failure -j'+jobs
] else []
) + extra_cmds,
@ -159,8 +159,8 @@ local gui_wallet_step(image, wine=false) = {
'eatmydata ' + apt_get_quiet + ' update',
'eatmydata ' + apt_get_quiet + ' install -y nodejs',
'git clone https://github.com/loki-project/loki-electron-gui-wallet.git',
'cp -v build/bin/lokid' + (if wine then '.exe' else '') + ' loki-electron-gui-wallet/bin',
'cp -v build/bin/loki-wallet-rpc' + (if wine then '.exe' else '') + ' loki-electron-gui-wallet/bin',
'cp -v build/bin/oxend' + (if wine then '.exe' else '') + ' loki-electron-gui-wallet/bin',
'cp -v build/bin/oxen-wallet-rpc' + (if wine then '.exe' else '') + ' loki-electron-gui-wallet/bin',
'cd loki-electron-gui-wallet',
'eatmydata npm install',
'sed -i -e \'s/^\\\\( *"version": ".*\\\\)",/\\\\\\\\1-${DRONE_COMMIT_SHA:0:8}",/\' package.json',
@ -175,7 +175,7 @@ local gui_wallet_step_darwin = {
environment: { SSH_KEY: { from_secret: "SSH_KEY" }, CSC_IDENTITY_AUTO_DISCOVERY: 'false' },
commands: [
'git clone https://github.com/loki-project/loki-electron-gui-wallet.git',
'cp -v build/bin/{lokid,loki-wallet-rpc} loki-electron-gui-wallet/bin',
'cp -v build/bin/{oxend,oxen-wallet-rpc} loki-electron-gui-wallet/bin',
'cd loki-electron-gui-wallet',
'sed -i -e \'s/^\\\\( *"version": ".*\\\\)",/\\\\1-${DRONE_COMMIT_SHA:0:8}",/\' package.json',
'npm install',
@ -212,7 +212,7 @@ local gui_wallet_step_darwin = {
// Static mingw build (on focal) which gets uploaded to builds.lokinet.dev:
debian_pipeline("Static (win64)", "ubuntu:focal", deps='g++ g++-mingw-w64-x86-64 '+static_build_deps,
cmake_extra='-DCMAKE_TOOLCHAIN_FILE=../cmake/64-bit-toolchain.cmake -DBUILD_STATIC_DEPS=ON -DARCH=x86-64',
build_tests=false, lto=false, test_lokid=false, extra_cmds=[
build_tests=false, lto=false, test_oxend=false, extra_cmds=[
'ninja strip_binaries', 'ninja create_zip', '../utils/build_scripts/drone-static-upload.sh'],
extra_steps=[gui_wallet_step('debian:stable', wine=true)]),

View File

@ -1,6 +1,6 @@
# Anonymity Networks with Loki
# Anonymity Networks with Oxen
Currently only Tor and I2P have been integrated into Loki. The usage of
Currently only Tor and I2P have been integrated into Oxen. The usage of
these networks is still considered experimental - there are a few pessimistic
cases where privacy is leaked. The design is intended to maximize privacy of
the source of a transaction by broadcasting it over an anonymity network, while
@ -16,11 +16,11 @@ will only be sent to peers on anonymity networks. If an anonymity network is
enabled but no peers over an anonymity network are available, an error is
logged and the transaction is kept for future broadcasting over an anonymity
network. The transaction will not be broadcast unless an anonymity connection
is made or until `lokid` is shutdown and restarted with only public
is made or until `oxend` is shutdown and restarted with only public
connections enabled.
Anonymity networks can also be used with `loki-wallet-cli` and
`loki-wallet-rpc` - the wallets will connect to a daemon through a proxy. The
Anonymity networks can also be used with `oxen-wallet-cli` and
`oxen-wallet-rpc` - the wallets will connect to a daemon through a proxy. The
daemon must provide a hidden service for the RPC itself, which is separate from
the hidden service for P2P connections.
@ -43,7 +43,7 @@ additional peers can be found through typical p2p peerlist sharing.
### Outbound Connections
Connecting to an anonymous address requires the command line option
`--tx-proxy` which tells `lokid` the ip/port of a socks proxy provided by a
`--tx-proxy` which tells `oxend` the ip/port of a socks proxy provided by a
separate process. On most systems the configuration will look like:
```
@ -51,7 +51,7 @@ separate process. On most systems the configuration will look like:
--tx-proxy i2p,127.0.0.1:9000
```
which tells `lokid` that ".onion" p2p addresses can be forwarded to a socks
which tells `oxend` that ".onion" p2p addresses can be forwarded to a socks
proxy at IP 127.0.0.1 port 9050 with a max of 10 outgoing connections and
".b32.i2p" p2p addresses can be forwarded to a socks proxy at IP 127.0.0.1 port
9000 with the default max outgoing connections. Since there are no seed nodes
@ -69,7 +69,7 @@ seed nodes on ALL networks, which will typically be undesirable.
### Inbound Connections
Receiving anonymity connections is done through the option
`--anonymous-inbound`. This option tells `lokid` the inbound address, network
`--anonymous-inbound`. This option tells `oxend` the inbound address, network
type, and max connections:
```
@ -77,24 +77,24 @@ type, and max connections:
--anonymous-inbound cmeua5767mz2q5jsaelk2rxhf67agrwuetaso5dzbenyzwlbkg2q.b32.i2p:5000,127.0.0.1:30000
```
which tells `lokid` that a max of 25 inbound Tor connections are being
received at address "rveahdfho7wo4b2m.onion:28083" and forwarded to `lokid`
which tells `oxend` that a max of 25 inbound Tor connections are being
received at address "rveahdfho7wo4b2m.onion:28083" and forwarded to `oxend`
localhost port 28083, and a default max I2P connections are being received at
address "cmeua5767mz2q5jsaelk2rxhf67agrwuetaso5dzbenyzwlbkg2q.b32.i2p:5000" and
forwarded to `lokid` localhost port 30000.
forwarded to `oxend` localhost port 30000.
These addresses will be shared with outgoing peers, over the same network type,
otherwise the peer will not be notified of the peer address by the proxy.
### Wallet RPC
An anonymity network can be configured to forward incoming connections to a
`lokid` RPC port - which is independent from the configuration for incoming
`oxend` RPC port - which is independent from the configuration for incoming
P2P anonymity connections. The anonymity network (Tor/i2p) is
[configured in the same manner](#configuration), except the localhost port
must be the RPC port (typically 22023 for mainnet) instead of the p2p port:
```
HiddenServiceDir /var/lib/tor/data/loki
HiddenServiceDir /var/lib/tor/data/oxen
HiddenServicePort 18081 127.0.0.1:18081
```
@ -136,13 +136,13 @@ Tor must be configured for hidden services. An example configuration ("torrc")
might look like:
```
HiddenServiceDir /var/lib/tor/data/loki
HiddenServiceDir /var/lib/tor/data/oxen
HiddenServicePort 28083 127.0.0.1:28083
```
This will store key information in `/var/lib/tor/data/loki` and will forward
This will store key information in `/var/lib/tor/data/oxen` and will forward
"Tor port" 28083 to port 28083 of ip 127.0.0.1. The file
`/usr/lib/tor/data/loki/hostname` will contain the ".onion" address for use
`/usr/lib/tor/data/oxen/hostname` will contain the ".onion" address for use
with `--anonymous-inbound`.
I2P must be configured with a standard server tunnel. Configuration differs by
@ -161,7 +161,7 @@ sees a transaction over Tor, it could _assume_ (possibly incorrectly) that the
transaction originated from the peer. If both the Tor connection and an
IPv4/IPv6 connection have timestamps that are approximately close in value they
could be used to link the two connections. This is less likely to happen if the
system clock is fairly accurate - many peers on the Loki network should have
system clock is fairly accurate - many peers on the Oxen network should have
similar timestamps.
#### Mitigation
@ -172,14 +172,14 @@ the system clock is noticeably off (and therefore more fingerprintable),
linking the public IPv4/IPv6 connections with the anonymity networks will be
more difficult.
### Intermittent Loki Syncing
### Intermittent Oxen Syncing
If a user only runs `lokid` to send a transaction then quit, this can also
If a user only runs `oxend` to send a transaction then quit, this can also
be used by an ISP to link a user to a transaction.
#### Mitigation
Run `lokid` as often as possible to conceal when transactions are being sent.
Run `oxend` as often as possible to conceal when transactions are being sent.
Future versions will also have peers that first receive a transaction over an
anonymity network delay the broadcast to public peers by a randomized amount.
This will not completely mitigate a user who syncs up sends then quits, in
@ -211,20 +211,20 @@ signature. This issue was (primarily) raised by @secparam on Twitter.
#### Mitigation
`lokid` currently selects two outgoing connections every 5 minutes for
`oxend` currently selects two outgoing connections every 5 minutes for
transmitting transactions over I2P/Tor. Using outgoing connections prevents an
adversary from making many incoming connections to obtain information (this
technique was taken from Dandelion). Outgoing connections also do not have a
persistent public key identity - the creation of a new circuit will generate
a new public key identity. The lock time on a change address is ~20 minutes, so
`lokid` will have rotated its selected outgoing connections several times in
`oxend` will have rotated its selected outgoing connections several times in
most cases. However, the number of outgoing connections is typically a small
fixed number, so there is a decent probability of re-use with the same public
key identity.
@secparam (twitter) recommended changing circuits (Tor) as an additional
precaution. This is likely not a good idea - forcibly requesting Tor to change
circuits is observable by the ISP. Instead, `lokid` should likely disconnect
circuits is observable by the ISP. Instead, `oxend` should likely disconnect
from peers occasionally. Tor will rotate circuits every ~10 minutes, so
establishing new connections will use a new public key identity and make it
more difficult for the hidden service to link information. This process will

View File

@ -50,17 +50,17 @@ message(STATUS "CMake version ${CMAKE_VERSION}")
# Has to be set before `project()`, and ignored on non-macos:
set(CMAKE_OSX_DEPLOYMENT_TARGET 10.12 CACHE STRING "macOS deployment target (Apple clang only)")
project(loki
project(oxen
VERSION 9.0.0
LANGUAGES CXX C)
set(LOKI_RELEASE_CODENAME "Salty Saga")
set(OXEN_RELEASE_CODENAME "Salty Saga")
# String value to append to the full version string; this is intended to easily identify whether a
# binary was build from the release or development branches. This should be permanently set to an
# empty string on `stable`, "-dev" on the `dev` branch, and can be set externally (via cmake
# arguments) where it makes sense to take some other branch release with an extra value.
if(NOT DEFINED LOKI_RELEASE_SUFFIX)
set(LOKI_RELEASE_SUFFIX "-dev")
if(NOT DEFINED OXEN_RELEASE_SUFFIX)
set(OXEN_RELEASE_SUFFIX "-dev")
endif()
if(POLICY CMP0079)
@ -857,7 +857,7 @@ if (WIN32)
endif()
if (BUILD_INTEGRATION)
target_compile_definitions(extra INTERFACE LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
target_compile_definitions(extra INTERFACE OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
else()
option(USE_READLINE "Build with GNU readline support." ON)
if(USE_READLINE AND BUILD_STATIC_DEPS)
@ -894,8 +894,8 @@ if(CMAKE_C_COMPILER_ID STREQUAL "Clang" AND ARCH_WIDTH EQUAL "32" AND NOT IOS AN
endif()
endif()
option(LOKI_DEBUG_SHORT_PROOFS "Developer option to substantially reduce uptime proof intervals for local test network debugging (the result lokid will not be usable on the live networks)" OFF)
if (LOKI_DEBUG_SHORT_PROOFS)
option(OXEN_DEBUG_SHORT_PROOFS "Developer option to substantially reduce uptime proof intervals for local test network debugging (the result oxend will not be usable on the live networks)" OFF)
if (OXEN_DEBUG_SHORT_PROOFS)
add_definitions(-DUPTIME_PROOF_BASE_MINUTE=3) # 20x faster uptime proofs
endif()
@ -958,11 +958,11 @@ endif()
# Set up a `make strip_binaries` target that strips built binaries. This depends on all
# default-built binaries and strips them after build. (To also build and strip debug utilities
# there is also a `make strip_binaries_all` target.)
get_property(loki_exec_tgts_all GLOBAL PROPERTY loki_executable_targets)
set(loki_exec_tgts "")
get_property(oxen_exec_tgts_all GLOBAL PROPERTY oxen_executable_targets)
set(oxen_exec_tgts "")
set(strip_binaries "")
set(strip_binaries_all "")
foreach(tgt ${loki_exec_tgts_all})
foreach(tgt ${oxen_exec_tgts_all})
list(APPEND strip_binaries_all COMMAND ${CMAKE_STRIP} $<TARGET_FILE:${tgt}>)
# Look for a EXCLUDE_FROM_ALL property:
get_property(tgt_excl_all TARGET ${tgt} PROPERTY EXCLUDE_FROM_ALL)
@ -971,12 +971,12 @@ foreach(tgt ${loki_exec_tgts_all})
get_property(tgt_dir TARGET ${tgt} PROPERTY SOURCE_DIR)
get_property(tgt_dir_excl_all DIRECTORY ${tgt_dir} PROPERTY EXCLUDE_FROM_ALL)
if (NOT tgt_excl_all AND NOT tgt_dir_excl_all)
list(APPEND loki_exec_tgts ${tgt})
list(APPEND oxen_exec_tgts ${tgt})
list(APPEND strip_binaries COMMAND ${CMAKE_STRIP} $<TARGET_FILE:${tgt}>)
endif()
endforeach()
add_custom_target(strip_binaries ${strip_binaries} DEPENDS ${loki_exec_tgts})
add_custom_target(strip_binaries_all ${strip_binaries_all} DEPENDS ${loki_exec_tgts_all})
add_custom_target(strip_binaries ${strip_binaries} DEPENDS ${oxen_exec_tgts})
add_custom_target(strip_binaries_all ${strip_binaries_all} DEPENDS ${oxen_exec_tgts_all})
execute_process(COMMAND tar --version RESULT_VARIABLE tar_exit_code OUTPUT_VARIABLE tar_vers)
set(git_tag "-unknown")
@ -1008,17 +1008,17 @@ elseif(tar_os STREQUAL "Windows")
endif()
set(default_archive create_zip) # .tar.xz files are too scary for Windows users
endif()
set(tar_dir "loki-${tar_os}-${PROJECT_VERSION}${LOKI_RELEASE_SUFFIX}${git_tag}")
set(tar_dir "oxen-${tar_os}-${PROJECT_VERSION}${OXEN_RELEASE_SUFFIX}${git_tag}")
add_custom_target(create_tarxz
COMMAND ${CMAKE_COMMAND} -E rename bin "${tar_dir}"
COMMAND ${CMAKE_COMMAND} -E tar cvJ "${tar_dir}.tar.xz" -- "${tar_dir}"
COMMAND ${CMAKE_COMMAND} -E rename "${tar_dir}" bin
DEPENDS ${loki_exec_tgts})
DEPENDS ${oxen_exec_tgts})
add_custom_target(create_zip
COMMAND ${CMAKE_COMMAND} -E rename bin "${tar_dir}"
COMMAND ${CMAKE_COMMAND} -E tar cv "${tar_dir}.zip" --format=zip -- "${tar_dir}"
COMMAND ${CMAKE_COMMAND} -E rename "${tar_dir}" bin
DEPENDS ${loki_exec_tgts})
DEPENDS ${oxen_exec_tgts})
add_custom_target(create_archive DEPENDS ${default_archive})

View File

@ -1,7 +1,7 @@
# Multistage docker build, requires docker 17.05
# TO RUN
# docker build -t loki-daemon-image .
# docker build -t oxen-daemon-image .
# TO COLLECT BINARIES
# ./util/build_scripts/collect_from_docker_container.sh
@ -105,7 +105,7 @@ RUN set -ex && \
make -j$(nproc) VERBOSE=1
RUN set -ex && \
ldd /src/build/release/bin/lokid
ldd /src/build/release/bin/oxend
# runtime stage
FROM ubuntu:16.04
@ -117,24 +117,24 @@ RUN set -ex && \
rm -rf /var/lib/apt
COPY --from=builder /src/build/release/bin /usr/local/bin/
# Create loki user
RUN adduser --system --group --disabled-password loki && \
mkdir -p /wallet /home/loki/.loki && \
chown -R loki:loki /home/loki/.loki && \
chown -R loki:loki /wallet
# Create oxen user
RUN adduser --system --group --disabled-password oxen && \
mkdir -p /wallet /home/oxen/.oxen && \
chown -R oxen:oxen /home/oxen/.oxen && \
chown -R oxen:oxen /wallet
# Contains the blockchain
VOLUME /home/loki/.loki
VOLUME /home/oxen/.oxen
# Generate your wallet via accessing the container and run:
# cd /wallet
# loki-wallet-cli
# oxen-wallet-cli
VOLUME /wallet
EXPOSE 22022
EXPOSE 22023
# switch to user monero
USER loki
# switch to user oxen
USER oxen
ENTRYPOINT ["lokid", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=22022", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=22023", "--non-interactive", "--confirm-external-bind"]
ENTRYPOINT ["oxend", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=22022", "--rpc-bind-ip=0.0.0.0", "--rpc-bind-port=22023", "--non-interactive", "--confirm-external-bind"]

114
README.md
View File

@ -1,4 +1,4 @@
# Loki
# Oxen
<p align="center">
<a href="https://github.com/loki-project/loki/commits/dev"><img alt="pipeline status" src="https://gitlab.com/lokiproject/loki/badges/dev/pipeline.svg" /></a>
@ -22,13 +22,13 @@ Portions Copyright (c) 2012-2013 The Cryptonote developers.
## Information
Loki is a private cryptocurrency based on Monero. Loki currently offers an incentivised full node layer, over the coming months we will be looking to support a secondary p2p network (Lokinet) and a messenger that offers private communications based on the Signal protocol (Loki Messenger).
Oxen is a private cryptocurrency based on Monero. Oxen currently offers an incentivised full node layer, over the coming months we will be looking to support a secondary p2p network (Lokinet) and a messenger that offers private communications based on the Signal protocol (Session).
More information on the project can be found on the website and in the whitepaper.
Loki is an open source project, and we encourage contributions from anyone with something to offer. For more information on contributing, please contact team@loki.network
Oxen is an open source project, and we encourage contributions from anyone with something to offer. For more information on contributing, please contact team@loki.network
## Compiling Loki from source
## Compiling Oxen from source
### Dependencies
@ -49,7 +49,7 @@ library archives (`.a`).
| Boost | 1.65 | NO | `libboost-all-dev`[2] | `boost` | `boost-devel` | NO | C++ libraries |
| OpenSSL | basically any | NO | `libssl-dev` | `openssl` | `openssl-devel` | NO | sha256 sum |
| libzmq | 4.3.0 | YES | `libzmq3-dev` | `zeromq` | `zeromq-devel` | NO | ZeroMQ library |
| sqlite3 | ? | YES | `libsqlite3-dev` | `sqlite` | `sqlite-devel` | NO | Loki Name System |
| sqlite3 | ? | YES | `libsqlite3-dev` | `sqlite` | `sqlite-devel` | NO | Oxen Name System |
| libunbound | 1.4.16 | NO | `libunbound-dev` | `unbound` | `unbound-devel` | NO | DNS resolver |
| libsodium | 1.0.9 | YES | `libsodium-dev` | `libsodium` | `libsodium-devel` | NO | cryptography |
| libcurl | 4.0 | NO | `libcurl4-openssl-dev` | `curl` | `curl-devel` | NO | HTTP RPC |
@ -101,7 +101,7 @@ If you already have a repo cloned, initialize and update:
### Build instructions
Loki uses the CMake build system and an optional top-level [Makefile](Makefile) that wraps cmake
Oxen uses the CMake build system and an optional top-level [Makefile](Makefile) that wraps cmake
commands as needed (alternatively you may create a build directory and invoke cmake directly).
#### On Linux and macOS
@ -121,7 +121,7 @@ commands as needed (alternatively you may create a build directory and invoke cm
available per thread.
*Note*: The instructions above will compile the most stable release of the
Loki software. If you would like to use and test the most recent software,
Oxen software. If you would like to use and test the most recent software,
use ```git checkout master```. The master branch may contain updates that are
both unstable and incompatible with release software, though testing is always
encouraged.
@ -130,7 +130,7 @@ commands as needed (alternatively you may create a build directory and invoke cm
* Add `PATH="$PATH:$HOME/loki/build/release/bin"` to `.profile`
* Run Loki with `lokid --detach`
* Run Oxen with `oxend --detach`
* **Optional**: build and run the test suite to verify the binaries:
@ -169,7 +169,7 @@ the swap file is on the SD card: intensive writes to a swap file on an SD card c
quickly the SD card wears out. Devices with 4GB of RAM (such as the 4GB model of the Pi 4B, and
some other SBC ARM devices) can build without needing swap.
As an alternative, pre-built loki debs are available for ARM32 and ARM64 for recent
As an alternative, pre-built oxen debs are available for ARM32 and ARM64 for recent
Debian/Raspbian/Ubuntu distributions and are often a much better alternative for SBC-class devices.
If you still want to compile from source, ensure you have enough memory (or swap -- consult your OS
documentation to learn how to enable or increase swap size) and follow the regular linux build
@ -257,7 +257,7 @@ application.
make release-static-win32
```
* The resulting executables can be found in `build/<MinGW version>/<loki version>/release/bin`
* The resulting executables can be found in `build/<MinGW version>/<oxen version>/release/bin`
* **Optional**: to build Windows binaries suitable for debugging on a 64-bit system, run:
@ -271,12 +271,12 @@ application.
make debug-static-win32
```
* The resulting executables can be found in `build/<MinGW version>/<loki version>/debug/bin`
* The resulting executables can be found in `build/<MinGW version>/<oxen version>/debug/bin`
### On FreeBSD:
The project can be built from scratch by following instructions for Linux above(but use `gmake` instead of `make`).
If you are running Loki in a jail, you need to add `sysvsem="new"` to your jail configuration, otherwise lmdb will throw the error message: `Failed to open lmdb environment: Function not implemented`.
If you are running Oxen in a jail, you need to add `sysvsem="new"` to your jail configuration, otherwise lmdb will throw the error message: `Failed to open lmdb environment: Function not implemented`.
### On OpenBSD:
@ -285,9 +285,9 @@ You will need to add a few packages to your system. `pkg_add cmake gmake zeromq
The `doxygen` and `graphviz` packages are optional and require the xbase set.
Running the test suite also requires `py-requests` package.
Build loki: `env DEVELOPER_LOCAL_TOOLS=1 BOOST_ROOT=/usr/local gmake release-static`
Build oxen: `env DEVELOPER_LOCAL_TOOLS=1 BOOST_ROOT=/usr/local gmake release-static`
Note: you may encounter the following error, when compiling the latest version of loki as a normal user:
Note: you may encounter the following error, when compiling the latest version of oxen as a normal user:
```
LLVM ERROR: out of memory
@ -313,13 +313,13 @@ Then you can run make as usual.
```bash
# Build image (for ARM 32-bit)
docker build -f utils/build_scripts/android32.Dockerfile -t loki-android .
docker build -f utils/build_scripts/android32.Dockerfile -t oxen-android .
# Build image (for ARM 64-bit)
docker build -f utils/build_scripts/android64.Dockerfile -t loki-android .
docker build -f utils/build_scripts/android64.Dockerfile -t oxen-android .
# Create container
docker create -it --name loki-android loki-android bash
docker create -it --name oxen-android oxen-android bash
# Get binaries
docker cp loki-android:/src/build/release/bin .
docker cp oxen-android:/src/build/release/bin .
```
### Building portable statically linked binaries
@ -356,11 +356,11 @@ You can also cross-compile static binaries on Linux for Windows and macOS with t
The required packages are the names for each toolchain on apt. Depending on your distro, they may have different names.
Using `depends` might also be easier to compile Loki on Windows than using MSYS. Activate Windows Subsystem for Linux (WSL) with a distro (for example Ubuntu), install the apt build-essentials and follow the `depends` steps as depicted above.
Using `depends` might also be easier to compile Oxen on Windows than using MSYS. Activate Windows Subsystem for Linux (WSL) with a distro (for example Ubuntu), install the apt build-essentials and follow the `depends` steps as depicted above.
The produced binaries still link libc dynamically. If the binary is compiled on a current distribution, it might not run on an older distribution with an older installation of libc. Passing `-DBACKCOMPAT=ON` to cmake will make sure that the binary will run on systems having at least libc version 2.17.
## Installing Loki from a package
## Installing Oxen from a package
Pre-built packages are available for recent Debian and Ubuntu systems (and are often usable on
Debian or Ubuntu-derived Linux distributions). For more details see https://deb.imaginary.stream
@ -371,32 +371,32 @@ You can also build a docker package using:
```bash
# Build using all available cores
docker build -t loki-daemon-image .
docker build -t oxen-daemon-image .
# or build using a specific number of cores (reduce RAM requirement)
docker build --build-arg NPROC=1 -t loki .
docker build --build-arg NPROC=1 -t oxen .
# either run in foreground
docker run -it -v /loki/chain:/root/.loki -v /loki/wallet:/wallet -p 22022:22022 loki
docker run -it -v /oxen/chain:/root/.oxen -v /oxen/wallet:/wallet -p 22022:22022 oxen
# or in background
docker run -it -d -v /loki/chain:/root/.loki -v /loki/wallet:/wallet -p 22022:22022 loki
docker run -it -d -v /oxen/chain:/root/.oxen -v /oxen/wallet:/wallet -p 22022:22022 oxen
```
* The build needs 3 GB space.
* Wait one hour or more. For docker, the collect_from_docker_container.sh script will automate downloading the binaries from the docker container.
## Running lokid
## Running oxend
The build places the binary in `bin/` sub-directory within the build directory
from which cmake was invoked (repository root by default). To run in
foreground:
```bash
./bin/lokid
./bin/oxend
```
To list all available options, run `./bin/lokid --help`. Options can be
To list all available options, run `./bin/oxend --help`. Options can be
specified either on the command line or in a configuration file passed by the
`--config-file` argument. To specify an option in the configuration file, add
a line with the syntax `argumentname=value`, where `argumentname` is the name
@ -405,18 +405,18 @@ of the argument without the leading dashes, for example `log-level=1`.
To run in background:
```bash
./bin/lokid --log-file lokid.log --detach
./bin/oxend --log-file oxend.log --detach
```
To run as a systemd service, copy
[lokid.service](utils/systemd/lokid.service) to `/etc/systemd/system/` and
[lokid.conf](utils/conf/lokid.conf) to `/etc/`. The [example
service](utils/systemd/lokid.service) assumes that the user `loki` exists
[oxend.service](utils/systemd/oxend.service) to `/etc/systemd/system/` and
[oxend.conf](utils/conf/oxend.conf) to `/etc/`. The [example
service](utils/systemd/oxend.service) assumes that the user `oxen` exists
and its home is the data directory specified in the [example
config](utils/conf/lokid.conf).
config](utils/conf/oxend.conf).
If you're on Mac, you may need to add the `--max-concurrency 1` option to
loki-wallet-cli, and possibly lokid, if you get crashes refreshing.
oxen-wallet-cli, and possibly oxend, if you get crashes refreshing.
## Internationalization
@ -430,32 +430,32 @@ See [README.i18n.md](README.i18n.md).
> used solely for relaying transactions received over local RPC. This provides
> privacy and better protection against surrounding node (sybil) attacks.
While Loki isn't made to integrate with Tor, it can be used wrapped with torsocks, by
While Oxen isn't made to integrate with Tor, it can be used wrapped with torsocks, by
setting the following configuration parameters and environment variables:
* `--p2p-bind-ip 127.0.0.1` on the command line or `p2p-bind-ip=127.0.0.1` in
lokid.conf to disable listening for connections on external interfaces.
* `--no-igd` on the command line or `no-igd=1` in lokid.conf to disable IGD
oxend.conf to disable listening for connections on external interfaces.
* `--no-igd` on the command line or `no-igd=1` in oxend.conf to disable IGD
(UPnP port forwarding negotiation), which is pointless with Tor.
* `DNS_PUBLIC=tcp` or `DNS_PUBLIC=tcp://x.x.x.x` where x.x.x.x is the IP of the
desired DNS server, for DNS requests to go over TCP, so that they are routed
through Tor. When IP is not specified, lokid uses the default list of
through Tor. When IP is not specified, oxend uses the default list of
servers defined in [src/common/dns_utils.cpp](src/common/dns_utils.cpp).
* `TORSOCKS_ALLOW_INBOUND=1` to tell torsocks to allow lokid to bind to interfaces
* `TORSOCKS_ALLOW_INBOUND=1` to tell torsocks to allow oxend to bind to interfaces
to accept connections from the wallet. On some Linux systems, torsocks
allows binding to localhost by default, so setting this variable is only
necessary to allow binding to local LAN/VPN interfaces to allow wallets to
connect from remote hosts. On other systems, it may be needed for local wallets
as well.
* Do NOT pass `--detach` when running through torsocks with systemd, (see
[utils/systemd/lokid.service](utils/systemd/lokid.service) for details).
[utils/systemd/oxend.service](utils/systemd/oxend.service) for details).
* If you use the wallet with a Tor daemon via the loopback IP (eg, 127.0.0.1:9050),
then use `--untrusted-daemon` unless it is your own hidden service.
Example command line to start lokid through Tor:
Example command line to start oxend through Tor:
```bash
DNS_PUBLIC=tcp torsocks lokid --p2p-bind-ip 127.0.0.1 --no-igd
DNS_PUBLIC=tcp torsocks oxend --p2p-bind-ip 127.0.0.1 --no-igd
```
### Using Tor on Tails
@ -466,13 +466,13 @@ allow inbound connections. Full example:
```bash
sudo iptables -I OUTPUT 2 -p tcp -d 127.0.0.1 -m tcp --dport 22023 -j ACCEPT
DNS_PUBLIC=tcp torsocks ./lokid --p2p-bind-ip 127.0.0.1 --no-igd --rpc-bind-ip 127.0.0.1 \
DNS_PUBLIC=tcp torsocks ./oxend --p2p-bind-ip 127.0.0.1 --no-igd --rpc-bind-ip 127.0.0.1 \
--data-dir /home/amnesia/Persistent/your/directory/to/the/blockchain
```
## Debugging
This section contains general instructions for debugging failed installs or problems encountered with Loki. First ensure you are running the latest version built from the Github repo.
This section contains general instructions for debugging failed installs or problems encountered with Oxen. First ensure you are running the latest version built from the Github repo.
### Obtaining stack traces and core dumps on Unix systems
@ -485,7 +485,7 @@ Run the build.
Once it stalls, enter the following command:
```bash
gdb /path/to/lokid `pidof lokid`
gdb /path/to/oxend `pidof oxend`
```
Type `thread apply all bt` within gdb in order to obtain the stack trace
@ -498,12 +498,12 @@ Enter `echo core | sudo tee /proc/sys/kernel/core_pattern` to stop cores from be
Run the build.
When it terminates with an output along the lines of "Segmentation fault (core dumped)", there should be a core dump file in the same directory as lokid. It may be named just `core`, or `core.xxxx` with numbers appended.
When it terminates with an output along the lines of "Segmentation fault (core dumped)", there should be a core dump file in the same directory as oxend. It may be named just `core`, or `core.xxxx` with numbers appended.
You can now analyse this core dump with `gdb` as follows:
```bash
gdb /path/to/lokid /path/to/dumpfile`
gdb /path/to/oxend /path/to/dumpfile`
```
Print the stack trace with `bt`
@ -514,13 +514,13 @@ Print the stack trace with `bt`
coredumpctl -1 gdb
```
#### To run Loki within gdb:
#### To run Oxen within gdb:
Type `gdb /path/to/lokid`
Type `gdb /path/to/oxend`
Pass command-line options with `--args` followed by the relevant arguments
Type `run` to run lokid
Type `run` to run oxend
### Analysing memory corruption
@ -528,17 +528,17 @@ There are two tools available:
#### ASAN
Configure Loki with the -D SANITIZE=ON cmake flag, eg:
Configure Oxen with the -D SANITIZE=ON cmake flag, eg:
```bash
cd build/debug && cmake -D SANITIZE=ON -D CMAKE_BUILD_TYPE=Debug ../..
```
You can then run the loki tools normally. Performance will typically halve.
You can then run the oxen tools normally. Performance will typically halve.
#### valgrind
Install valgrind and run as `valgrind /path/to/lokid`. It will be very slow.
Install valgrind and run as `valgrind /path/to/oxend`. It will be very slow.
### LMDB
@ -547,7 +547,7 @@ Instructions for debugging suspected blockchain corruption as per @HYC
There is an `mdb_stat` command in the LMDB source that can print statistics about the database but it's not routinely built. This can be built with the following command:
```bash
cd ~/loki/external/db_drivers/liblmdb && make
cd ~/oxen/external/db_drivers/liblmdb && make
```
The output of `mdb_stat -ea <path to blockchain dir>` will indicate inconsistencies in the blocks, block_heights and block_info table.
@ -562,13 +562,13 @@ These records are dumped as hex data, where the first line is the key and the se
### Socket-based
Because of the nature of the socket-based protocols that drive Loki, certain protocol weaknesses are somewhat unavoidable at this time. While these weaknesses can theoretically be fully mitigated, the effort required (the means) may not justify the ends. As such, please consider taking the following precautions if you are a Loki node operator:
Because of the nature of the socket-based protocols that drive Oxen, certain protocol weaknesses are somewhat unavoidable at this time. While these weaknesses can theoretically be fully mitigated, the effort required (the means) may not justify the ends. As such, please consider taking the following precautions if you are a Oxen node operator:
- Run `lokid` on a "secured" machine. If operational security is not your forte, at a very minimum, have a dedicated a computer running `lokid` and **do not** browse the web, use email clients, or use any other potentially harmful apps on your `lokid` machine. **Do not click links or load URL/MUA content on the same machine**. Doing so may potentially exploit weaknesses in commands which accept "localhost" and "127.0.0.1".
- If you plan on hosting a public "remote" node, start `lokid` with `--restricted-rpc`. This is a must.
- Run `oxend` on a "secured" machine. If operational security is not your forte, at a very minimum, have a dedicated a computer running `oxend` and **do not** browse the web, use email clients, or use any other potentially harmful apps on your `oxend` machine. **Do not click links or load URL/MUA content on the same machine**. Doing so may potentially exploit weaknesses in commands which accept "localhost" and "127.0.0.1".
- If you plan on hosting a public "remote" node, start `oxend` with `--restricted-rpc`. This is a must.
### Blockchain-based
Certain blockchain "features" can be considered "bugs" if misused correctly. Consequently, please consider the following:
- When receiving Loki, be aware that it may be locked for an arbitrary time if the sender elected to, preventing you from spending that Loki until the lock time expires. You may want to hold off acting upon such a transaction until the unlock time lapses. To get a sense of that time, you can consider the remaining blocktime until unlock as seen in the `show_transfers` command.
- When receiving Oxen, be aware that it may be locked for an arbitrary time if the sender elected to, preventing you from spending that Oxen until the lock time expires. You may want to hold off acting upon such a transaction until the unlock time lapses. To get a sense of that time, you can consider the remaining blocktime until unlock as seen in the `show_transfers` command.

View File

@ -8,20 +8,23 @@ import nacl.secret
from base64 import b64encode, b32encode
import sys
name = "Jason.loki"
name = "Blocks.loki"
type = 2 # 2 == lokinet, 0 == session
# Calculate the blake2b hash of the lower-case full name (including the .loki):
name_hash = nacl.hash.blake2b(name.lower().encode(), encoder=nacl.encoding.RawEncoder)
# Encode name_hash in base64. The RPC call will also accept hex, if easier.
# Encode name_hash in base64. (The RPC call below will also accept the value as hex, if easier, but
# b64 is a bit smaller).
name_hash_b64 = b64encode(name_hash)
print("Name: {}, hashed+base64: {}".format(name, name_hash_b64.decode()))
# Make the RPC request to some lokid
r = requests.post('http://localhost:22023/json_rpc',
# Make the RPC request to some oxend
r = requests.post('http://public.loki.foundation:22023/json_rpc',
json={ "jsonrpc": "2.0", "id": "0",
"method": "lns_resolve", "params": { "type": 2, "name_hash": name_hash_b64 }
"method": "lns_resolve",
"params": { "type": 2, "name_hash": name_hash_b64 }
}).json()
if 'result' in r:
@ -38,7 +41,7 @@ if 'encrypted_value' not in r or 'nonce' not in r:
print("{} does not exist".format(name))
sys.exit(1)
# Decryption key: another blake2b hash, this time with the first one as the key
# Decryption key: another blake2b hash, but this time a keyed blake2b hash where the first hash is the key
decrypt_key = nacl.hash.blake2b(name.lower().encode(), key=name_hash, encoder=nacl.encoding.RawEncoder);
# XChaCha20+Poly1305 decryption:

View File

@ -44,8 +44,8 @@ function (enable_stack_trace target)
endif()
endfunction()
set_property(GLOBAL PROPERTY loki_executable_targets "")
function (loki_add_executable target binary)
set_property(GLOBAL PROPERTY oxen_executable_targets "")
function (oxen_add_executable target binary)
add_executable("${target}" ${ARGN})
target_link_libraries("${target}" PRIVATE extra)
enable_stack_trace("${target}")
@ -53,9 +53,9 @@ function (loki_add_executable target binary)
OUTPUT_NAME "${binary}"
RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin")
install(TARGETS "${target}" DESTINATION bin)
get_property(exec_tgt GLOBAL PROPERTY loki_executable_targets)
get_property(exec_tgt GLOBAL PROPERTY oxen_executable_targets)
list(APPEND exec_tgt "${target}")
set_property(GLOBAL PROPERTY loki_executable_targets "${exec_tgt}")
set_property(GLOBAL PROPERTY oxen_executable_targets "${exec_tgt}")
endfunction ()
include(Version)

View File

@ -38,8 +38,8 @@
#include "lmdb/db_lmdb.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "blockchain.db"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "blockchain.db"
namespace cryptonote
{

View File

@ -48,8 +48,8 @@
#include "cryptonote_core/service_node_list.h"
#include "cryptonote_basic/hardfork.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "blockchain.db.lmdb"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "blockchain.db.lmdb"
using namespace crypto;
@ -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

@ -37,7 +37,7 @@ target_link_libraries(blockchain_tools_common_libs INTERFACE
extra)
loki_add_executable(blockchain_import "loki-blockchain-import"
oxen_add_executable(blockchain_import "oxen-blockchain-import"
blockchain_import.cpp
bootstrap_file.cpp
blocksdat_file.cpp
@ -51,7 +51,7 @@ if(ARCH_WIDTH)
target_compile_definitions(blockchain_import PRIVATE ARCH_WIDTH=${ARCH_WIDTH})
endif()
loki_add_executable(blockchain_export "loki-blockchain-export"
oxen_add_executable(blockchain_export "oxen-blockchain-export"
blockchain_export.cpp
bootstrap_file.cpp
blocksdat_file.cpp
@ -59,7 +59,7 @@ loki_add_executable(blockchain_export "loki-blockchain-export"
target_link_libraries(blockchain_export PRIVATE blockchain_tools_common_libs)
loki_add_executable(blockchain_blackball "loki-blockchain-mark-spent-outputs"
oxen_add_executable(blockchain_blackball "oxen-blockchain-mark-spent-outputs"
blockchain_blackball.cpp
)
@ -69,28 +69,28 @@ target_link_libraries(blockchain_blackball
wallet)
loki_add_executable(blockchain_usage "loki-blockchain-usage"
oxen_add_executable(blockchain_usage "oxen-blockchain-usage"
blockchain_usage.cpp
)
target_link_libraries(blockchain_usage PRIVATE blockchain_tools_common_libs)
loki_add_executable(blockchain_ancestry "loki-blockchain-ancestry"
oxen_add_executable(blockchain_ancestry "oxen-blockchain-ancestry"
blockchain_ancestry.cpp
)
target_link_libraries(blockchain_ancestry PRIVATE blockchain_tools_common_libs)
loki_add_executable(blockchain_depth "loki-blockchain-depth"
oxen_add_executable(blockchain_depth "oxen-blockchain-depth"
blockchain_depth.cpp
)
target_link_libraries(blockchain_depth PRIVATE blockchain_tools_common_libs)
loki_add_executable(blockchain_stats "loki-blockchain-stats"
oxen_add_executable(blockchain_stats "oxen-blockchain-stats"
blockchain_stats.cpp
)
target_link_libraries(blockchain_stats PRIVATE blockchain_tools_common_libs)
# TODO(loki): Blockchain pruning not supported in Loki yet
# loki_add_executable(blockchain_prune_known_spent_data "loki-blockchain-prune-known-spent-data"
# TODO(oxen): Blockchain pruning not supported in Oxen yet
# oxen_add_executable(blockchain_prune_known_spent_data "oxen-blockchain-prune-known-spent-data"
# blockchain_prune_known_spent_data.cpp
# )
#
@ -99,7 +99,7 @@ target_link_libraries(blockchain_stats PRIVATE blockchain_tools_common_libs)
# blockchain_tools_common_libs
# p2p)
#
# loki_add_executable(blockchain_prune "loki-blockchain-prune"
# oxen_add_executable(blockchain_prune "oxen-blockchain-prune"
# blockchain_prune.cpp
# )
#
@ -109,8 +109,8 @@ target_link_libraries(blockchain_stats PRIVATE blockchain_tools_common_libs)
# p2p)
if (TARGET sodium_vendor OR NOT SODIUM_VERSION VERSION_LESS 1.0.17)
loki_add_executable(sn_key_tool "loki-sn-keys" sn_key_tool.cpp)
oxen_add_executable(sn_key_tool "oxen-sn-keys" sn_key_tool.cpp)
target_link_libraries(sn_key_tool PRIVATE sodium lokimq filesystem)
else()
message(STATUS "Not building loki-sn-keys tool (requires libsodium >= 1.0.17)")
message(STATUS "Not building oxen-sn-keys tool (requires libsodium >= 1.0.17)")
endif()

View File

@ -1,4 +1,4 @@
# Loki Blockchain Utilities
# Oxen Blockchain Utilities
Copyright (c) 2014-2019, The Monero Project
Copyright (c) 2018, The Loki Project
@ -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`
This loads the existing blockchain and exports it to `$OXEN_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.
This imports blocks from `$OXEN_DATA_DIR/export/blockchain.raw` (exported using the
`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>
@ -46,8 +46,8 @@
#include "blockchain_db/blockchain_db.h"
#include "version.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;
using namespace cryptonote;
@ -383,12 +383,12 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
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"
@ -46,8 +46,8 @@
#include "wallet/ringdb.h"
#include "version.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;
using namespace cryptonote;
@ -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;
@ -228,7 +228,8 @@ static void init(fs::path cache_filename)
MINFO("Creating spent output cache in " << cache_filename);
if (std::error_code ec; !fs::create_directories(cache_filename, ec))
std::error_code ec;
if (fs::create_directories(cache_filename, ec); ec)
MWARNING("Failed to create output cache directory " << cache_filename << ": " << ec.message());
int flags = 0;
@ -248,7 +249,7 @@ static void init(fs::path cache_filename)
dbr = mdb_txn_begin(env, NULL, 0, &txn);
CHECK_AND_ASSERT_THROW_MES(!dbr, "Failed to create LMDB transaction: " + std::string(mdb_strerror(dbr)));
LOKI_DEFER { if (tx_active) mdb_txn_abort(txn); };
OXEN_DEFER { if (tx_active) mdb_txn_abort(txn); };
tx_active = true;
dbr = mdb_dbi_open(txn, "relative_rings", MDB_CREATE | MDB_INTEGERKEY, &dbi_relative_rings);
@ -351,7 +352,7 @@ static bool for_all_transactions(const fs::path& filename, uint64_t& start_idx,
dbr = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
if (dbr) throw std::runtime_error("Failed to create LMDB transaction: " + std::string(mdb_strerror(dbr)));
LOKI_DEFER { if (tx_active) mdb_txn_abort(txn); };
OXEN_DEFER { if (tx_active) mdb_txn_abort(txn); };
tx_active = true;
dbr = mdb_dbi_open(txn, "txs_pruned", MDB_INTEGERKEY, &dbi);
@ -431,7 +432,7 @@ static bool for_all_transactions(const fs::path& filename, const uint64_t& start
dbr = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
if (dbr) throw std::runtime_error("Failed to create LMDB transaction: " + std::string(mdb_strerror(dbr)));
LOKI_DEFER { if (tx_active) mdb_txn_abort(txn); };
OXEN_DEFER { if (tx_active) mdb_txn_abort(txn); };
tx_active = true;
dbr = mdb_dbi_open(txn, "blocks", MDB_INTEGERKEY, &dbi_blocks);
@ -530,7 +531,7 @@ static uint64_t find_first_diverging_transaction(const fs::path& first_filename,
MDB_val k;
MDB_val v[2];
LOKI_DEFER {
OXEN_DEFER {
for (int i = 0; i < 2; i++)
if (tx_active[i]) mdb_txn_abort(txn[i]);
};
@ -617,7 +618,7 @@ static uint64_t get_num_spent_outputs()
int dbr = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
CHECK_AND_ASSERT_THROW_MES(!dbr, "Failed to create LMDB transaction: " + std::string(mdb_strerror(dbr)));
LOKI_DEFER { if (tx_active) mdb_txn_abort(txn); };
OXEN_DEFER { if (tx_active) mdb_txn_abort(txn); };
tx_active = true;
MDB_cursor *cur;
@ -753,7 +754,7 @@ static uint64_t get_processed_txidx(const std::string &name)
int dbr = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
CHECK_AND_ASSERT_THROW_MES(!dbr, "Failed to create LMDB transaction: " + std::string(mdb_strerror(dbr)));
LOKI_DEFER { if (tx_active) mdb_txn_abort(txn); };
OXEN_DEFER { if (tx_active) mdb_txn_abort(txn); };
tx_active = true;
uint64_t height = 0;
@ -951,7 +952,9 @@ static void inc_stat(MDB_txn *txn, const char *key)
static void open_db(const fs::path& filename, MDB_env** env, MDB_txn** txn, MDB_cursor** cur, MDB_dbi* dbi)
{
tools::create_directories_if_necessary(filename);
std::error_code ec;
if (fs::create_directories(filename, ec); ec)
MWARNING("Failed to create lmdb path " << filename << ": " << ec.message());
int flags = MDB_RDONLY;
if (db_flags & DBF_FAST)
@ -963,7 +966,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)));
@ -1029,7 +1032,7 @@ static crypto::hash get_genesis_block_hash(const fs::path& filename)
dbr = mdb_txn_begin(env, NULL, MDB_RDONLY, &txn);
if (dbr) throw std::runtime_error("Failed to create LMDB transaction: " + std::string(mdb_strerror(dbr)));
LOKI_DEFER { if (tx_active) mdb_txn_abort(txn); };
OXEN_DEFER { if (tx_active) mdb_txn_abort(txn); };
tx_active = true;
dbr = mdb_dbi_open(txn, "block_info", MDB_INTEGERKEY | MDB_DUPSORT | MDB_DUPFIXED, &dbi);
@ -1191,7 +1194,7 @@ int main(int argc, char* argv[])
const command_line::arg_descriptor<bool> arg_rct_only = {"rct-only", "Only work on ringCT outputs", false};
const command_line::arg_descriptor<bool> arg_check_subsets = {"check-subsets", "Check ring subsets (very expensive)", false};
const command_line::arg_descriptor<bool> arg_verbose = {"verbose", "Verbose output)", false};
const command_line::arg_descriptor<std::vector<std::string> > arg_inputs = {"inputs", "Path to Loki DB, and path to any fork DBs"};
const command_line::arg_descriptor<std::vector<std::string> > arg_inputs = {"inputs", "Path to Oxen DB, and path to any fork DBs"};
const command_line::arg_descriptor<std::string> arg_db_sync_mode = {
"db-sync-mode"
, "Specify sync option, using format [safe|fast|fastest]:[nrecords_per_sync]."
@ -1234,12 +1237,12 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
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

@ -33,8 +33,8 @@
#include "blockchain_db/blockchain_db.h"
#include "version.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;
using namespace cryptonote;
@ -83,12 +83,12 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
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

@ -34,8 +34,8 @@
#include "blockchain_objects.h"
#include "version.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;
@ -86,12 +86,12 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
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

@ -44,8 +44,8 @@
#include "cryptonote_core/cryptonote_core.h"
#include "common/hex.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace
{
@ -603,7 +603,7 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
return 1;
}
@ -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

@ -39,8 +39,8 @@
#include "blockchain_objects.h"
#include "version.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
#define MDB_val_set(var, val) MDB_val var = {sizeof(val), (void *)&val}
@ -156,7 +156,7 @@ static void copy_table(MDB_env *env0, MDB_env *env1, const char *table, unsigned
MINFO("Copying " << table);
LOKI_DEFER {
OXEN_DEFER {
if (tx_active1) mdb_txn_abort(txn1);
if (tx_active0) mdb_txn_abort(txn0);
};
@ -253,7 +253,7 @@ static void prune(MDB_env *env0, MDB_env *env1)
MGINFO("Creating pruned txs_prunable");
LOKI_DEFER {
OXEN_DEFER {
if (tx_active1) mdb_txn_abort(txn1);
if (tx_active0) mdb_txn_abort(txn0);
};
@ -479,12 +479,12 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
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"
@ -37,8 +37,8 @@
#include "blockchain_db/blockchain_db.h"
#include "version.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;
using namespace cryptonote;
@ -145,12 +145,12 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
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

@ -37,8 +37,8 @@
#include "version.h"
#include "epee/misc_os_dependent.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;
using namespace cryptonote;
@ -97,12 +97,12 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
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
@ -160,7 +160,7 @@ int main(int argc, char* argv[])
/*
* The default output can be plotted with GnuPlot using these commands:
set key autotitle columnhead
set title "Loki Blockchain Growth"
set title "Oxen Blockchain Growth"
set timefmt "%Y-%m-%d"
set xdata time
set xrange ["2014-04-17":*]

View File

@ -34,8 +34,8 @@
#include "blockchain_db/blockchain_db.h"
#include "version.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;
using namespace cryptonote;
@ -116,12 +116,12 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
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,8 +29,8 @@
#include "blocksdat_file.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;

View File

@ -32,8 +32,8 @@
#include "bootstrap_file.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "bcutil"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "bcutil"
namespace po = boost::program_options;
@ -42,7 +42,7 @@ using namespace cryptonote;
namespace
{
// This number was picked by taking the leading 4 bytes from this output:
// echo Loki bootstrap file | sha1sum
// echo Oxen bootstrap file | sha1sum
const uint32_t blockchain_raw_magic = 0x28721586;
const uint32_t header_size = 1024;

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`
@ -44,7 +44,7 @@ legacy [--overwrite] FILENAME
If FILENAME already exists the command will fail unless the `--overwrite`
flag is specified.
Note that legacy keypairs are not needed as of Loki 8.x; you can use just a
Note that legacy keypairs are not needed as of Oxen 8.x; you can use just a
Ed25519 keypair (and this is the default for new service node
installations).

View File

@ -39,13 +39,13 @@
#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"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "checkpoints"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "checkpoints"
namespace cryptonote
{
@ -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
@ -309,10 +309,10 @@ namespace cryptonote
if (db->is_read_only())
return true;
#if !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if !defined(OXEN_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

@ -41,8 +41,8 @@
#include "common/threadpool.h"
#include "crypto/crypto.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.dns"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "net.dns"
using namespace std::literals;
static constexpr std::array DEFAULT_DNS_PUBLIC_ADDR =
@ -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

@ -59,8 +59,8 @@
#include "cryptonote_config.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "util"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "util"
namespace tools {
@ -274,6 +274,10 @@ namespace tools {
{
return get_special_folder_path(CSIDL_COMMON_APPDATA, true) / fs::u8path(CRYPTONOTE_NAME);
}
fs::path get_depreciated_default_data_dir()
{
return get_special_folder_path(CSIDL_COMMON_APPDATA, true) / fs::u8path("loki");
}
#else
// Non-windows: ~/.CRYPTONOTE_NAME
fs::path get_default_data_dir()
@ -281,28 +285,12 @@ namespace tools {
char* home = std::getenv("HOME");
return (home && std::strlen(home) ? fs::u8path(home) : fs::current_path()) / fs::u8path("." CRYPTONOTE_NAME);
}
#endif
bool create_directories_if_necessary(const fs::path& path)
fs::path get_depreciated_default_data_dir()
{
std::error_code ec;
if (fs::is_directory(path, ec))
{
return true;
}
bool res = fs::create_directories(path, ec);
if (res)
{
LOG_PRINT_L2("Created directory: " << path);
}
else
{
LOG_PRINT_L2("Can't create directory: " << path << ", err: "<< ec.message());
}
return res;
char* home = std::getenv("HOME");
return (home && std::strlen(home) ? fs::u8path(home) : fs::current_path()) / fs::u8path(".loki");
}
#endif
void set_strict_default_file_permissions(bool strict)
{

View File

@ -111,6 +111,7 @@ namespace tools {
* Unix: ~/.CRYPTONOTE_NAME
*/
fs::path get_default_data_dir();
fs::path get_depreciated_default_data_dir();
#ifdef WIN32
/**
@ -124,12 +125,6 @@ namespace tools {
fs::path get_special_folder_path(int nfolder, bool iscreate);
#endif
/*! \brief creates directories for a path
*
* wrapper around fs::create_directories.
*/
bool create_directories_if_necessary(const fs::path& path);
void set_strict_default_file_permissions(bool strict);
void closefrom(int fd);

View File

@ -38,8 +38,8 @@
#include <algorithm>
#include "file.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "i18n"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "i18n"
#define MAX_LANGUAGE_SIZE 16

View File

@ -32,8 +32,8 @@
#include "spawn.h"
#include "notify.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "notify"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "notify"
namespace tools
{

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

@ -26,17 +26,17 @@
// STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
// THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef LOKI_H
#define LOKI_H
#ifndef OXEN_H
#define OXEN_H
#define LOKI_HOUR(val) ((val) * LOKI_MINUTES(60))
#define LOKI_MINUTES(val) val * 60
#define OXEN_HOUR(val) ((val) * OXEN_MINUTES(60))
#define OXEN_MINUTES(val) val * 60
#include <cstddef>
#include <utility>
#define LOKI_RPC_DOC_INTROSPECT
namespace loki
#define OXEN_RPC_DOC_INTROSPECT
namespace oxen
{
double round (double);
double exp2 (double);
@ -69,9 +69,9 @@ struct defer_helper
deferred<lambda_t> operator+(lambda_t lambda) { return lambda; }
};
#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 OXEN_TOKEN_COMBINE2(x, y) x ## y
#define OXEN_TOKEN_COMBINE(x, y) OXEN_TOKEN_COMBINE2(x, y)
#define OXEN_DEFER auto const OXEN_TOKEN_COMBINE(oxen_defer_, __LINE__) = oxen::defer_helper() + [&]()
template <typename T, size_t N>
constexpr size_t array_count(T (&)[N]) { return N; }
@ -79,6 +79,6 @@ constexpr size_t array_count(T (&)[N]) { return N; }
template <typename T, size_t N>
constexpr size_t char_count(T (&)[N]) { return N - 1; }
}; // namespace Loki
}; // namespace Oxen
#endif // LOKI_H
#endif // OXEN_H

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
{
@ -115,7 +115,7 @@ namespace
#else // end WIN32
#if !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if !defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
bool is_cin_tty() noexcept
{
return 0 != isatty(fileno(stdin));
@ -177,11 +177,11 @@ namespace
return true;
}
#endif // !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#endif // !defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
#endif // end !WIN32
#if !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if !defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
bool read_from_tty(const bool verify, const char *message, bool hide_input, epee::wipeable_string& pass1, epee::wipeable_string& pass2)
{
while (true)
@ -233,7 +233,7 @@ namespace
}
return true;
}
#endif // !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#endif // !defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
} // anonymous namespace
@ -250,7 +250,7 @@ namespace tools
std::optional<password_container> password_container::prompt(const bool verify, const char *message, bool hide_input)
{
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
return password_container(std::string(""));
#else
is_prompting = true;

View File

@ -31,8 +31,8 @@
#include "epee/misc_os_dependent.h"
#include "perf_timer.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "perf"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "perf"
#define PERF_LOG_ALWAYS(level, cat, x) \
el::base::Writer(level, __FILE__, __LINE__, ELPP_FUNC, el::base::DispatchAction::FileOnlyLog).construct(cat) << x

View File

@ -72,11 +72,11 @@ private:
void set_performance_timer_log_level(el::Level level);
#define PERF_TIMER_UNIT(name, unit) tools::LoggingPerformanceTimer pt_##name(#name, "perf." LOKI_DEFAULT_LOG_CATEGORY, unit, tools::performance_timer_log_level)
#define PERF_TIMER_UNIT_L(name, unit, l) tools::LoggingPerformanceTimer pt_##name(#name, "perf." LOKI_DEFAULT_LOG_CATEGORY, unit, l)
#define PERF_TIMER_UNIT(name, unit) tools::LoggingPerformanceTimer pt_##name(#name, "perf." OXEN_DEFAULT_LOG_CATEGORY, unit, tools::performance_timer_log_level)
#define PERF_TIMER_UNIT_L(name, unit, l) tools::LoggingPerformanceTimer pt_##name(#name, "perf." OXEN_DEFAULT_LOG_CATEGORY, unit, l)
#define PERF_TIMER(name) PERF_TIMER_UNIT(name, 1000000)
#define PERF_TIMER_L(name, l) PERF_TIMER_UNIT_L(name, 1000000, l)
#define PERF_TIMER_START_UNIT(name, unit) std::unique_ptr<tools::LoggingPerformanceTimer> pt_##name(new tools::LoggingPerformanceTimer(#name, "perf." LOKI_DEFAULT_LOG_CATEGORY, unit, el::Level::Info))
#define PERF_TIMER_START_UNIT(name, unit) std::unique_ptr<tools::LoggingPerformanceTimer> pt_##name(new tools::LoggingPerformanceTimer(#name, "perf." OXEN_DEFAULT_LOG_CATEGORY, unit, el::Level::Info))
#define PERF_TIMER_START(name) PERF_TIMER_START_UNIT(name, 1000000)
#define PERF_TIMER_STOP(name) do { pt_##name.reset(NULL); } while(0)
#define PERF_TIMER_PAUSE(name) pt_##name->pause()

View File

@ -1,12 +1,12 @@
#include "scoped_message_writer.h"
#define LOKI_INTEGRATION_TEST_HOOKS_IMPLEMENTATION
#include "common/loki_integration_test_hooks.h"
#define OXEN_INTEGRATION_TEST_HOOKS_IMPLEMENTATION
#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
@ -16,7 +16,7 @@ tools::scoped_message_writer::~scoped_message_writer()
{
m_flush = false;
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
std::cout << m_oss.str() << "\n";
return;
#endif

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
{
@ -60,8 +60,8 @@ public:
, m_bright(bright)
, 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.
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
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,11 +39,11 @@
#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
#define LOKI_DEFAULT_LOG_CATEGORY "spawn"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "spawn"
namespace tools
{
@ -87,7 +87,7 @@ int spawn(const fs::path& filename, const std::vector<std::string>& args, bool w
return -1;
}
LOKI_DEFER {
OXEN_DEFER {
CloseHandle(pi.hThread);
CloseHandle(pi.hProcess);
};

View File

@ -47,14 +47,14 @@
#include "common/stack_trace.h"
#include "epee/misc_log_ex.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "stacktrace"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "stacktrace"
#define ST_LOG(x) \
do { \
auto elpp = ELPP; \
if (elpp) { \
CINFO(el::base::Writer,el::base::DispatchAction::FileOnlyLog,LOKI_DEFAULT_LOG_CATEGORY) << x; \
CINFO(el::base::Writer,el::base::DispatchAction::FileOnlyLog,OXEN_DEFAULT_LOG_CATEGORY) << x; \
} \
else { \
std::cout << x << std::endl; \

View File

@ -53,8 +53,8 @@
#include <gnu/libc-version.h>
#endif
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "util"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "util"
namespace tools
{
@ -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

@ -47,7 +47,7 @@
#if defined(HAS_INTEL_HW) || defined(HAS_ARM_HW)
inline bool force_software_aes()
{
const char *env = getenv("LOKI_USE_SOFTWARE_AES");
const char *env = getenv("OXEN_USE_SOFTWARE_AES");
return env && strcmp(env, "0") && strcmp(env, "no");
}
#endif
@ -103,7 +103,7 @@ public:
}
// Disable copy/move ctors; copying, in particular, is going to be really inefficient and we
// don't need to move it anywhere in LOKI code anyway.
// don't need to move it anywhere in OXEN code anyway.
cn_heavy_hash(const cn_heavy_hash& other) = delete;
cn_heavy_hash(cn_heavy_hash&& other) = delete;
cn_heavy_hash& operator= (const cn_heavy_hash& other) = delete;

View File

@ -373,7 +373,7 @@ STATIC INLINE int force_software_aes(void)
if (use != -1)
return use;
const char *env = getenv("LOKI_USE_SOFTWARE_AES");
const char *env = getenv("OXEN_USE_SOFTWARE_AES");
if (!env) {
use = 0;
}

View File

@ -43,8 +43,8 @@ extern "C"
#include "cryptonote_config.h"
#include "common/meta.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "account"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "account"
using namespace std;

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,11 +40,11 @@
#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
#define LOKI_DEFAULT_LOG_CATEGORY "cn"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "cn"
namespace cryptonote {
@ -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,10 +48,10 @@
#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"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "cn"
using namespace crypto;
@ -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,14 +31,14 @@
#include <algorithm>
#include "common/loki.h"
#include "common/oxen.h"
#include "epee/int-util.h"
#include "crypto/hash.h"
#include "difficulty.h"
#include "hardfork.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "difficulty"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "difficulty"
namespace cryptonote {
@ -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,13 +30,13 @@
#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"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "hardfork"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "hardfork"
using namespace cryptonote;
@ -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

@ -43,8 +43,8 @@
#include "epee/string_tools.h"
#include "epee/storages/portable_storage_template_helper.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "miner"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "miner"
#define AUTODETECT_WINDOW 10 // seconds
#define AUTODETECT_GAIN_THRESHOLD 1.02f // 2%

View File

@ -33,11 +33,11 @@
#include <boost/serialization/version.hpp>
#include <ostream>
#include "common/loki.h"
#include "common/oxen.h"
namespace cryptonote
{
LOKI_RPC_DOC_INTROSPECT
OXEN_RPC_DOC_INTROSPECT
struct subaddress_index
{
uint32_t major; // The account index, major index

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);
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"
@ -62,7 +62,7 @@ constexpr uint8_t
TX_EXTRA_TAG_TX_KEY_IMAGE_UNLOCK = 0x77,
TX_EXTRA_TAG_SERVICE_NODE_STATE_CHANGE = 0x78,
TX_EXTRA_TAG_BURN = 0x79,
TX_EXTRA_TAG_LOKI_NAME_SYSTEM = 0x7A,
TX_EXTRA_TAG_OXEN_NAME_SYSTEM = 0x7A,
TX_EXTRA_MYSTERIOUS_MINERGATE_TAG = 0xDE;
@ -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;
@ -493,7 +493,7 @@ namespace cryptonote
// 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); }
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_OXEN_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,17 +76,17 @@ 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
#define CRYPTONOTE_COINBASE_BLOB_RESERVED_SIZE 600
#define CRYPTONOTE_DISPLAY_DECIMAL_POINT 9
#define FEE_PER_KB ((uint64_t)2000000000) // 2 LOKI (= 2 * pow(10, 9))
#define FEE_PER_KB ((uint64_t)2000000000) // 2 OXEN (= 2 * pow(10, 9))
#define FEE_PER_BYTE ((uint64_t)215) // Fallback used in wallet if no fee is available from RPC
#define FEE_PER_BYTE_V12 ((uint64_t)17200) // Higher fee (and fallback) in v12 (only, v13 switches back)
#define FEE_PER_OUTPUT ((uint64_t)20000000) // 0.02 LOKI per tx output (in addition to the per-byte fee), starting in v13
#define FEE_PER_OUTPUT ((uint64_t)20000000) // 0.02 OXEN per tx output (in addition to the per-byte fee), starting in v13
#define DYNAMIC_FEE_PER_KB_BASE_BLOCK_REWARD ((uint64_t)10000000000000) // 10 * pow(10,12)
#define DYNAMIC_FEE_PER_KB_BASE_FEE_V5 ((uint64_t)400000000)
#define DYNAMIC_FEE_REFERENCE_TRANSACTION_WEIGHT ((uint64_t)3000)
@ -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"
@ -324,7 +324,7 @@ namespace cryptonote
network_version_9_service_nodes, // Proof Of Stake w/ Service Nodes
network_version_10_bulletproofs, // Bulletproofs, Service Node Grace Registration Period, Batched Governance
network_version_11_infinite_staking, // Infinite Staking, CN-Turtle
network_version_12_checkpointing, // Checkpointing, Relaxed Deregistration, RandomXL, Loki Storage Server
network_version_12_checkpointing, // Checkpointing, Relaxed Deregistration, RandomXL, Oxen Storage Server
network_version_13_enforce_checkpoints,
network_version_14_blink,
network_version_15_lns,

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

@ -70,8 +70,8 @@ extern "C" {
}
#endif
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "blockchain"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "blockchain"
#define FIND_BLOCKCHAIN_SUPPLEMENT_MAX_SIZE (100*1024*1024) // 100 MB
@ -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)
@ -427,7 +427,7 @@ bool Blockchain::init(BlockchainDB* db, sqlite3 *lns_db, const network_type nett
m_db = db;
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
// NOTE(doyle): Passing in test options in integration mode means we're
// overriding fork heights for any nettype in our integration tests using
// a command line argument. So m_nettype should just be nettype. In
@ -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,10 +69,10 @@ 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"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "cn"
DISABLE_VS_WARNINGS(4355)
@ -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."
@ -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);
@ -357,7 +357,7 @@ namespace cryptonote
command_line::add_arg(desc, arg_keep_alt_blocks);
command_line::add_arg(desc, arg_store_quorum_history);
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
command_line::add_arg(desc, integration_test::arg_hardforks_override);
command_line::add_arg(desc, integration_test::arg_pipe_name);
#endif
@ -417,7 +417,7 @@ namespace cryptonote
if (!epee::net_utils::is_ip_public(m_sn_public_ip)) {
if (m_service_node_list.debug_allow_local_ips) {
MWARNING("Address given for public-ip is not public; allowing it because dev-allow-local-ips was specified. This service node WILL NOT WORK ON THE PUBLIC LOKI NETWORK!");
MWARNING("Address given for public-ip is not public; allowing it because dev-allow-local-ips was specified. This service node WILL NOT WORK ON THE PUBLIC OXEN NETWORK!");
} else {
MERROR("Address given for public-ip is not public: " << epee::string_tools::get_ip_string_from_int32(m_sn_public_ip));
storage_ok = false;
@ -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;
}
@ -532,7 +532,7 @@ namespace cryptonote
{
std::string s;
s.reserve(128);
s += 'v'; s += LOKI_VERSION_STR;
s += 'v'; s += OXEN_VERSION_STR;
s += "; Height: ";
s += std::to_string(get_blockchain_storage().get_current_blockchain_height());
s += ", SN: ";
@ -574,7 +574,7 @@ namespace cryptonote
{
start_time = std::time(nullptr);
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
const std::string arg_hardforks_override = command_line::get_arg(vm, integration_test::arg_hardforks_override);
std::vector<std::pair<uint8_t, uint64_t>> integration_test_hardforks;
@ -664,7 +664,7 @@ namespace cryptonote
bool sync_on_blocks = true;
uint64_t sync_threshold = 1;
#if !defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS) // In integration mode, don't delete the DB. This should be explicitly done in the tests. Otherwise the more likely behaviour is persisting the DB across multiple daemons in the same test.
#if !defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS) // In integration mode, don't delete the DB. This should be explicitly done in the tests. Otherwise the more likely behaviour is persisting the DB across multiple daemons in the same test.
if (m_nettype == FAKECHAIN && !keep_fakechain)
{
// reset the db by removing the database file before opening it
@ -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);
@ -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)
{
@ -2067,7 +2067,7 @@ namespace cryptonote
std::vector<block_complete_entry> blocks;
m_miner.pause();
{
LOKI_DEFER { m_miner.resume(); };
OXEN_DEFER { m_miner.resume(); };
try
{
blocks.push_back(get_block_complete_entry(b, m_mempool));
@ -2379,7 +2379,7 @@ namespace cryptonote
m_miner.on_idle();
m_mempool.on_idle();
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
integration_test::state.core_is_idle = true;
#endif
@ -2483,7 +2483,7 @@ namespace cryptonote
return true;
}
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
MDEBUG("Not checking block rate, integration test mode");
return true;
#endif

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 {
@ -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};
@ -1107,7 +1107,7 @@ namespace cryptonote
const blobdata bd = get_block_hashing_blob(b);
const uint8_t hf_version = b.major_version;
#if defined(LOKI_INTEGRATION_TESTS)
#if defined(OXEN_INTEGRATION_TESTS)
miners = 0;
#endif

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>
@ -30,8 +30,8 @@ extern "C"
#include <sodium/randombytes.h>
}
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "lns"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "lns"
namespace lns
{
@ -105,7 +105,7 @@ std::string lns::mapping_value::to_readable_value(cryptonote::network_type netty
std::string result;
if (is_lokinet_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();
@ -775,14 +775,14 @@ bool validate_lns_name(mapping_type type, std::string name, std::string *reason)
if (is_lokinet)
{
// 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 lokinet (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
// - loki.loki and snode.oxen 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})
@ -912,7 +912,7 @@ bool mapping_value::validate(cryptonote::network_type nettype, mapping_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'),
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 lokinet address"))
return false;
@ -1028,10 +1028,10 @@ 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(); };
OXEN_DEFER { if (reason && reason->empty()) *reason = err_stream.str(); };
crypto::hash expected_prev_txid = crypto::null_hash;
std::string name_hash = hash_to_base64(lns_extra.name_hash);
@ -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;
}
}
@ -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

@ -1,5 +1,5 @@
#ifndef LOKI_NAME_SYSTEM_H
#define LOKI_NAME_SYSTEM_H
#ifndef OXEN_NAME_SYSTEM_H
#define OXEN_NAME_SYSTEM_H
#include "crypto/crypto.h"
#include "cryptonote_config.h"
@ -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
@ -131,7 +131,7 @@ constexpr bool mapping_type_allowed(uint8_t hf_version, mapping_type type) {
// 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
@ -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();
@ -321,4 +321,4 @@ private:
};
}; // namespace service_nodes
#endif // LOKI_NAME_SYSTEM_H
#endif // OXEN_NAME_SYSTEM_H

View File

@ -18,8 +18,8 @@ extern "C"
#include <sodium/crypto_generichash.h>
};
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "pulse"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "pulse"
// Deliberately makes pulse communications flakey for testing purposes:
//#define PULSE_TEST_CODE
@ -344,7 +344,7 @@ std::string msg_source_string(round_context const &context, pulse::message const
bool msg_signature_check(pulse::message const &msg, crypto::hash const &top_block_hash, service_nodes::quorum const &quorum, std::string *error)
{
std::stringstream stream;
LOKI_DEFER {
OXEN_DEFER {
if (error) *error = stream.str();
};
@ -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

@ -60,8 +60,8 @@ extern "C" {
#include "service_node_swarm.h"
#include "version.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "service_nodes"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "service_nodes"
namespace service_nodes
{
@ -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*/));
}
@ -2762,7 +2762,7 @@ namespace service_nodes
assert(m_service_node_keys);
const auto& keys = *m_service_node_keys;
cryptonote::NOTIFY_UPTIME_PROOF::request result = {};
result.snode_version = LOKI_VERSION;
result.snode_version = OXEN_VERSION;
result.timestamp = time(nullptr);
result.pubkey = keys.pub;
result.public_ip = public_ip;
@ -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

@ -49,7 +49,7 @@ namespace service_nodes
{
constexpr uint64_t INVALID_HEIGHT = static_cast<uint64_t>(-1);
LOKI_RPC_DOC_INTROSPECT
OXEN_RPC_DOC_INTROSPECT
struct participation_entry
{
bool is_pulse = false;
@ -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,15 +32,15 @@
#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"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "quorum_cop"
namespace service_nodes
{
@ -116,7 +116,7 @@ namespace service_nodes
bool check_uptime_obligation = true;
bool check_checkpoint_obligation = true;
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
if (integration_test::state.disable_obligation_uptime_proof) check_uptime_obligation = false;
if (integration_test::state.disable_obligation_checkpointing) check_checkpoint_obligation = false;
#endif
@ -266,7 +266,7 @@ namespace service_nodes
{
quorum_type const type = static_cast<quorum_type>(i);
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
if (integration_test::state.disable_checkpoint_quorum && type == quorum_type::checkpointing) continue;
if (integration_test::state.disable_obligation_quorum && type == quorum_type::obligations) continue;
#endif
@ -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;
}
@ -447,7 +447,7 @@ namespace service_nodes
// NOTE: Don't warn uptime proofs if the daemon is just
// recently started and is candidate for testing (i.e.
// restarting the daemon)
if (!my_test_results.uptime_proved && live_time < LOKI_HOUR(1))
if (!my_test_results.uptime_proved && live_time < OXEN_HOUR(1))
continue;
LOG_PRINT_L0("Service Node (yours) is active but is not passing tests for quorum: " << m_obligations_height);
@ -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

@ -7,7 +7,7 @@
namespace service_nodes {
constexpr size_t PULSE_QUORUM_ENTROPY_LAG = 21; // How many blocks back from the tip of the Blockchain to source entropy for the Pulse quorums.
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
constexpr auto PULSE_ROUND_TIME = 20s;
constexpr auto PULSE_WAIT_FOR_HANDSHAKES_DURATION = 3s;
constexpr auto PULSE_WAIT_FOR_OTHER_VALIDATOR_HANDSHAKES_DURATION = 3s;
@ -153,7 +153,7 @@ namespace service_nodes {
constexpr size_t STATE_CHANGE_MIN_NODES_TO_TEST = 50;
constexpr uint64_t VOTE_LIFETIME = BLOCKS_EXPECTED_IN_HOURS(2);
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
constexpr size_t STATE_CHANGE_QUORUM_SIZE = 5;
constexpr size_t STATE_CHANGE_MIN_VOTES_TO_CHANGE_STATE = 1;
constexpr int MIN_TIME_IN_S_BEFORE_VOTING = 0;
@ -174,7 +174,7 @@ namespace service_nodes {
static_assert(STATE_CHANGE_MIN_VOTES_TO_CHANGE_STATE <= STATE_CHANGE_QUORUM_SIZE, "The number of votes required to kick can't exceed the actual quorum size, otherwise we never kick.");
static_assert(CHECKPOINT_MIN_VOTES <= CHECKPOINT_QUORUM_SIZE, "The number of votes required to add a checkpoint can't exceed the actual quorum size, otherwise we never add checkpoints.");
static_assert(BLINK_MIN_VOTES <= BLINK_SUBQUORUM_SIZE, "The number of votes required can't exceed the actual blink subquorum size, otherwise we never approve.");
#ifndef LOKI_ENABLE_INTEGRATION_TEST_HOOKS
#ifndef OXEN_ENABLE_INTEGRATION_TEST_HOOKS
static_assert(BLINK_MIN_VOTES > BLINK_SUBQUORUM_SIZE / 2, "Blink approvals must require a majority of quorum members to prevent conflicting, signed blinks.");
#endif
@ -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

@ -1,8 +1,8 @@
#include "service_node_swarm.h"
#include "common/random.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "service_nodes"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "service_nodes"
#ifdef UNIT_TEST
#define prod_static

View File

@ -43,8 +43,8 @@
#include <string>
#include <vector>
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "service_nodes"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "service_nodes"
namespace service_nodes
{
@ -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:
{
@ -590,7 +590,7 @@ namespace service_nodes
std::unique_lock lock{m_lock};
// TODO(doyle): Rate-limiting: A better threshold value that follows suite with transaction relay time back-off
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
constexpr uint64_t TIME_BETWEEN_RELAY = 0;
#else
constexpr uint64_t TIME_BETWEEN_RELAY = 60 * 2;

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

@ -50,8 +50,8 @@
#include "common/perf_timer.h"
#include "crypto/hash.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "txpool"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "txpool"
DISABLE_VS_WARNINGS(4244 4345 4503) //'boost::foreach_detail_::or_' : decorated name length exceeded, name was truncated
@ -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

@ -33,8 +33,8 @@
#include "blockchain.h"
#include "tx_sanity_check.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "verify"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "verify"
namespace cryptonote
{

View File

@ -38,8 +38,8 @@
#include "common/pruning.h"
#include "block_queue.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "cn.block_queue"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "cn.block_queue"
namespace std {
template<>

View File

@ -39,8 +39,8 @@
#include <boost/uuid/uuid.hpp>
#include "crypto/hash.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "cn.block_queue"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "cn.block_queue"
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
{
@ -99,7 +99,7 @@ namespace cryptonote
/************************************************************************/
/* */
/************************************************************************/
LOKI_RPC_DOC_INTROSPECT
OXEN_RPC_DOC_INTROSPECT
struct serializable_blink_metadata {
crypto::hash tx_hash;
uint64_t height;
@ -112,7 +112,7 @@ namespace cryptonote
/************************************************************************/
/* */
/************************************************************************/
LOKI_RPC_DOC_INTROSPECT
OXEN_RPC_DOC_INTROSPECT
struct block_complete_entry
{
blobdata block;

View File

@ -53,8 +53,8 @@
#include "common/lock.h"
#include "common/util.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.cn"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "net.cn"
#define MLOG_P2P_MESSAGE(x) MCINFO("net.p2p.msg", context << x)
#define MLOGIF_P2P_MESSAGE(init, test, x) \
@ -69,7 +69,7 @@
} while(0)
#define MLOG_PEER_STATE(x) \
MCINFO(LOKI_DEFAULT_LOG_CATEGORY, context << "[" << epee::string_tools::to_string_hex(context.m_pruning_seed) << "] state: " << x << " in state " << cryptonote::get_protocol_state_string(context.m_state))
MCINFO(OXEN_DEFAULT_LOG_CATEGORY, context << "[" << epee::string_tools::to_string_hex(context.m_pruning_seed) << "] state: " << x << " in state " << cryptonote::get_protocol_state_string(context.m_state))
namespace cryptonote
{
@ -1359,7 +1359,7 @@ namespace cryptonote
m_core.pause_mine();
m_add_timer.resume();
bool starting = true;
LOKI_DEFER
OXEN_DEFER
{
m_add_timer.pause();
m_core.resume_mine();
@ -1475,7 +1475,7 @@ namespace cryptonote
{
bool remove_spans = false;
LOKI_DEFER
OXEN_DEFER
{
if (!m_core.cleanup_handle_incoming_blocks())
LOG_PRINT_CCONTEXT_L0("Failure in cleanup_handle_incoming_blocks");
@ -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

@ -43,8 +43,8 @@
#include "net/dandelionpp.h"
#include "p2p/net_node.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "net.p2p.tx"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "net.p2p.tx"
namespace cryptonote
{

View File

@ -43,8 +43,8 @@
#include <iterator>
#include <time.h>
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "qnet"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "qnet"
namespace quorumnet {

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

@ -27,7 +27,7 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
loki_add_executable(daemon "lokid"
oxen_add_executable(daemon "oxend"
command_parser_executor.cpp
command_server.cpp
daemon.cpp

View File

@ -37,32 +37,15 @@
namespace daemon_args
{
const command_line::arg_descriptor<std::string, false, true, 2> arg_config_file = {
"config-file"
, "Specify configuration file"
, (daemonizer::get_default_data_dir() / std::string(CRYPTONOTE_NAME ".conf")).string()
, {{ &cryptonote::arg_testnet_on, &cryptonote::arg_devnet_on }}
, [](std::array<bool, 2> testnet_devnet, bool defaulted, std::string val)->std::string {
if (testnet_devnet[0] && defaulted)
return (daemonizer::get_default_data_dir() / "testnet" / (CRYPTONOTE_NAME ".conf")).u8string();
else if (testnet_devnet[1] && defaulted)
return (daemonizer::get_default_data_dir() / "devnet" / (CRYPTONOTE_NAME ".conf")).u8string();
return val;
}
};
const command_line::arg_descriptor<std::string, false, true, 2> arg_log_file = {
"log-file"
, "Specify log file"
, (daemonizer::get_default_data_dir() / std::string(CRYPTONOTE_NAME ".log")).string()
, {{ &cryptonote::arg_testnet_on, &cryptonote::arg_devnet_on }}
, [](std::array<bool, 2> testnet_devnet, bool defaulted, std::string val)->std::string {
if (testnet_devnet[0] && defaulted)
return (daemonizer::get_default_data_dir() / "testnet" / (CRYPTONOTE_NAME ".log")).u8string();
else if (testnet_devnet[1] && defaulted)
return (daemonizer::get_default_data_dir() / "devnet" / (CRYPTONOTE_NAME ".log")).u8string();
return val;
}
};
const command_line::arg_descriptor<std::string> arg_config_file = {
"config-file",
"Specify configuration file",
"<data-dir>/" CRYPTONOTE_NAME ".conf"};
const command_line::arg_descriptor<std::string> arg_log_file = {
"log-file",
"Specify log file",
"<data-dir>/" CRYPTONOTE_NAME ".log"};
const command_line::arg_descriptor<std::size_t> arg_max_log_file_size = {
"max-log-file-size"
, "Specify maximum log file size [B]"

View File

@ -36,8 +36,8 @@
#include "daemon/command_parser_executor.h"
#include "rpc/core_rpc_server_commands_defs.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "daemon"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "daemon"
namespace daemonize {
@ -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,14 +33,14 @@
#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)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
#include <thread>
#endif
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "daemon"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "daemon"
namespace daemonize {
@ -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); }
@ -396,7 +396,7 @@ void command_server::init_commands(cryptonote::rpc::core_rpc_server* rpc_server)
},
"");
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
m_command_lookup.set_handler(
"relay_votes_and_uptime", [rpc_server](const auto&) {
rpc_server->on_relay_uptime_and_votes();
@ -458,7 +458,7 @@ bool command_server::start_handling(std::function<void(void)> exit_handler)
{
if (m_is_rpc) return false;
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
auto handle_pipe = [&]()
{
// TODO(doyle): Hack, don't hook into input until the daemon has completely initialised, i.e. you can print the status
@ -516,7 +516,7 @@ bool command_server::help(const std::vector<std::string>& args)
std::string command_server::get_commands_str()
{
std::stringstream ss;
ss << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")" << std::endl;
ss << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")" << std::endl;
ss << "Commands:\n";
m_command_lookup.for_each([&ss] (const std::string&, const std::string& usage, const std::string&) {
ss << " " << usage << "\n"; });

View File

@ -66,8 +66,8 @@ extern "C" {
using namespace std::literals;
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "daemon"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "daemon"
namespace daemonize {
@ -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
@ -287,7 +287,7 @@ bool daemon::run(bool interactive)
stop();
}};
LOKI_DEFER
OXEN_DEFER
{
stop_sig = true;
stop_thread.join();
@ -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

@ -42,8 +42,8 @@
#include "cryptonote_protocol/cryptonote_protocol_handler.h"
#include "epee/misc_log_ex.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "daemon"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "daemon"
namespace daemonize
{

View File

@ -51,8 +51,8 @@
#include "common/stack_trace.h"
#endif // STACK_TRACE
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "daemon"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "daemon"
namespace po = boost::program_options;
@ -61,7 +61,6 @@ using namespace std::literals;
int main(int argc, char const * argv[])
{
try {
// TODO parse the debug options like set log level right here at start
tools::on_startup();
@ -118,27 +117,105 @@ int main(int argc, char const * argv[])
});
if (!ok) return 1;
// Some ANSI color sequences that we use here (before the log system is initialized):
constexpr auto RESET = "\033[0m";
constexpr auto RED = "\033[31;1m";
constexpr auto YELLOW = "\033[33;1m";
constexpr auto CYAN = "\033[36;1m";
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << CYAN << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")" << RESET << "\n\n";
std::cout << "Usage: " + std::string{argv[0]} + " [options|settings] [daemon_command...]" << std::endl << std::endl;
std::cout << visible_options << std::endl;
return 0;
}
// Loki Version
// Oxen Version
if (command_line::get_arg(vm, command_line::arg_version))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << CYAN << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")" << RESET << "\n\n";
return 0;
}
auto config = fs::u8path(command_line::get_arg(vm, daemon_args::arg_config_file));
if (std::error_code ec; fs::exists(config, ec))
std::optional<fs::path> load_config;
if (command_line::is_arg_defaulted(vm, daemon_args::arg_config_file)) {
// We are using the default config file, which will be in the data directory, as determined
// *only* by the command-line arguments but *not* config file arguments, unlike pretty much
// all other command line options (where we load from both, with cli options taking
// precendence). Thus it's possible that the data-dir isn't specified on the command-line
// which means *for the purpose of loading the config file* that we use `~/.oxen`, but that
// after we load the config file it could be something else. (In such an edge case, we simply
// ignore a <final-data-dir>/oxen.conf).
auto data_dir = fs::absolute(fs::u8path(command_line::get_arg(vm, cryptonote::arg_data_dir)));
// --regtest should append a /regtest to the data-dir, but this is done here rather than in the
// defaults because this is a dev-only option that we don't really want the user to need to
// worry about.
if (command_line::get_arg(vm, cryptonote::arg_regtest_on))
data_dir /= "regtest";
// We also have to worry about migrating loki.conf -> oxen.conf *and* about a potential
// ~/.loki -> ~/.oxen migration, so build a list of possible options along with whether we
// want to rename if we find one (the data-dir migration happens later):
std::list<std::pair<fs::path, bool>> potential;
if (std::error_code ec; fs::exists(data_dir, ec)) {
potential.emplace_back(data_dir / CRYPTONOTE_NAME ".conf", false);
potential.emplace_back(data_dir / "loki.conf", true);
} else if (command_line::is_arg_defaulted(vm, cryptonote::arg_data_dir)) {
// If we weren't given an explict command-line data-dir then we also need to check the
// legacy data directory. (We will rename it, later, but we have to check it *first*
// because it might have a data-dir inside it that affects the data dir rename logic).
auto old_data_dir = tools::get_depreciated_default_data_dir();
// If we *have* a --testnet or --devnet arg then we can use it, but it's possible that the
// config file itself will set and change that, which is why we retrieve those arguments
// again later, after parsing the config.
if (command_line::get_arg(vm, cryptonote::arg_testnet_on)) old_data_dir /= "testnet";
else if (command_line::get_arg(vm, cryptonote::arg_devnet_on)) old_data_dir /= "devnet";
else if (command_line::get_arg(vm, cryptonote::arg_regtest_on)) old_data_dir /= "regtest";
potential.emplace_back(old_data_dir / CRYPTONOTE_NAME ".conf", false);
potential.emplace_back(old_data_dir / "loki.conf", true);
}
for (auto& [conf, rename] : potential) {
if (std::error_code ec; fs::exists(conf, ec)) {
if (rename) {
fs::path renamed = conf;
renamed.replace_filename(CRYPTONOTE_NAME ".conf");
assert(renamed != conf);
if (fs::rename(conf, renamed, ec); ec) {
std::cerr << RED << "Failed to migrate " << conf << " -> " << renamed <<
": " << ec.message() << RESET << "\n";
return 1;
}
if (fs::create_symlink(renamed.filename(), conf, ec); ec) {
std::cerr << YELLOW << "Failed to create post-migration " << conf << " -> " << renamed <<
" symlink: " << ec.message() << RESET << "\n";
// Continue anyway as this isn't fatal
}
std::cerr << CYAN << "Renamed " << conf << " -> " << renamed << RESET << "\n";
load_config = std::move(renamed);
} else {
load_config = std::move(conf);
}
break;
}
}
} else {
// config file explicitly given, no migration
load_config = fs::u8path(command_line::get_arg(vm, daemon_args::arg_config_file));
if (std::error_code ec; !fs::exists(*load_config, ec)) {
std::cerr << RED << "Can't find config file " << *load_config << RESET << "\n";
return 1;
}
}
if (load_config)
{
try
{
fs::ifstream cfg{config};
fs::ifstream cfg{*load_config};
if (!cfg.is_open())
throw std::runtime_error{"Unable to open file"};
po::store(po::parse_config_file<char>(
@ -148,28 +225,22 @@ int main(int argc, char const * argv[])
}
catch (const std::exception &e)
{
// log system isn't initialized yet
std::cerr << "Error parsing config file: " << e.what() << std::endl;
throw;
std::cerr << RED << "Error parsing config file: " << e.what() << RESET << "\n";
return 1;
}
}
else if (!command_line::is_arg_defaulted(vm, daemon_args::arg_config_file))
{
std::cerr << "Can't find config file " << config << std::endl;
return 1;
}
const bool testnet = command_line::get_arg(vm, cryptonote::arg_testnet_on);
const bool devnet = command_line::get_arg(vm, cryptonote::arg_devnet_on);
const bool regtest = command_line::get_arg(vm, cryptonote::arg_regtest_on);
if (testnet + devnet + regtest > 1)
{
std::cerr << "Can't specify more than one of --testnet and --devnet and --regtest\n";
std::cerr << RED << "Can't specify more than one of --testnet and --devnet and --regtest" << RESET << "\n";
return 1;
}
// 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
@ -177,9 +248,43 @@ int main(int argc, char const * argv[])
// Create data dir if it doesn't exist
auto data_dir = fs::absolute(fs::u8path(command_line::get_arg(vm, cryptonote::arg_data_dir)));
// FIXME: not sure on windows implementation default, needs further review
//fs::path relative_path_base = daemonizer::get_relative_path_base(vm);
fs::path relative_path_base = data_dir;
// --regtest should append a /regtest to the data-dir, but this is done here rather than in the
// defaults because this is a dev-only option that we don't really want the user to need to
// worry about.
if (command_line::get_arg(vm, cryptonote::arg_regtest_on))
data_dir /= "regtest";
// Will check if the default data directory is used and if it exists.
// Then will ensure that migration from the old data directory (.loki) has occurred if it exists.
if (command_line::is_arg_defaulted(vm, cryptonote::arg_data_dir) && !fs::exists(data_dir)) {
auto old_data_dir = tools::get_depreciated_default_data_dir();
if (testnet) old_data_dir /= "testnet";
else if (devnet) old_data_dir /= "devnet";
else if (regtest) old_data_dir /= "regtest";
if (fs::is_directory(old_data_dir))
{
std::error_code ec;
if (fs::create_directories(data_dir.parent_path(), ec); ec) {
std::cerr << RED << "Data directory migration failed: cannot create " << data_dir.parent_path()
<< ": " << ec.message() << RESET << "\n";
return 1;
}
if (fs::rename(old_data_dir, data_dir, ec); ec) {
std::cerr << RED << "Data directory migrate failed: could not rename " << old_data_dir << " to " << data_dir
<< ": " << ec.message() << RESET << "\n";
return 1;
}
if (fs::create_directory_symlink(data_dir, old_data_dir, ec); ec)
std::cerr << YELLOW << "Failed to create " << old_data_dir << " -> " << data_dir << " symlink" << RESET << "\n";
std::cerr << CYAN << "Migrated data directory from " << old_data_dir << " to " << data_dir << RESET << "\n";
}
}
// Create the data directory; we have to do this before initializing the logs because the log
// likely goes inside the data dir.
if (std::error_code ec; !fs::create_directories(data_dir, ec) && ec)
MWARNING("Failed to create data directory " << data_dir << ": " << ec.message());
po::notify(vm);
@ -192,7 +297,7 @@ int main(int argc, char const * argv[])
if (!command_line::is_arg_defaulted(vm, daemon_args::arg_log_file))
log_file_path = command_line::get_arg(vm, daemon_args::arg_log_file);
if (log_file_path.is_relative())
log_file_path = fs::absolute(fs::relative(log_file_path, relative_path_base));
log_file_path = fs::absolute(fs::relative(log_file_path, data_dir));
mlog_configure(log_file_path.string(), true, command_line::get_arg(vm, daemon_args::arg_max_log_file_size), command_line::get_arg(vm, daemon_args::arg_max_log_files));
// Set log level
@ -201,9 +306,6 @@ int main(int argc, char const * argv[])
mlog_set_log(command_line::get_arg(vm, daemon_args::arg_log_level).c_str());
}
// after logs initialized
tools::create_directories_if_necessary(data_dir);
#ifdef STACK_TRACE
tools::set_stack_trace_log(log_file_path.filename().string());
#endif // STACK_TRACE
@ -213,7 +315,7 @@ int main(int argc, char const * argv[])
// logging is now set up
// FIXME: only print this when starting up as a daemon but not when running rpc commands
MGINFO_GREEN("Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")");
MGINFO_CYAN("Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")");
// If there are positional options, we're running a daemon command
{
@ -223,7 +325,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 +338,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"};
}
{
@ -252,7 +354,7 @@ int main(int argc, char const * argv[])
MINFO("Moving from main() into the daemonize now.");
return daemonizer::daemonize<daemonize::daemon>("Loki Daemon", argc, argv, std::move(vm))
return daemonizer::daemonize<daemonize::daemon>("Oxen Daemon", argc, argv, std::move(vm))
? 0 : 1;
}
catch (std::exception const & ex)

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>
@ -50,8 +50,8 @@
#include <numeric>
#include <stack>
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "daemon"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "daemon"
using namespace cryptonote::rpc;
@ -64,7 +64,7 @@ namespace {
{
std::cout << prompt << std::flush;
std::string result;
#if defined (LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined (OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
integration_test::write_buffered_stdout();
result = integration_test::read_from_pipe();
#else
@ -607,7 +607,7 @@ bool rpc_command_executor::mining_status() {
if (!mining_busy && mres.active && mres.speed > 0 && mres.block_target > 0 && mres.difficulty > 0)
{
uint64_t daily = 86400 / (double)mres.difficulty * mres.speed * mres.block_reward;
tools::msg_writer() << "Expected: " << cryptonote::print_money(daily) << " LOKI daily, " << cryptonote::print_money(7*daily) << " weekly";
tools::msg_writer() << "Expected: " << cryptonote::print_money(daily) << " OXEN daily, " << cryptonote::print_money(7*daily) << " weekly";
}
return true;
@ -927,7 +927,7 @@ static void print_pool(const std::vector<cryptonote::rpc::tx_info> &transactions
w << "blob_size: " << tx_info.blob_size << "\n"
<< "weight: " << tx_info.weight << "\n"
<< "fee: " << cryptonote::print_money(tx_info.fee) << "\n"
/// NB(Loki): in v13 we have min_fee = per_out*outs + per_byte*bytes, only the total fee/byte matters for
/// NB(Oxen): in v13 we have min_fee = per_out*outs + per_byte*bytes, only the total fee/byte matters for
/// the purpose of building a block template from the pool, so we still print the overall fee / byte here.
/// (we can't back out the individual per_out and per_byte that got used anyway).
<< "fee/byte: " << cryptonote::print_money(tx_info.fee / (double)tx_info.weight) << "\n"
@ -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;
@ -1226,7 +1226,7 @@ bool rpc_command_executor::ban(const std::string &address, time_t seconds, bool
// TODO(doyle): Work around because integration tests break when using
// mlog_set_categories(""), so emit the block message using msg writer
// instead of the logging system.
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
tools::success_msg_writer() << "Host " << address << (clear_ban ? " unblocked." : " blocked.");
#endif
@ -1942,7 +1942,7 @@ bool rpc_command_executor::prepare_registration()
uint64_t block_height = std::max(res.height, res.target_height);
uint8_t hf_version = hf_res.version;
#if defined(LOKI_ENABLE_INTEGRATION_TEST_HOOKS)
#if defined(OXEN_ENABLE_INTEGRATION_TEST_HOOKS)
cryptonote::network_type const nettype = cryptonote::FAKECHAIN;
#else
cryptonote::network_type const nettype =
@ -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;
@ -2452,7 +2452,7 @@ bool rpc_command_executor::prune_blockchain()
tools::success_msg_writer() << "Blockchain pruned";
#else
tools::fail_msg_writer() << "Blockchain pruning is not supported in Loki yet";
tools::fail_msg_writer() << "Blockchain pruning is not supported in Oxen yet";
#endif
return true;
}

View File

@ -39,8 +39,8 @@
#include "cryptonote_basic/cryptonote_basic.h"
#include "rpc/core_rpc_server.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "daemon"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "daemon"
namespace daemonize {

View File

@ -27,7 +27,7 @@
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
loki_add_executable(cn_deserialize "loki-utils-deserialize"
oxen_add_executable(cn_deserialize "oxen-utils-deserialize"
cn_deserialize.cpp
)
@ -37,7 +37,7 @@ target_link_libraries(cn_deserialize
p2p
extra)
loki_add_executable(object_sizes "loki-utils-object-sizes"
oxen_add_executable(object_sizes "oxen-utils-object-sizes"
object_sizes.cpp
)
@ -53,7 +53,7 @@ set(dns_checks_sources
dns_checks.cpp
)
loki_add_executable(dns_checks "loki-utils-dns-checks" dns_checks.cpp)
oxen_add_executable(dns_checks "oxen-utils-dns-checks" dns_checks.cpp)
target_link_libraries(dns_checks
PRIVATE

View File

@ -31,13 +31,13 @@
#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>
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "debugtools.deserialize"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "debugtools.deserialize"
namespace po = boost::program_options;
@ -76,7 +76,7 @@ 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)
{
@ -155,7 +155,7 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
return 1;
}

View File

@ -37,8 +37,8 @@
#include "common/dns_utils.h"
#include "version.h"
#undef MONERO_DEFAULT_LOG_CATEGORY
#define MONERO_DEFAULT_LOG_CATEGORY "debugtools.dnschecks"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "debugtools.dnschecks"
namespace po = boost::program_options;
@ -121,13 +121,13 @@ int main(int argc, char* argv[])
if (command_line::get_arg(vm, command_line::arg_help))
{
std::cout << "Loki '" << LOKI_RELEASE_NAME << "' (v" << LOKI_VERSION_FULL << ")\n\n";
std::cout << "Oxen '" << OXEN_RELEASE_NAME << "' (v" << OXEN_VERSION_FULL << ")\n\n";
std::cout << desc_options << std::endl;
return 1;
}
mlog_configure("", true);
mlog_set_categories("+" LOKI_DEFAULT_LOG_CATEGORY ":INFO");
mlog_set_categories("+" OXEN_DEFAULT_LOG_CATEGORY ":INFO");
lookup(LOOKUP_A, {"seeds.moneroseeds.se", "seeds.moneroseeds.ae.org", "seeds.moneroseeds.ch", "seeds.moneroseeds.li"});

View File

@ -45,8 +45,8 @@
#include "wallet/api/unsigned_transaction.h"
#include "wallet/api/pending_transaction.h"
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "debugtools.objectsizes"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "debugtools.objectsizes"
class size_logger
{

View File

@ -28,15 +28,15 @@
//
#if defined(HAVE_HIDAPI)
#include "common/loki.h"
#include "common/oxen.h"
#include "log.hpp"
#include "device_io_hid.hpp"
namespace hw {
namespace io {
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "device.io"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "device.io"
#define ASSERT_X(exp,msg) CHECK_AND_ASSERT_THROW_MES(exp, msg);
@ -120,7 +120,7 @@ namespace hw {
hid_device_info *result = nullptr;
for (; devices_list != nullptr; devices_list = devices_list->next) {
LOKI_DEFER {
OXEN_DEFER {
MDEBUG( (result == devices_list ? "SELECTED" : "SKIPPED ") <<
" HID Device" <<
" path " << safe_hid_path(devices_list) <<

View File

@ -49,8 +49,8 @@ namespace hw {
#ifdef WITH_DEVICE_LEDGER
#undef LOKI_DEFAULT_LOG_CATEGORY
#define LOKI_DEFAULT_LOG_CATEGORY "device.ledger"
#undef OXEN_DEFAULT_LOG_CATEGORY
#define OXEN_DEFAULT_LOG_CATEGORY "device.ledger"
/* ===================================================================== */
/* === Debug ==== */
@ -482,8 +482,8 @@ namespace hw {
bool device_ledger::reset() {
reset_buffer();
int offset = set_command_header_noopt(INS_RESET);
CHECK_AND_ASSERT_THROW_MES(offset + LOKI_VERSION_STR.size() <= BUFFER_SEND_SIZE, "LOKI_VERSION_STR is too long");
send_bytes(LOKI_VERSION_STR.data(), LOKI_VERSION_STR.size(), offset);
CHECK_AND_ASSERT_THROW_MES(offset + OXEN_VERSION_STR.size() <= BUFFER_SEND_SIZE, "OXEN_VERSION_STR is too long");
send_bytes(OXEN_VERSION_STR.data(), OXEN_VERSION_STR.size(), offset);
finish_and_exchange(offset);
CHECK_AND_ASSERT_THROW_MES(length_recv>=3, "Communication error, less than three bytes received. Check your application version.");
@ -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

Some files were not shown because too many files have changed in this diff Show More