We are happy to accept small and large contributions, feel free to make a suggestion or submit a pull request.
Use the provided Makefile
for basic actions to ensure your changes are ready for CI.
$ make build
$ make check-clippy
$ make check-fmt
$ make test
Using the makefile is not necessary during your development cycle, feel free to use the relevant cargo commands directly, in which case you'll likely need openssl's dev files, the protocol buffer compiler and a c dev environment; on a clean slate Ubuntu:
$ apt install make protobuf-compiler clang libssl-dev
However running make
before publishing a PR will provide a good signal if you PR will pass CI.
The above make
targets test changes as a whole.
In order to test specific changes use the Rust cargo
tooling directly.
To run all tests via cargo
use:
cargo test
To run tests for a single crate in the workspace use:
cargo test -p ceramic-event
To debug code and tests enable logging of traces:
- By default no tracing logs are output
- Use env var
RUST_LOG
, i.e.RUST_LOG=debug
, to enable logging in tests. Note only failing tests will print their logs, as this is the defaultcargo test
behavior. - Use
cargo test -- --show-output
to print logs from passing tests. This is because by default cargo test suppresses all logs from passing tests. - Use
cargo test -- --nocapture
to print logs from passing or failing tests as they are printed without any buffering.
See the env_logger docs for more details on how RUST_LOG
can be used.
See the tracing docs for more details on adding new trace events into code or tests.
There are two OpenAPI based servers that are generated.
The ceramic-api-server
and ceramic-kubo-rpc-server
crates are generated using OpenAPI.
You will need to install augtools to run the checks:
# Install augtools e.g. brew install augeas or apt-get install augeas-tools
make gen-api-server
make gen-kubo-rpc-server
To package rust-ceramic, you will need the following dependencies
You can then run the package script to generate a package for your operating system.
To release rust-ceramic, you will need the following dependencies
When releasing, please release at the appropriate level
patch
-> binary compatible, no new functionalityminor
(default) -> binary incompatible or binary compatible with new functionalitymajor
-> breaking functionality
You will also need to login with the gh
client to your github account, and that account needs permission to perform
a release of the rust-ceramic repository.
You can then run the release script to create a release of rust-ceramic.