• This repository has been archived on 15/Sep/2020
  • Stars
    star
    878
  • Rank 51,998 (Top 2 %)
  • Language
    Go
  • License
    GNU General Publi...
  • Created almost 8 years ago
  • Updated about 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Holographic storage for distributed applications -- a validating monotonic DHT "backed" by authoritative hashchains for data provenance (a Ceptr sub-project)

Holochain

Code Status Travis Codecov Go Report Card License: GPL v3 Twitter Follow

Code Status

Alpha. Not for production use. The code has not yet undergone a security audit. You should expect unstable APIs and data chains.

NOT CURRENT REPOSITORY Holochain has been rebuilt in Rust, and this Go codebase is not maintained. Please see the NEW REPOSITORY for an updated and supported version.

Holographic storage for distributed applications

Holochain uses a monotonic distributed hash table (DHT) where every node enforces validation rules on data before publishing that data against the signed chains where the data originated.

In other words, Holochain apps function very much like a blockchain without bottlenecks when it comes to enforcing validation rules, but is designed to be fully distributed with each node only needing to hold a small portion of the data instead of everything needing a full copy of a global ledger. This makes it feasible to run blockchain-like applications on devices as lightweight as mobile phones.

History

Proof-of-concept was unveiled at our first hackathon (March 2017). Alpha 0 was released October 2017. Alpha 1 was released May 2018.

Holochain Links: FAQ Developer Wiki White Paper GoDocs

Table of Contents

Installation

Developers Only: At this stage, holochain is only for use by developers (either developers of applications to run on holochains, or developers of the holochain software itself). App developers should bundle their app in an installer as either approach below is not for non-technical folks.

There are two approaches to installing holochain:

  1. as a standard Go language application for direct execution on your machine
  2. using docker for execution in a container.

Which you choose depends on your preference and your purpose. If you intend to develop holochain applications, then you should almost certainly use the docker approach as we provide a testing harness for running multiple holochain instances in a docker cluster. If you will be developing in Go on holochain itself then you will probably end up doing both.

Quick Install

  1. Download the most recent release (https://github.com/holochain/holochain-proto/releases/) for your OS.
  2. Unzip it to your directory of choice (or compile it from source).
  3. Add that directory to your PATH if you want to call holochain-proto commands outside of that directory (this step differs by OS).
  4. The commands listed in the 'Usage' section should now be available.

Go Based Install

Unix

(Unix includes macOS and Linux.)

  1. Download Go. Download the "Archive" or "Installer" for version 1.8 or later for your CPU and OS. The "Source" download does not contain an executable and step 3 will fail.

  2. Install Go on your system. See platform specific instructions and hints below for making this work.

  3. Setup your path (Almost all installation problems that have been reported stem from skipping this step.)

    • Export the $GOPATH variable in your shell profile.
    • Add $GOPATH/bin to your $PATH in your shell profile.

    For example, add the following to the end of your shell profile (usually ~/.bashrc or ~/.bash_profile):

        export GOPATH="$HOME/go"
        export PATH="$GOPATH/bin:$PATH"
  1. Install the command line tool suite with:
$ go get -d -v github.com/holochain/holochain-proto
$ cd $GOPATH/src/github.com/holochain/holochain-proto
$ make
  1. Test that it works (should look something like this):
$ hcadmin -v
hcadmin version 0.0.x (holochain y)

Windows

First you'll need to install some necessary programs if you don't already have them.

  • Download Go. Download the "Archive" or "Installer" for version 1.8 or later for Windows and your CPU. The "Source" download does not contain an executable.
  • Install Windows git. Be sure to select the appropriate options so that git is accessible from the Windows command line.
  • Optional: Install GnuWin32 make.

Next, in your Control Panel, select System>Advanced system settings>Environment Variables... and under System Variables do the following:

  1. Add a new entry with the name GOPATH and the value %USERPROFILE%\go (Or your Go workspace folder).
  2. Double-click Path, and in the window that pops up add the following entries:
    • %GOPATH%\bin
    • C:\Go\bin (Or wherever you installed Go to+\bin).
    • C:\Program Files (x86)\GnuWin32\bin (Or wherever you installed GnuWin32 make to+\bin).

Docker Based Install

Using docker, you don't have to install Go first. Our docker scripts manage installation of Go, holochain dependencies and holochain. The docker installation can run alongside Local ("Go") installation of holochain, sharing config directories. See docker usage on our wiki for more on how this works.

  1. Install the latest version of Docker on your machine

    1. Docker Installation. The Community edition; stable is sufficient.
    2. See Docker Getting Started for help.
    3. It is recommended to add your user to the docker group as in: Post Installation Steps, rather than use sudo before all script commands. Holochain Apps cannot exploit the kinds of security concerns mentioned in the Post Installation Steps document.  
  2. Confirm that docker installation and permissions are working by running:

    	$ docker info
  3. Pull our holochain image from docker hub:

    	$ docker pull holochain/holochain-proto:develop
  4. To run holochain in your new environment, suitable to continue the walkthrough below in usage

    	$ docker run --rm -it --name clutter -p 3141:3141 holochain/holochain-proto:develop
  5. This will put you into an new command shell that may behave differently than what you're used to. To exit this holochain (Alpine) shell, press Ctrl-D or type exit

Usage

These instructions are for using the holochain command line tool suite: hcadmin, hcdev and hcd. They should work equally well for Go based or docker based installation.

(Note that since Holochain is intended to be used behind distributed applications, end users should not have to do much through the command or may not have it installed at all, as the application will probably have wrapped up the holochain library internally.)

Each of the tools includes a help command, e.g., run hcadmin help or for sub-commands run hcadmin <COMMAND> help. For more detailed information, see the wiki page

The tool suite include these commands:

  • hcadmin for administering your installed holochain applications
  • hcd for running and serving a holochain application
  • hcdev for developing and testing holochain applications

Getting Started

The instructions below walk you through the basic steps necessary to run a holochain application.

Initializing the Holochain environment

	$ hcadmin init '[email protected]'

This command creates a ~/.holochain directory for storing all chain data, along with initial public/private key pairs based on the identity string provided as the second argument.

Joining a Holochain

You can use the hcadmin tool to join a pre-existing Holochain application by running the following command (replacing SOURCE_PATH with a path to an application's DNA and CHAIN_NAME with the name you'd like it to be stored as).

For example: hcadmin join ./examples/chat chat

Note: this command will be replaced by a package management command still in development.

Running a Holochain

Holochains run and serve their UI via local web sockets. This allows interface developers lots of freedom to build HTML/JavaScript files and drop them in that chain's UI directory. You start a holochain and activate it's UI with the hcd command:

$ hcd <CHAIN_NAME> [PORT]

Developing a Holochain

The hcdev tool allows you to:

  1. generate new holochain application source files by cloning from an existing application, from a package file, or a simple empty template.
  2. run stand-alone or multi-node scenario tests
  3. run a holochain and serve it's UI for testing purposes
  4. dump out chain and dht data for inspection

Please see the docs for more detailed documentation.

Note that the hcdev command creates a separate ~/.holochaindev directory for serving and managing chains, so your dev work won't interfere with any running holochain apps you may be using.

Test-driven Application Development

We have designed Holochain around test-driven development, so the DNA should contain tests to confirm that the rest of the DNA is functional. Our testing harness includes two types of testing, stand-alone and multi-instance scenarios. Stand-alone tests allow you to tests the functions you create in your application. However, testing a distributed application requires being able to spin up many instances of it and have them interact. Our docker cluster testing harness automates that process, and enables app developers to specify scenarios and roles and test instructions to run on multiple docker containers.

Please see the App Testing documentation for details.

File Locations

By default holochain data and configuration files are assumed to be stored in the ~/.holochain directory. You can override this with the -path flag or by setting the HOLOPATH environment variable, e.g.:

$ hcadmin -path ~/mychains init '<[email protected]>'
$ HOLOPATH=~/mychains hcadmin

You can use the form: hcadmin -path=/your/path/here but you must use the absolute path, as shell substitutions will not happen.

Logging

All the commands take a --debug flag which will turn on a number of different kinds of debugging. For running chains, you can also control exactly which of these logging types you wish to see in the chain's config.json file. You can also set the HCDEBUG environment variable to 0 or 1 to temporarily override your settings to turn everything on or off. See also the Environment Variable documentation for more granular logging control.

Architecture Overview and Documentation

Architecture information and application developer documentation is in our developer.holochain.org.

You can also look through auto-generated reference API on GoDocs

Holochain Core Development

We accept Pull Requests and welcome your participation. Please make sure to include the issue number your branch names and use descriptive commit messages.

Contribute

Contributors to this project are expected to follow our development protocols & practices.

Getting started

Once you have followed the basic "getting started" guide above you will have the CLI tools installed locally.

All the commands (hcadmin, hcd, hcdev, etc.) are built from the same repo:

$ cd $GOPATH/src/github.com/holochain/holochain-proto

Go will throw errors complaining about not being on the $GOPATH if you try to run make from a separate copy of the holochain-proto repository. If you want to contribute to Holochain core you must work in the repository created by Go.

The Makefile contains all the build commands for Holochain. If you make an update to a command you will need to rebuild it before the changes take effect at the command line.

E.g. After making an update to cmd/hcdev/hcdev.go run $ make hcdev then run $ hcdev as normal.

Dependencies

This project depends on various parts of libp2p, which uses the gx package manager. All of which will be automatically installed by make by following the setup instructions above.

The package manager rewrites files that are tracked by git to configure imports. Be careful not to commit the generated imports to git!

make work adds the imports to the repository and make pub reverts them.

Every make command should automatically add and remove imports for you. If a make command is leaving mess behind in the repo, please open a bug report.

If you want to use go commands directly (e.g. go test) then you need to run make work manually first and remember to make pub before committing any changes.

Tests

To compile and run all the tests:

$ cd $GOPATH/src/github.com/holochain/holochain-proto
$ make test

go test can be used instead of make test, but only after make work.

The docker setup runs tests automatically during builds.

License

License: GPL v3

Copyright (C) 2018, The MetaCurrency Project (Eric Harris-Braun, Arthur Brock, et. al.)

This program is free software: you can redistribute it and/or modify it under the terms of the license provided in the LICENSE file (GPLv3). This program is distributed in the hope that it will be useful, but 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.

Acknowledgements

  • MetaCurrency & Ceptr: Holochains are a sub-project of Ceptr which is a semantic, distributed computing platform under development by the MetaCurrency Project.  
  • Ian Grigg: Some of our initial plans for this architecture were inspired in 2006 by his paper about Triple Entry Accounting and his work on Ricardian Contracts.  
  • Juan Benet & the IPFS team: For all their work on IPFS, libp2p, and various cool tools like multihash, multiaddress, etc. We use libP2P library for our transport layer and kademlia dht.  
  • Crypto Pioneers And of course the people who paved the road before us by writing good crypto libraries and preaching the blockchain gospel. Back in 2008, nobody understood what we were talking about when we started sharing our designs. The main reason people want it now, is because blockchains have opened their eyes to the power of decentralized architectures.

More Repositories

1

holochain

The current, performant & industrial strength version of Holochain on Rust.
Rust
1,170
star
2

holochain-rust

DEPRECATED. The Holochain framework implemented in rust with a redux style internal state-model.
Rust
1,121
star
3

launcher-tauri

Desktop launcher to install and use Holochain apps locally
Vue
262
star
4

holochain-client-js

A JavaScript client for the Holochain Conductor API
TypeScript
258
star
5

cryptographic-autonomy-license

The Cryptographic Autonomy License is a new breed of open license that protects not just the app developers and users of the source code but also end user privacy and control of identity and data.
241
star
6

scaffolding

Scaffolding tool to quickly generate and edit holochain applications
Handlebars
220
star
7

clutter

Fully distributed twitter built on holochain
JavaScript
161
star
8

holonix-archive

NixOS && Holochain
Nix
150
star
9

holochain-ui

UI for composing Holochain experiences. First app is the Abundance of Presence chat & meeting coordination tool. Also includes Persona and Profile Management with Vault.
TypeScript
99
star
10

holochain-client-rust

A Rust client for the Holochain Conductor API
Rust
97
star
11

happ-build-tutorial

Tutorial on how to build hApp DNAs for Holochain RSM
TypeScript
96
star
12

docs-pages

The hosted static files for the Holochain developer documentation
Nunjucks
96
star
13

peer-chat-redux

Instant messaging application running on Holochain-redux in Holoscape [For chat on Holochain rsm see https://github.com/holochain/elemental-chat/]
JavaScript
90
star
14

syn

Generalized Holochain DNA and UI library for building real-time shared state hApps
TypeScript
89
star
15

elemental-chat

A chat DNA for Holochain RSM
TypeScript
81
star
16

apps

Your guide to fnding, installing, and running holochain apps
HTML
71
star
17

deepkey

A Holochain implementation of decentralized public key infrastructure
Rust
68
star
18

CRISPR-Holochain-redux

Electron app for designing and generating Zomes with UI Components
Vue
66
star
19

tx5

Holochain WebRTC P2P Communication Ecosystem
Rust
66
star
20

holoscape

A complete end-user deployment of a Holochain conductor with UI for administration and a run-time for hApp UIs
HTML
63
star
21

holochain-wasmer

Rust
61
star
22

devhub-dnas

DNAs for sharing source code and distributing compiled WASM that comprise Holochain Apps.
Rust
60
star
23

wind-tunnel

Performance testing for Holochain
Rust
60
star
24

hc-utils

A util crate for holochain-rsm
Rust
58
star
25

launcher

Desktop launcher to install and use Holochain apps locally (Electron version)
TypeScript
58
star
26

HoloWorld

Basic Hello World app for Holochain
JavaScript
57
star
27

holochat

Multi-room P2P chat (like a distributed Slack) which runs on holochain
HTML
56
star
28

holochain-nixpkgs

Nix
56
star
29

dpki

Distributed Public Key Infrastructure which runs on holochain
JavaScript
56
star
30

how

Embodment of a Holochain emegent standards process
TypeScript
55
star
31

hc-web-client-redux

RPC WebSocket client for Holochain web UIs
JavaScript
54
star
32

holochain-serialization

Abstractions to probably serialize and deserialize things properly without forgetting or doubling
Rust
49
star
33

website

jekyll website for holochain.org
HTML
48
star
34

n3h

nodejs implementation of holochain networking / p2p backend process
JavaScript
48
star
35

elemental-chat-ui

A Vue.js + Vuetify + Vuex web app for Elemental Chat DNA.
JavaScript
48
star
36

scaffold

Web-based wizard for generating scaffolding for holochain applications.
JavaScript
46
star
37

devhub-gui

A web-based UI that works with Holochain's collection of DevHub DNAs.
JavaScript
45
star
38

lib3h

The lib3h p2p communication rust library.
Rust
44
star
39

hc-zome-lib

This is a pkgs with multiple zomes that can be used in your holochain dna
Rust
43
star
40

lair

secret lair private keystore
Rust
42
star
41

sodoken

Libsodium wrapper providing tokio safe memory secure api access.
Rust
42
star
42

minersweeper

Massively Multiplayer Distributed Minesweeper on Holochain
TypeScript
41
star
43

hdk-assemblyscript

The Holochain Developer Kit for Assemblyscript
JavaScript
41
star
44

holochain-anchors

A core pattern for storing AND FINDING data in a Holochain DHT. Anchors are a predictable hash (by using known content) from which you can attach links
Rust
39
star
45

holochain-blog-theme

The Ghost theme files for blog.holochain.org
CSS
38
star
46

hcSeedBundle

Javascript SeedBundle parsing and generation library.
TypeScript
36
star
47

holochain-cmd

Developer Command Line Tools for Holochain
Rust
36
star
48

holochain-load-test

Load testing for Holochain
Python
35
star
49

influxive

Opinionated tools for working with InfluxDB from Rust
Rust
35
star
50

holochain-client-python

A Python client for the Holochain Conductor API
Python
32
star
51

ghost_actor

GhostActor makes it simple, ergonomic, and idiomatic to implement async / concurrent code using an Actor model.
Rust
32
star
52

holochain-serialization-python

Rust
31
star
53

app-store-dnas

DNAs for Holochain App discovery and download.
Rust
31
star
54

bootstrap2

Holochain bootstrap peer discovery.
Rust
31
star
55

bootstrap

Bootstrap nodes onto a network by allowing existing nodes to list themselves under a URL
TypeScript
30
star
56

tryorama

Toolset to manage Holochain conductors and facilitate test scenarios
TypeScript
30
star
57

hc-spin

CLI to run Holochain Apps in Development Mode
TypeScript
30
star
58

hc-ts-template

Typescript + React + Redux + holochain-proto starter app
JavaScript
29
star
59

integrity-template

establishing patterns for separating integrity zomes from accessor zomes for Holochain apps
Rust
29
star
60

holosqape

Qt and QML based Holochain container app
C++
28
star
61

holochain-serialization-js

A JavaScript Wasm binding of the Holochain serialization and hashing algorithm (JaWaHoSeHa)
JavaScript
28
star
62

hc-tel

holochain telemetry experiment
Rust
27
star
63

benchmarks

sample apps used to establish initial holo fuel pricing
JavaScript
26
star
64

happ-client-call-tutorial

How to call your hApp
Rust
26
star
65

HCHC

The Holochain of Holochains
JavaScript
26
star
66

cointoss

example holochain app for "trustable random initiation"
JavaScript
26
star
67

holochain-nodejs

Test Holochain apps (hApps) within a nodejs container.
Rust
25
star
68

holochain-logging

Rust
25
star
69

identity-manager

DeepKey + Personas & Profiles
TypeScript
25
star
70

portal-dna

A DNA for providing zome function access across networks
Rust
25
star
71

react-graphql-template

JavaScript
24
star
72

app-store-gui

A web-based UI that works with Holochain's collection of App Store DNAs.
JavaScript
24
star
73

web-components

Library of React Web Components for Holochain Apps
JavaScript
24
star
74

mapOnHolochain

23
star
75

dao

Holochain implementation of standard ethereum DAO (Decentralized Autonomous Organization)
JavaScript
23
star
76

hc-spin-rust-utils

Rust node add-ons for hc-spin
JavaScript
23
star
77

hdk-rust

HDK Rust HAS MOVED -> https://github.com/holochain/holochain-rust/tree/develop/hdk-rust
Rust
23
star
78

holodex

Holochain application indexing engine for distributed apps which run on holochains
JavaScript
23
star
79

hc-test-utils

A lib of testing utility crates to support testing with holochain beta releases.
Rust
23
star
80

hc-state-cli-node

JavaScript
22
star
81

soa-toolbox

soa-toolbox is a set of plugins for Miro that give special functionality
JavaScript
22
star
82

hackathon-happs

hApps developed at various hackathons and training events
Rust
22
star
83

personas-profiles-redux

Holochain-redux (deprecated) app for people to manage how other apps access their personal information.
TypeScript
22
star
84

happ-index

"The poor man's hApp store" - short term interim solution until decentralized hApp store running on Holochain is up
21
star
85

holochat-rust

An extremely simple and small P2P chat app, with chat rooms
HTML
20
star
86

tasktaskic

an example app for holochain-rust 0.0.1 developer preview
Rust
20
star
87

hc-siderun

Helper utility for initializing a cluster of holochain nodes all connecting to a local bootstrap server (and thus, to each other)
Shell
20
star
88

holochain-persistence

Abstractions for saving and retrieving data locally
Rust
20
star
89

dev-camp-tests-rust

A test-driven development way to learn Holochain!
JavaScript
20
star
90

holochain-forum-theme

The Discourse theme for forum.holochain.org
20
star
91

hcrs

nodejs scaffold generation for holochain-rust
JavaScript
20
star
92

tx3

tx3 p2p communications
Rust
19
star
93

hc-rtc-demo

Holochain webrtc PoC / demo application
19
star
94

docs-pages-redux

Developer docs for Holochain Redux (legacy)
HTML
19
star
95

vue-cli-preset-holochain

Preset for creating Vue, Vuetify, Vuex, dexie Holochain apps.
19
star
96

dna-to-openapi

given holochain dna, generate a swagger / openapi spec file
JavaScript
18
star
97

core-concepts-examples-redux

A selection of example projects to illustrate the core concepts of Holochain
Rust
18
star
98

app-spec-rust

App Spec Rust HAS MOVED into holochain-rust repository!
Rust
18
star
99

vue-cli-plugin-holochain

Vue plugin that sets up a complete Vue + Vuetify + Vuex + Dexie + Holochain app
Vue
18
star
100

hc-rtc-sig

holochain webrtc signal server / client
18
star