forked from such-gitea/wownero-lws
Port monero-lws to wownero-lws
Adapts monero-lws for Wownero cryptocurrency: - Rename all monero-lws-* binaries to wownero-lws-* - Update submodule to point to official Wownero repo - Use Wownero default ports (RPC: 34568, ZMQ: 34569) - Update data directory to ~/.wownero/light_wallet_server - Adapt next_difficulty() calls for Wownero API signature Key technical changes for Wownero compatibility: - BulletproofPlus (RCTTypeBulletproofPlus, type 8) commitment verification: Wownero stores BP+ commitments in 'divided by 8' form. Must call rct::scalarmult8() on outPk commitment before comparing with computed commitment (mask*G + amount*H). This is essential for amount decryption. - Pass rct_type to decode_amount() for proper commitment handling - Handle Wownero's ZMQ JSON format for ecdhTuple (32-byte mask/amount fields) No fork of Wownero is required - uses official codeberg.org/wownero/wownero.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2022, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
|
||||
21
tests/test_wire_key.cpp
Normal file
21
tests/test_wire_key.cpp
Normal file
@@ -0,0 +1,21 @@
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "wire/json.h"
|
||||
#include "wire/adapted/crypto.h"
|
||||
#include "ringct/rctTypes.h"
|
||||
|
||||
int main() {
|
||||
std::string json = "\"0102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f20\"";
|
||||
rct::key key;
|
||||
try {
|
||||
wire::json_reader reader{epee::as_byte_span(json)};
|
||||
wire::read_bytes(reader, key);
|
||||
std::cout << "Parsed key: ";
|
||||
for (int i = 0; i < 32; ++i) printf("%02x", key.bytes[i]);
|
||||
std::cout << std::endl;
|
||||
} catch (const std::exception& e) {
|
||||
std::cerr << "Error: " << e.what() << std::endl;
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2022, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
@@ -26,31 +27,31 @@
|
||||
# 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.
|
||||
|
||||
add_library(monero-lws-unit-framework framework.test.cpp)
|
||||
target_include_directories(monero-lws-unit-framework PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/src")
|
||||
target_link_libraries(monero-lws-unit-framework)
|
||||
add_library(wownero-lws-unit-framework framework.test.cpp)
|
||||
target_include_directories(wownero-lws-unit-framework PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} "${CMAKE_SOURCE_DIR}/src")
|
||||
target_link_libraries(wownero-lws-unit-framework)
|
||||
|
||||
add_subdirectory(db)
|
||||
add_subdirectory(net)
|
||||
add_subdirectory(rpc)
|
||||
add_subdirectory(wire)
|
||||
|
||||
add_executable(monero-lws-unit main.cpp rest.test.cpp scanner.test.cpp)
|
||||
target_link_libraries(monero-lws-unit
|
||||
monero::libraries
|
||||
monero-lws-daemon-common
|
||||
monero-lws-unit-db
|
||||
monero-lws-unit-framework
|
||||
monero-lws-unit-net
|
||||
monero-lws-unit-net-http
|
||||
monero-lws-unit-rpc
|
||||
monero-lws-unit-wire
|
||||
monero-lws-unit-wire-json
|
||||
monero-lws-unit-wire-msgpack
|
||||
add_executable(wownero-lws-unit main.cpp rest.test.cpp scanner.test.cpp)
|
||||
target_link_libraries(wownero-lws-unit
|
||||
wownero::libraries
|
||||
wownero-lws-daemon-common
|
||||
wownero-lws-unit-db
|
||||
wownero-lws-unit-framework
|
||||
wownero-lws-unit-net
|
||||
wownero-lws-unit-net-http
|
||||
wownero-lws-unit-rpc
|
||||
wownero-lws-unit-wire
|
||||
wownero-lws-unit-wire-json
|
||||
wownero-lws-unit-wire-msgpack
|
||||
${Boost_FILESYSTEM_LIBRARY}
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
${Boost_THREAD_LIBRARY}
|
||||
${Boost_THREAD_LIBS_INIT}
|
||||
Threads::Threads
|
||||
)
|
||||
add_test(NAME monero-lws-unit COMMAND monero-lws-unit -v)
|
||||
add_test(NAME wownero-lws-unit COMMAND wownero-lws-unit -v)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2022-2023, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
@@ -26,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.
|
||||
|
||||
add_library(monero-lws-unit-db OBJECT
|
||||
add_library(wownero-lws-unit-db OBJECT
|
||||
account.test.cpp
|
||||
chain.test.cpp
|
||||
data.test.cpp
|
||||
@@ -35,11 +36,11 @@ add_library(monero-lws-unit-db OBJECT
|
||||
webhook.test.cpp
|
||||
)
|
||||
target_link_libraries(
|
||||
monero-lws-unit-db
|
||||
monero-lws-unit-framework
|
||||
monero-lws-common
|
||||
monero-lws-db
|
||||
monero::libraries
|
||||
wownero-lws-unit-db
|
||||
wownero-lws-unit-framework
|
||||
wownero-lws-common
|
||||
wownero-lws-db
|
||||
wownero::libraries
|
||||
${Boost_PROGRAM_OPTIONS_LIBRARY}
|
||||
)
|
||||
#add_test(monero-lws-unit)
|
||||
#add_test(wownero-lws-unit)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2024, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
@@ -28,5 +29,5 @@
|
||||
|
||||
add_subdirectory(http)
|
||||
|
||||
add_library(monero-lws-unit-net)
|
||||
target_link_libraries(monero-lws-unit-net monero-lws-unit-net-http)
|
||||
add_library(wownero-lws-unit-net)
|
||||
target_link_libraries(wownero-lws-unit-net wownero-lws-unit-net-http)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2024, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
@@ -26,9 +27,9 @@
|
||||
# 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.
|
||||
|
||||
add_library(monero-lws-unit-net-http OBJECT client.test.cpp)
|
||||
add_library(wownero-lws-unit-net-http OBJECT client.test.cpp)
|
||||
target_link_libraries(
|
||||
monero-lws-unit-net-http
|
||||
monero-lws-net-http
|
||||
monero-lws-unit-framework
|
||||
monero::libraries)
|
||||
wownero-lws-unit-net-http
|
||||
wownero-lws-net-http
|
||||
wownero-lws-unit-framework
|
||||
wownero::libraries)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2022-2023, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
@@ -26,15 +27,15 @@
|
||||
# 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.
|
||||
|
||||
add_library(monero-lws-unit-rpc OBJECT admin.test.cpp)
|
||||
add_library(wownero-lws-unit-rpc OBJECT admin.test.cpp)
|
||||
target_link_libraries(
|
||||
monero-lws-unit-rpc
|
||||
monero-lws-unit-db
|
||||
monero-lws-unit-framework
|
||||
monero-lws-common
|
||||
monero-lws-db
|
||||
monero-lws-rpc
|
||||
monero-lws-wire-json
|
||||
monero::libraries
|
||||
wownero-lws-unit-rpc
|
||||
wownero-lws-unit-db
|
||||
wownero-lws-unit-framework
|
||||
wownero-lws-common
|
||||
wownero-lws-db
|
||||
wownero-lws-rpc
|
||||
wownero-lws-wire-json
|
||||
wownero::libraries
|
||||
)
|
||||
#add_test(monero-lws-unit)
|
||||
#add_test(wownero-lws-unit)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2022-2023, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
@@ -30,11 +31,11 @@
|
||||
add_subdirectory(json)
|
||||
add_subdirectory(msgpack)
|
||||
|
||||
add_library(monero-lws-unit-wire OBJECT read.write.test.cpp read.test.cpp)
|
||||
add_library(wownero-lws-unit-wire OBJECT read.write.test.cpp read.test.cpp)
|
||||
target_link_libraries(
|
||||
monero-lws-unit-wire
|
||||
monero-lws-unit-framework
|
||||
monero-lws-wire
|
||||
monero::libraries
|
||||
wownero-lws-unit-wire
|
||||
wownero-lws-unit-framework
|
||||
wownero-lws-wire
|
||||
wownero::libraries
|
||||
)
|
||||
#add_test(monero-lws-unit)
|
||||
#add_test(wownero-lws-unit)
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2022, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
@@ -27,11 +28,11 @@
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
add_library(monero-lws-unit-wire-json OBJECT read.write.test.cpp)
|
||||
add_library(wownero-lws-unit-wire-json OBJECT read.write.test.cpp)
|
||||
target_link_libraries(
|
||||
monero-lws-unit-wire-json
|
||||
monero-lws-unit-framework
|
||||
monero-lws-wire-json
|
||||
monero::libraries
|
||||
wownero-lws-unit-wire-json
|
||||
wownero-lws-unit-framework
|
||||
wownero-lws-wire-json
|
||||
wownero::libraries
|
||||
)
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
# Copyright (c) 2023, The Monero Project
|
||||
# Copyright (c) 2024-2025, The Wownero Project
|
||||
#
|
||||
# All rights reserved.
|
||||
#
|
||||
@@ -27,11 +28,11 @@
|
||||
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
|
||||
add_library(monero-lws-unit-wire-msgpack OBJECT read.write.test.cpp)
|
||||
add_library(wownero-lws-unit-wire-msgpack OBJECT read.write.test.cpp)
|
||||
target_link_libraries(
|
||||
monero-lws-unit-wire-msgpack
|
||||
monero-lws-unit-framework
|
||||
monero-lws-wire-msgpack
|
||||
monero::libraries
|
||||
wownero-lws-unit-wire-msgpack
|
||||
wownero-lws-unit-framework
|
||||
wownero-lws-wire-msgpack
|
||||
wownero::libraries
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user