-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
41 changed files
with
1,860 additions
and
1,387 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build documentation | ||
|
||
on: [push] | ||
|
||
env: | ||
# Name of module and id separated by a slash | ||
INSTANCE: Writerside/in | ||
# Replace HI with the ID of the instance in capital letters | ||
ARTIFACT: webHelpIN2-all.zip | ||
# Docker image version | ||
DOCKER_VERSION: "242.21870" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
- uses: actions/setup-go@v5 | ||
with: | ||
go-version: '^1.23.2' | ||
- uses: hecrj/setup-rust-action@v2 | ||
with: | ||
rust-version: stable | ||
- name: Update image | ||
run: cd docs && ./update_screenshot.sh | ||
- name: Build Writerside docs using Docker | ||
uses: JetBrains/writerside-github-action@v4 | ||
with: | ||
location: "docs" | ||
instance: ${{ env.INSTANCE }} | ||
artifact: ${{ env.ARTIFACT }} | ||
docker-version: ${{ env.DOCKER_VERSION }} | ||
|
||
- name: Upload artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: artifact | ||
path: artifacts/${{ env.ARTIFACT }} | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v2 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
with: | ||
files: artifacts/${{ env.ARTIFACT }} | ||
token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,5 @@ | ||
release/ | ||
build/ | ||
build/ | ||
tests/monero-cli | ||
tests/libs | ||
tests/wallets |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,94 +2,15 @@ | |
|
||
> Wrapper around wallet2_api.h that can be called using C api. | ||
[![status-badge](https://ci.mrcyjanek.net/api/badges/5/status.svg?branch=rewrite-wip)](https://ci.mrcyjanek.net/repos/5/branches/rewrite-wip) | ||
|
||
## Building | ||
|
||
to "clean" everything: | ||
TL;DR: | ||
|
||
```bash | ||
$ rm -rf monero wownero release | ||
$ git submodule update --init --recursive --force | ||
$ for coin in monero wownero; do ./apply_patches $coin; done | ||
$ ./build_single monero $(gcc -dumpmachine) -j$(nproc) | ||
``` | ||
|
||
fix ownership (if you build in docker but clone as a local user) | ||
|
||
```bash | ||
$ sudo chown $(whoami) . -R | ||
``` | ||
|
||
patch codebase | ||
|
||
```bash | ||
$ ./apply_patches.sh monero | ||
$ ./apply_patches.sh wownero | ||
``` | ||
|
||
build monero_c | ||
|
||
```bash | ||
$ ./build_single.sh monero x86_64-linux-gnu -j$(nproc) | ||
wownero i686-linux-gnu | ||
aarch64-linux-gnu | ||
x86_64-linux-android | ||
i686-linux-android | ||
aarch64-linux-android | ||
arm-linux-androideabi | ||
i686-w64-mingw32 | ||
x86_64-w64-mingw32 | ||
host-apple-darwin | ||
host-apple-ios | ||
``` | ||
|
||
While building I aim to compile the code at oldest supported release of debian, using default toolchain to ensure that all linux distributions are able to run monero_c libraries, below I present a supported builders for given targets | ||
|
||
| x | builder | notes | | ||
| ---------------------- | -------------------- | ----- | | ||
| x86_64-linux-gnu | debian:buster | | | ||
| i686-linux-gnu | debian:buster | | | ||
| aarch64-linux-gnu | debian:buster | | | ||
| x86_64-linux-android | debian:buster | | | ||
| i686-linux-android | debian:buster | | | ||
| aarch64-linux-android | debian:buster | | | ||
| arm-linux-androideabi | debian:buster | | | ||
| i686-w64-mingw32 | debian:buster | hardcoded DLL paths in build_single.sh | | ||
| x86_64-w64-mingw32 | debian:buster | -"- | | ||
| x86_64-apple-darwin11 | debian:bookworm | extra build step: `${HOST_ABI}-ranlib $PWD/$repo/contrib/depends/${HOST_ABI}/lib/libpolyseed.a` | | ||
| aarch64-apple-darwin11 | debian:bookworm | -"- | | ||
| host-apple-darwin | arm64-apple-darwin23 | dependencies: `brew install unbound [email protected] zmq cmake ccache autoconf automake libtool && brew link [email protected]` | | ||
| host-apple-ios | arm64-apple-darwin23 | | | ||
|
||
## Design | ||
|
||
Functions are as simple as reasonably possible as few steps should be performed to get from the exposed C api to actual wallet2 (or wallet3 in future) api calls. | ||
|
||
The only things passed in and out are: | ||
|
||
- void | ||
- bool | ||
- int | ||
- uint64_t | ||
- void* | ||
- const char* | ||
|
||
All more complex structures are serialized into `const char*`, take look at MONERO_Wallet_createTransaction which uses `splitString(std::string(preferredInputs), std::string(separator));` to convert string into a std::set, so no implementation will need to worry about that. | ||
|
||
Is there more effective way to do that? Probably. Is there more universal way to pass that (JSON, or others?)? Most likely. That being said, I'm against doing that. You can easily join a string in any language, and I like to keep dependency count as low as possible. | ||
|
||
As for function naming `${COIN}_namespaceOrClass_functionName` is being used, currently these cryptocurrencies are supported | ||
|
||
- monero | ||
- wownero | ||
|
||
both using wallet2 api, and both being patched with our secret ingredient(tm) (check patches directory). | ||
|
||
Since monero_c aims to be one-fits-all solution for monero wallets, there are some special things inside, like functions prefixed with `DEBUG_*`, these are not quarenteed to stay in the code, and can be changed, the only reason they are in is because I needed some testing early in the development when bringing support for variety of platforms. | ||
|
||
If you are a wallet developer and you **really** need this one function that doesn't exist, feel free to let me know I'll be happy to implement that. | ||
|
||
Currently there are enterprise resitents in our library: `${COIN}_cw_*` these functions are not guaranteed to stay stable, and are made for cake wallet to implement features that are not used in xmruw nor in stack_wallet (which I need to double-check later?). | ||
|
||
## Contributing | ||
|
||
To contribute you can visit git.mrcyjanek.net/mrcyjanek/monero_c and open a PR, alternatively use any other code mirror or send patches directly. | ||
Broken? Not working? Need help? https://moneroc.mrcyjanek.net/ |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE categories | ||
SYSTEM "https://resources.jetbrains.com/writerside/1.0/categories.dtd"> | ||
<categories> | ||
<category id="wrs" name="Writerside documentation" order="1"/> | ||
</categories> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE buildprofiles SYSTEM "https://resources.jetbrains.com/writerside/1.0/build-profiles.dtd"> | ||
<buildprofiles xsi:noNamespaceSchemaLocation="https://resources.jetbrains.com/writerside/1.0/build-profiles.xsd" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | ||
|
||
<variables></variables> | ||
<build-profile instance="in"> | ||
<variables> | ||
<noindex-content>true</noindex-content> | ||
</variables> | ||
</build-profile> | ||
|
||
</buildprofiles> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE terms SYSTEM "https://resources.jetbrains.com/writerside/1.0/glossary.dtd"> | ||
<terms> | ||
<term name="foo"> | ||
Description of what "foo" is. | ||
</term> | ||
</terms> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE instance-profile | ||
SYSTEM "https://resources.jetbrains.com/writerside/1.0/product-profile.dtd"> | ||
|
||
<instance-profile id="in" | ||
name="monero_c docs" | ||
start-page="about.md"> | ||
|
||
<toc-element topic="about.md"/> | ||
<toc-element topic="Building.md"> | ||
<toc-element topic="Using-prebuilds.md"/> | ||
<toc-element topic="Linux.md"/> | ||
<toc-element topic="Android.md"/> | ||
<toc-element topic="Windows.md"/> | ||
<toc-element topic="macOS.md"/> | ||
</toc-element> | ||
</instance-profile> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Android | ||
|
||
Building on linux has been tested on | ||
- `ubuntu:22.04` (docker tag) | ||
|
||
## Install dependencies | ||
|
||
```bash | ||
$ apt update | ||
$ apt install -y build-essential pkg-config autoconf libtool \ | ||
ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf \ | ||
unzip python-is-python3 | ||
``` | ||
|
||
## Prepare source | ||
|
||
> If you are running in docker or have not configured git you may need to do the following: | ||
> ```bash | ||
> git config --global --add safe.directory '*' | ||
> git config --global user.email "[email protected]" | ||
> git config --global user.name "CI mrcyjanek.net" | ||
> ``` | ||
```bash | ||
$ git clone https://github.com/mrcyjanek/monero_c --recursive | ||
$ cd monero_c | ||
$ ./apply_patches.sh monero | ||
``` | ||
## Building | ||
|
||
<tabs> | ||
<tab title="x86_64"> | ||
<code-block> | ||
$ ./build_single.sh monero x86_64-linux-android -j$(nproc) | ||
</code-block> | ||
</tab> | ||
<tab title="aarch64"> | ||
<code-block> | ||
$ ./build_single.sh monero aarch64-linux-android -j$(nproc) | ||
</code-block> | ||
</tab> | ||
<tab title="armv7a"> | ||
<code-block> | ||
$ ./build_single.sh monero armv7a-linux-androideabi -j$(nproc) | ||
</code-block> | ||
</tab> | ||
</tabs> | ||
|
||
## Known issues | ||
|
||
None. Open an issue if you find something not working. |
Oops, something went wrong.