minknow.cr

Test Lines of Code

Crystal bindings for the MinKNOW API. Includes generated RPC types and wrappers for Manager, instance, device, acquisition, protocol and live-read data services.

Installation

Requires Crystal >= 1.20 and libnghttp2. Add this dependency, then run shards install:

dependencies:
  minknow:
    github: kojix2/minknow

Connect

require "minknow"

manager = Minknow::Manager.new(
  Minknow::ConnectionConfig.new(host: "localhost", port: 9501, tls: true))
begin
  manager.fetch_flow_cell_positions.each do |position|
    puts "#{position.name}: #{position.host}:#{position.secure_port}"
  end
ensure
  manager.channel.close
end

Use manager.connect(position) for a position-specific connection. Its device, data, protocol, acquisition and instance methods expose service wrappers. For a first connection check without an attached sequencer, run:

crystal run examples/manager_info.cr

Authentication

Connections use TLS by default. Configure host/port/TLS through ConnectionConfig; example scripts also accept MINKNOW_HOST, MINKNOW_PORT and MINKNOW_TLS.

| Environment variable | Purpose | | --- | --- | | MINKNOW_TRUSTED_CA | CA file; otherwise MinKNOW's installation paths are checked | | MINKNOW_AUTH_TOKEN | Explicit local-auth token | | MINKNOW_API_CLIENT_CERTIFICATE_CHAIN / MINKNOW_API_CLIENT_KEY | Client certificate and key; set both | | MINKNOW_API_USE_LOCAL_TOKEN | Enable/disable automatic localhost token lookup | | PROTOCOL_TOKEN | protocol-auth metadata |

Remote connections need explicit authentication. auto_local_auth: overrides the lookup environment setting; local_auth_lookup_port: selects its Manager port.

Development

Generated sources are included; ordinary use does not need protoc. Run crystal spec. See examples for runnable commands and DEVELOPMENT.md for API regeneration and release checks.

License: MIT.