minknow.cr

test Lines of Code

🧬🎛️ MinKNOW API for Crystal

Installation

Add the dependency to your shard.yml:

dependencies:
  minknow:
    github: kojix2/minknow

Run shards install

Quick Start

require "minknow"

Recommended first smoke test for a local MinKNOW installation:

crystal run examples/manager_info.cr

If you specifically want to see connected sequencing positions:

crystal run examples/list_devices.cr

For local MinKNOW installations, examples/manager_info.cr is a better first check than examples/list_devices.cr because it succeeds even when no sequencing device is attached.

Public API

The intended public surface for v0.0.0 is:

The generated types under src/generated are shipped as implementation detail and may change shape more often than the high-level wrapper.

Connection Behavior

Minknow::ConnectionConfig resolves MinKNOW connectivity in this order:

Notes:

Environment Variables

Common environment variables:

MINKNOW_HOST=localhost
MINKNOW_PORT=9501
MINKNOW_TLS=true
MINKNOW_TRUSTED_CA=/var/lib/minknow/data/rpc-certs/minknow/ca.crt
MINKNOW_AUTH_TOKEN=<developer-or-local-token>
MINKNOW_API_CLIENT_CERTIFICATE_CHAIN=/path/to/client-chain.pem
MINKNOW_API_CLIENT_KEY=/path/to/client-key.pem
PROTOCOL_TOKEN=<protocol-token>
MINKNOW_API_USE_LOCAL_TOKEN=0|1

Typical meanings:

Examples

Example details and runnable commands are documented in examples/README.md.

Quick pointers:

Limitations

v0.0.0 intentionally has a narrow scope.

Troubleshooting

TLS certificate verify failed:

Set MINKNOW_TRUSTED_CA to the MinKNOW CA file, or confirm that MinKNOW's default CA path exists on the machine.

Unauthenticated:

For local connections, confirm that local guest access is enabled and that MINKNOW_API_USE_LOCAL_TOKEN is not disabling token lookup. For remote connections, provide MINKNOW_AUTH_TOKEN or client certificates.

positions=0 from list_devices.cr:

This usually means the connection to MinKNOW succeeded but no sequencing positions are currently available or attached.

Client certificate configuration errors:

MINKNOW_API_CLIENT_CERTIFICATE_CHAIN and MINKNOW_API_CLIENT_KEY must be set together and must both point to existing PEM files.

Release Checklist

Release checklist is documented in DEVELOPMENT.md.

Changelog

See CHANGELOG.md for release notes.

Development

Development notes and generation workflow are documented in DEVELOPMENT.md.