0.0.39 • Published 3 years ago

electron-holochain v0.0.39

Weekly downloads
-
License
CAL-1.0
Repository
github
Last release
3 years ago

electron-holochain

Holochain Revision: v0.0.149 July 10, 2022

Lair Keystore Revision: v0.2.0 June 20, 2022

Expects an HAPP built with HDK v0.0.142 and HDI v0.0.14

manage holochain processes during an electron application runtime, using holochain-runner binaries.

// function initAgent(
//   app: App,
//   opts: ElectronHolochainOptions,
//   pathOptions?: PathOptions
// ): Promise<{ statusEmitter: StatusUpdates, shutdown: () => Promise<void> }>

import {app} from 'electron'
import initAgent, {
  StateSignal,
  StatusUpdates,
  STATUS_EVENT,
  APP_PORT_EVENT,
  ElectronHolochainOptions,
  PathOptions
} from 'electron-holochain'

const runnerOptions: HolochainRunnerOptions = {
  happPath: 'pathtomyhapp.happ',
  keystorePath: string
  passphrase: string
  // datastorePath?: 'string' default: databases
  // appId?: string
  // appWsPort?: number
  // adminWsPort?: number
  // proxyUrl?: string
  // membraneProof?: string
  // bootstrapUrl?: string
  // uid?: string
}

const { statusEmitter, shutdown } = await initAgent(app, runnerOptions)

// listen on the statusEmitter for status update
statusEmitter.on(STATUS_EVENT, (status: StateSignal) => {
  // do stuff
})

// listen on the statusEmitter for the websocket port used for app
statusEmitter.on(APP_PORT_EVENT, (appPort: string) => {
  // do stuff
}
// when the app quits, holochain-runner and lair-keystore will shut down automatically

// you can also call the following, to shut them down
await shutdown()
0.0.39

3 years ago

0.0.38

3 years ago

0.0.36

3 years ago

0.0.35

3 years ago

0.0.32

3 years ago

0.0.34

3 years ago

0.0.20

4 years ago

0.0.21

4 years ago

0.0.22

4 years ago

0.0.24

3 years ago

0.0.25

3 years ago

0.0.17

4 years ago

0.0.18

4 years ago

0.0.19

4 years ago

0.0.30

3 years ago

0.0.31

3 years ago

0.0.26

3 years ago

0.0.27

3 years ago

0.0.28

3 years ago

0.0.29

3 years ago

0.0.15

4 years ago

0.0.16

4 years ago

0.0.13

4 years ago

0.0.14

4 years ago

0.0.11

4 years ago

0.0.12

4 years ago

0.0.9

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

4 years ago

0.0.2

4 years ago

0.0.101

4 years ago

0.0.1

4 years ago