mirror of
https://github.com/chatmail/core.git
synced 2026-04-25 09:26:30 +03:00
Opening the same account (context) from multiple processes is dangerous, can result in duplicate downloads of the same message etc. Same for account manager, attempts to modify the same accounts.toml even if done atomically with may result in corrupted files as atomic replacement procedure does not expect that multiple processes may write to the same temporary file. accounts.toml cannot be used as a lockfile because it is replaced during atomic update. Therefore, a new file next to accounts.toml is needed to prevent starting second account manager in the same directory. But iOS needs to be able to open accounts from multiple processes at the same time. This is required as the "share-to-DC extension" is a separate process by iOS design -- this process may or may not be started while the main app is running. Accounts are not altered however by this extension, so let's add to the `Accounts::new()` constructor an `rdwr` parameter which allows to read the accounts config w/o locking the lockfile.
Delta Chat RPC server
This program provides a JSON-RPC 2.0 interface to DeltaChat over standard I/O.
Install
To download binary pre-builds check the releases page.
Rename the downloaded binary to deltachat-rpc-server and add it to your PATH.
To install from source run:
cargo install --git https://github.com/deltachat/deltachat-core-rust/ deltachat-rpc-server
The deltachat-rpc-server executable will be installed into $HOME/.cargo/bin that should be available
in your PATH.
Usage
To use just run deltachat-rpc-server command. The accounts folder will be created in the current
working directory unless DC_ACCOUNTS_PATH is set:
export DC_ACCOUNTS_PATH=$HOME/delta/
deltachat-rpc-server
The common use case for this program is to create bindings to use Delta Chat core from programming languages other than Rust, for example: