The purpose of this project is to provide a command-line tool for the DevHub app that resembles other package management tools such as NPM or Cargo.
- Enter
nix develop
for development environment dependencies.
nix develop
[nix-shell]$ make lib/index.js
To run all tests with logging
nix develop
[nix-shell]$ make test
NOTE: set the
DEBUG_LEVEL
environment variable tofatal
,error
,normal
,info
,debug
, ortrace
for different logging levels.
The DevHub CLI requires a Holochain runtime with the DevHub App installed.
- Install Launcher
- Install DevHub
- Install DevHub CLI
- Setup CLI access to Launcher
Download v0.400.0-rc.2
from https://github.com/holochain/launcher/releases/tag/v0.400.0-rc.2 and
install.
Download devhub.happ
from
https://github.com/holochain/devhub-dnas/releases/tag/zomehub-zomelets-v0.2.0-dev.3
- Open Launcher
- Complete setup
- Install
devhub.happ
from file system- Use network
devhub-beta-testing
- Use network
npm i -g @holochain/devhub-cli
Test install with
devhub connection status
- Go to Launcher settings
- Navigate to the
devhub
app you just installed - Under Settings -> Advanced Settings
- Generate an unlimited use authentication token that's valid until Launcher is quit.
- Copy that token and the
App Port
displayed on the same settings pagedevhub connection -g set <app port>, <auth token>
- Test the connection with
devhub connection status
- Try the command
devhub zomes list
. You should get aBadCapGrant
error - Copy the
client_agent
from the connection status output and use it to "Grant Permission" on the devhub settings page. - Check the connection status again and the status should say
CONNECTED
Now you can explore the CLI tool using --help
- Run Holochain
- Establish an App Port
- Create an Agent
- Install & Enable DevHub
- Grant Capabilities to Agent
- Create Auth Token
Install Backdrop Globally - @spartan-hc/holochain-backdrop
npm i -g @spartan-hc/holochain-backdrop
Make a directory to store the holochain runtime files
mkdir global-holochain
Start backdrop with a given config location and admin port (4656 stands for HOLO)
cd global-holochain
holochain-backdrop --config config.toml --admin-port 4656
Install the Admin CLI Globally - @spartan-hc/holochain-admin-client
npm i -g @spartan-hc/holochain-admin-client
Create an app interface connection point (24246 stands for CHAIN)
hc-admin -p 4656 interfaces app create 24246
hc-admin -p 4656 agents create
Remember Agent pubkey for later use.
AGENT=...
Download devhub.happ
file from Github
releases.
hc-admin -p 4656 apps install -i devhub $AGENT devhub.happ
Remember ZomeHub DNA hash for later use.
ZOMEHUB=...
hc-admin -p 4656 apps enable devhub
hc-admin -p 4656 grants create unrestricted devhub-zomehub-unrestricted $AGENT $ZOMEHUB
Auth tokens are like session tokens; they need to be recreated every time the holochain process is restarted.
hc-admin -p 4656 auth create --multi-use --expiry-seconds 0 devhub