Holochain Command Line Tools
This crate implements a set of development tools for building and running Holochain DNA from the command line.
Install
Scripted installation
The install scripts provided by holochain core (see README) install all the dependencies required for holochain cli.
Manual installation
An option for the installation of hc command line tools is to download the binary for your platform from our releases page. Otherwise, you can proceed with the more complex instructions for building from source, below.
Building From Source
These dependencies need to be installed in order to compile, and use hc:
needs to be the
nightly-2019-01-24build, so use the following commands, once you have first installed Rustrustup toolchain install nightly-2019-01-24rustup default nightly-2019-01-24(the specific nightly build we use will change over time)
Also, if you are going to be developing Zomes in Rust, install the WASM build target for Rust, by running:
rustup target add wasm32-unknown-unknown --toolchain nightly-2019-01-24
Node.js version 8 or higher
Tests for Holochain apps are now written in Javascript and executed in Nodejs
To read further, check out the holochain-nodejs module
To install the cutting edge version of the Holochain conductor, run the following command in a terminal
To install the latest released version of the Holochain conductor, run the following command in a terminal
The command line tools are now available in your command line using the hc command.
Run hc --version to confirm.
Run hc help for help.
Networking
If you want to use hc run with real (as opposed to mock) networking, you will also need to install n3h.
Usage
(u) means the command is not yet implemented.
init
Initializes a new Holochain app at the given directory
generate
Generates a new Zome
package
Builds the current Holochain app into a .dna.json file
unpack
Unpacks a Holochain bundle into its original file system structure
test
Runs tests written in the test folder
run
Starts a websocket server for the current Holochain app
keygen
Creates a new passphrase encrypted agent key bundle
hc init & hc generate: How To Get Started Building An App
To read about hc init, used for starting a new Holochain project, see https://developer.holochain.org/guide/latest/new_project.html.
To read about hc generate, used for generating boilerplate code and files for a new Zome, see https://developer.holochain.org/guide/latest/zome/adding_a_zome.html.
hc package: Using Built-in Compilation
To read about hc package, used for bundling your source files into a single file runnable by Holochain, see https://developer.holochain.org/guide/latest/packaging.html.
hc test: Writing and Running Tests
To read about hc test, used for running tests over your source code, see https://developer.holochain.org/guide/latest/intro_to_testing.html.
hc run: Running your application
To read about hc run, used for spinning up a quick development version of your app with an HTTP or Websocket interface, that you can connect to from a UI, or any client, see https://developer.holochain.org/guide/latest/development_conductor.html.
hc keygen: Create agent key pair
Every agent is represented by a private/public key pair, which are used to author source chains. This command creates a new key pair by asking for a passphrase and writing a key bundle file that a Holochain Conductor can read when starting up an instance.
Contribute
Holochain is an open source project. We welcome all sorts of participation and are actively working on increasing surface area to accept it. Please see our contributing guidelines for our general practices and protocols on participating in the community.
License
Copyright (C) 2018, Holochain Foundation
This program is free software: you can redistribute it and/or modify it under the terms of the license p rovided in the LICENSE file (GPLv3). This program is distributed in the hope that it will be useful, bu t WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Note: We are considering other 'looser' licensing options (like MIT license) but at this stage are using GPL while we're getting the matter sorted out. See this article for some of our thinking on licensing for distributed application frameworks.
Last updated