Skip to content

Commit

Permalink
update docs re: supported library paths
Browse files Browse the repository at this point in the history
  • Loading branch information
sneurlax committed Oct 12, 2024
1 parent aff9176 commit 4f52286
Showing 1 changed file with 11 additions and 28 deletions.
39 changes: 11 additions & 28 deletions impls/monero.rs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,38 +9,21 @@ You may need
sudo apt-get install libhidapi-dev
```
-->
### Build `monero_c`
Build the monero_c library for your architecture. Follow the upstream docs at
https://github.com/MrCyjaneK/monero_c <!-- TODO: use example CMakeLists --> and
place the library at `monero_c/impls/monero_rust/lib/libwallet2_api_c.so` or use
the provided script:
```
cd scripts
./build_monero_c.sh
```

or build it manually as in:
```
git clone https://git.mrcyjanek.net/MrCyjaneK/monero_c --branch rust
cd monero_c
git submodule update --init --recursive
rm -rf monero wownero release # Clean any previous builds.
git submodule update --init --recursive --force
./apply_patches.sh monero
./build_single.sh monero x86_64-linux-gnu -j$(nproc)
# Adjust the commands below for your arch.
unxz -f release/monero/x86_64-linux-gnu_libwallet2_api_c.so.xz
mv release/monero/x86_64-linux-gnu_libwallet2_api_c.so ../lib/libwallet2_api_c.so
# The library should be at monero_c/impls/monero_rust/lib/libwallet2_api_c.so.
```
### Build or download `monero_c` library
Build or download the `monero_c` library for your architecture. Follow the
upstream docs at https://github.com/MrCyjaneK/monero_c or download the latest
release from https://github.com/MrCyjaneK/monero_c/releases. The library can be
placed in one of several supported locations relative to the binary in use:
- `../../release` (as in `monero_c/release`)
- `./lib` (as in `monero_c/impls/monero_rust/lib`)
- `.` (as in `monero_c/impls/monero_rust/target/debug` or `release`)

### Run `monero_rust` demo
From `monero_c/impls/monero_rust`:
### Run demo
With the library in a supported location, from `monero_c/impls/monero_rust`:
```
cargo run
```

## Using `monero_rust` in your own crate
Refer to the `example` folder. `libwallet2_api_c.so` must be in `lib/` or in
Refer to the `example` folder. The `monero_c` library must be in `lib/` or in
the same directory as the binary (*eg.* in `example/target/debug/`).

0 comments on commit 4f52286

Please sign in to comment.