Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
embedded-holochain-runner
A library that makes it VERY easy to run Holochain as a library, from your own binary, with great defaults
How it will work
datastore_path
is most important. If existing persisted Holochain conductor files
are found in the given directory, it will simply re-use the admin_ws_port
app_ws_port
app_id
and dnas
from that configuration. Otherwise, it will create that directory, and setup your configuration as specified.
It will pair nicely with structopt to make a configurable service. See a simple demo. For a more advanced application using the exported async_main
function, shutdown signal, and StateSignal
listeners, you can see it in use in the Acorn Holochain application.
In either case,
- first run/installation
- second run/reboot
it will log this to the console when the interfaces are all ready and the app installed or running:
EMBEDDED_HOLOCHAIN_IS_READY
Usage
Cargo.toml
[]
= { = "https://github.com/Sprillow/embedded-holochain-runner.git" }
[]
= { = "https://github.com/holochain/rkv.git", = "master" }
= { = "https://github.com/holochain/lmdb-rs.git" }
Assuming you have a compiled Holochain DNA file sitting around at ../dna/sample/sample.dna
...
main.rs
use *;
const SAMPLE_DNA: &'static = include_bytes!;
It will clearly log its configuration to the console.
RUST_LOG environment variable can be set to get details logs from Holochain. Those logs are by default suppressed.
Events
if you pass an event_channel
, which should be of type: Option<tokio::sync::mpsc::Sender<StateSignal>>
where StateSignal
can be imported via use embedded_holochain_runner::StateSignal
, you can listen for the following events, to trigger external actions.
It looks like:
Bootstrap Networking Service
This library is currently pointed at the https://bootstrap-staging.holo.host
node discovery service.
Holochain Version
The HDK used for your DNA should match the version used in this library, which is listed below. Such as:
Zome Cargo.toml
[]
# use whatever hdk uses
= "*"
= { = "https://github.com/holochain/holochain.git", = "bdb9c55d504135df39ccb1c75896557a788d0ac0", = "hdk"}
Currently bundles Holochain version: bdb9c55d504135df39ccb1c75896557a788d0ac0 (June 25, 2021).