- [x] figgure out how to build the packages (that it installs native optional package automatically) - [X] Make the gluecode - [x] expose both the lowerlevel api that desktop uses (~~send objects and receive objects~~, getting path of rpc-server is enough) - [X] and the higher level api needed for bots (jsonrpc client) - [X] typescript types - [x] automatically pick the right binary from npm or allow getting it from env var, or give out an error (throw error) - [x] find out how to dev locally (use local built core in dc desktop) - there is the question of how to link the typescript client and the task to add a search in the cargo target folder for a debug build or a different way, find out some good flow that we can use and document for dc desktop + locally built core development - [x] build the packages in ci - [x] fix that deltachat-rpc-server is not executable postponed: - [ ] publish from ci - [ ] add key/token to deploy to npm Closes #4694 ## Related prs - https://github.com/deltachat-bot/echo/pull/69 - https://github.com/deltachat/deltachat-desktop/pull/3567 --------- Co-authored-by: link2xt <link2xt@testrun.org>
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:
- Python: https://pypi.org/project/deltachat-rpc-client/
- Go: https://github.com/deltachat/deltachat-rpc-client-go/
Run deltachat-rpc-server --version to check the version of the server.
Run deltachat-rpc-server --openrpc to get OpenRPC specification of the provided JSON-RPC API.