diff --git a/README.md b/README.md index 12b85df..0fb28b1 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ * [Overview](#overview) * [Sample code](#sample-code) -* [How to build this library](#how-to-build-this-library) +* [Using this library in your project](#using-this-library-in-your-project) * [Developer guide](#developer-guide) * [See also](#see-also) * [License](#license) @@ -12,24 +12,20 @@ ## Overview -This project is a C++ library for using Monero wallets via native bindings to [Monero Core v0.16.0.0 'Nitrogen Nebula'](https://web.getmonero.org/downloads/). +This project is a C++ library for creating Monero applications with native bindings to [monero v0.16.0.0 'Nitrogen Nebula'](https://github.com/monero-project/monero/tree/v0.16.0.0). -In addition, this project conforms to an [API specification](http://moneroecosystem.org/monero-java/monero-spec.pdf) intended to be intuitive and robust. - -This library may be used to build Monero-related applications, such as GUIs, REST/JSON-RPC APIs, or libraries in other languages (e.g. [monero-java](https://github.com/monero-ecosystem/monero-java), [monero-javascript](https://github.com/monero-ecosystem/monero-javascript)). - -* Supports client-side wallets connected to a daemon. +* Supports fully client-side wallets connected to a daemon. * Supports multisig, view-only, and offline wallets. -* Conforms to an [API specification](https://moneroecosystem.org/monero-java/monero-spec.pdf) intended to be intuitive and robust. +* Uses a clearly defined [data model and API specification](https://moneroecosystem.org/monero-java/monero-spec.pdf) intended to be intuitive and robust. * Query wallet transactions, transfers, and outputs by their many attributes. * Receive notifications when wallets sync, send, or receive. -* Tested by over 100 JUnit test cases using JNI bindings in [monero-java](https://github.com/monero-ecosystem/monero-java). +* Tested by over 100 tests in [monero-java](https://github.com/monero-ecosystem/monero-java) and [monero-javascript](https://github.com/monero-ecosystem/monero-javascript) using JNI and WebAssembly bindings. ## Sample code -This code demonstrates the API. See the [documentation](https://woodser.github.io/monero-cpp-library/annotated.html) or [specification PDF](http://moneroecosystem.org/monero-java/monero-spec.pdf) for more details. +This code introduces the API. See the [documentation](https://woodser.github.io/monero-cpp-library/annotated.html) or [specification PDF](http://moneroecosystem.org/monero-java/monero-spec.pdf) for more details. -Note: This API might change depending on feedback, such as changing structs to classes, using pure object-oriented accessors and mutators, not using boost::optional with shared_ptrs, etc. Feedback is welcome. +_Note: This API might change depending on feedback, such as changing structs to classes, using pure object-oriented accessors and mutators, not using boost::optional with shared_ptrs, etc. Feedback is welcome._ ```c++ // create a wallet from a mnemonic phrase @@ -162,41 +158,42 @@ wallet_restored->close(true); wallet_random->close(true); ``` -## How to build this library +## Using this library in your project -The following dependencies must be set up before running this project. +This project may be compiled as part of another application or built as a shared or static library. -1. Set up Boost - 1. Download and extract the boost 1.72.0 source code zip from https://www.boost.org/users/download/ to ./external/boost-sdk/. - 2. `cd ./external/boost-sdk/` - 3. `./bootstrap.sh` - 4. `./b2` - 5. Copy .a files from ./external/boost-sdk/bin.v2/libs/\*/link-static/\* to ./external-libs/boost according to CMakeLists.txt. -2. Set up OpenSSL - 1. Download and extract the latest OpenSSL source code zip from https://github.com/openssl/openssl to ./external/openssl-sdk/. - 2. Build for your system.
+For example, [monero-java](https://github.com/monero-ecosystem/monero-java) compiles this project to a shared library to support Java JNI bindings, while [monero-javascript](https://github.com/monero-ecosystem/monero-javascript) compiles this project to WebAssembly binaries. + +1. Set up dependencies + 1. Set up Boost + 1. Download and extract the boost 1.72.0 source code zip from https://www.boost.org/users/download/ to ./external/boost-sdk/. + 2. `cd ./external/boost-sdk/` + 3. `./bootstrap.sh` + 4. `./b2` + 5. Copy .a files from ./external/boost-sdk/bin.v2/libs/\*/link-static/\* to ./external-libs/boost according to CMakeLists.txt. + 2. Set up OpenSSL + 1. Download and extract the latest OpenSSL source code zip from https://github.com/openssl/openssl to ./external/openssl-sdk/. + 2. Build for your system.
Mac: installed through boost at /usr/local/opt/openssl/lib - 3. Copy libcrypto.a and libssl.a ./external-libs/openssl -3. Set up hidapi - 1. Download the latest hidapi source code from https://github.com/signal11/hidapi. - 2. Build hidapi for your system.
+ 3. Copy libcrypto.a and libssl.a ./external-libs/openssl + 3. Set up hidapi + 1. Download the latest hidapi source code from https://github.com/signal11/hidapi. + 2. Build hidapi for your system.
Mac requires autoreconf: `brew install automake` - 3. Copy libhidapi.a to ./external-libs/hidapi. -4. Set up libsodium - 1. Build libsodium for your system. - 2. Copy libsodium.a to ./external-libs/libsodium.
+ 3. Copy libhidapi.a to ./external-libs/hidapi. + 4. Set up libsodium + 1. Build libsodium for your system. + 2. Copy libsodium.a to ./external-libs/libsodium.
Mac: installed through homebrew at /usr/local/Cellar/libsodium/1.0.17/lib/libsodium.a -5. Set up Monero Core - 1. Initialize submodules: `git submodule update --init --recursive` - 2. `cd ./external/monero-core` - 3. `git checkout tags/v0.16.0.0` - 3. Modify CMakeLists.txt: `option(BUILD_GUI_DEPS "Build GUI dependencies." ON)`. - 4. Build twice to create libwallet_merged.a in addition to other .a libraries: `make release-static -j8`. -6. Build this project as a shared library in `./build/`: `./bin/build_libmonero_cpp.sh`. + 5. Set up monero-project/monero: + 1. Initialize submodules: `git submodule update --init --recursive` + 2. `cd ./external/monero-core` + 3. `git checkout tags/v0.16.0.0` + 3. Modify CMakeLists.txt: `option(BUILD_GUI_DEPS "Build GUI dependencies." ON)`. + 4. Build **twice** to create libwallet_merged.a in addition to other .a libraries: `make release-static -j8`. +2. Link to this library's source files in your application or build as a shared library in `./build/`: `./bin/build_libmonero_cpp.sh` -This project may be compiled as part of another application or as a shared or static library. For example, the associated [monero-java](https://github.com/monero-ecosystem/monero-java) library depends on this project as a shared library using Java JNI. - -These build steps aspire to be automated further and [any help is greatly appreciated](https://github.com/woodser/monero-cpp-library/issues/1). +These build steps aspire to be automated further. [Any help is greatly appreciated](https://github.com/woodser/monero-cpp-library/issues/1). ## Developer guide @@ -204,11 +201,9 @@ Please refer to [monero-javascript's developer guide](https://github.com/monero- ## See also -[API specification](http://moneroecosystem.org/monero-java/monero-spec.pdf) - -[monero-java](https://github.com/monero-ecosystem/monero-java) - -[monero-javascript](https://github.com/monero-ecosystem/monero-javascript) +* [API specification](http://moneroecosystem.org/monero-java/monero-spec.pdf) +* [monero-java](https://github.com/monero-ecosystem/monero-java) +* [monero-javascript](https://github.com/monero-ecosystem/monero-javascript) ## License