Holochain Dev Pulse 04 — One Rust Repo

One Repo to Rule Them All, One Rust Repo to Find Them

Holochain Design
Holochain
Published in
5 min readNov 27, 2018

--

Holochain Dev Pulse 04

Summary

We’re making some changes to the way our source code is organized; this will help us consolidate our efforts into one place and make developers’ lives easier. The communication interface has also been completed, which means that an app’s back-end can now talk to its front-end.

Highlights

1. One Repo: We have consolidated the source code; this will make it easier for you to work on and test.
2. Link Validation: This gives you the ability to decide who links to what on your app.
3. Application Interface: An app’s back-end and front-end can now communicate with each other.
4. Holochain-nodejs: New Release
5. Get Started: Write your first Holochain Rust app!

Details

What’s coming up? The Holochain Developer Rust Preview Release for DevCamp #2 will be released by November 29th.

1. One Repo: We have consolidated the source code; this will make it easier for you to work on and test.

If you’ve been watching our Git repos, you’ll probably notice that a lot of them are now deprecated/read-only, and their code has been moved into the Holochain-rust repo.

When we started refactoring Holochain in Rust, we knew there would be a few separate but related projects that make up what developers and users experience as Holochain — the core library, the developer tools, the executables, the UI layers, etc. At that stage, in order to keep unrelated conversations separate and manage dependencies explicitly via submodules, it made sense to put each project in its own separate Git repository.

Streamlined Process

As our codebase matured, we found that the separation of repos was causing issues with our tooling. Our Travis CI pipeline was building some codebases twice, which led to long build times. Changes in the core library would cause tests to fail in the app-spec-rust repo, but they wouldn’t get noticed right away. Improvements made to one build script wouldn’t make it into other build scripts. And lastly, it meant that we had to add release tags in many different places.

We decided that the benefits of having one large repo outweighed the costs. You’ll see that these repos have now moved into Holochain-rust:

They’re all still separate Rust crates, but now that we have them in one repository, we’ll have a more streamlined, speedy, and robust build/test process. You’ll also be able to find all the binaries in one place.

2. Link Validation: This gives you the ability to decide who links to what on your app.

We’ve finished writing the code that makes it possible to write validation functions for links. It’s almost ready to merge with our develop branch. We expect it to land this week; we’re just waiting on the resolution of some Windows build errors. This will allow you to put constraints on who is allowed to link to what in your app.

3. Application Interface: An app’s back-end and front-end can now communicate with each other.

Container consolidation and WebSocket interface (interface implementation allows local agents to talk to a running instance over WebSocket)

As we mentioned in Dev Pulse 02, we’ve been working on retiring a container implementation, “hcshell,” and moving script execution to Holochain-nodejs and the WebSocket interface to the Rust container. We’ve drafted the container API spec, which allows the creation, destruction, starting, and stopping of app instances.

We’ve also drafted the specifications for the communication interface, which is the channel that allows front-ends (e.g., desktop apps, a browser-based GUI, or even a shell script) to talk to a running Holochain app instance.

Our first interface implementation is a WebSocket channel. The exciting thing about this implementation is that it demonstrates the ability to start and speak to multiple apps on one running Holochain instance. With the prototype version, a new instance (with its own HTTP port) had to be started for every app. The new interface is pending review; we’ll talk more about it in a future Dev Pulse!

4. Holochain-nodejs: New Release (0.1.22)

You can now talk to your zome functions when you’re using the node.js library with actual JavaScript objects, rather than doing your own JSON (de)serialization. This makes your tests simpler because you’re not wasting characters on boilerplate. It may seem like a small thing, but we’re committed to making developers’ lives easier.

Now that all our code is under one roof, we’ve tagged and published a new release. You can find it on GitHub or NPM.

5. Get Started: Write your first Holochain Rust app!

Have you read this article yet?

How-To article that will take you from installing the new Holochain Rust

Willem Olding, one of our hApp developers, recently published a How-To article that will take you from installing the new Holochain Rust all the way to writing the DNA for a basic to-do app.

If you’ve been feeling nervous about making the jump to Rust, here is your Go-To Guide!

Now you can use a Holochain app through a user friendly interface

We’re Looking for Rust Devs!

Are you interested in helping us change the distributed computing and app development landscape? We are actively looking for skilled Rust developers. Check out the details about the Rust Developer Position or Apply here to join our global team!

Contribute to Documentation

There is a deep commitment on the Holochain dev team to cultivate a culture of contributions and to make it relatively easy to participate. We would like to invite developers to contribute to the documentation.

Holochain Book Links

HDK: https://holochain.github.io/rust-api/0.0.1/hdk/

Zomes: https://holochain.github.io/rust-api/0.0.1/hdk/macro.define_zome.html

Rust: https://holochain.github.io/holochain-rust/

Developer Questions?

Find answers to frequently asked questions

Connect with the developer community. We want your feedback.

Think we can improve our content ? Let us know! We’re open to content requests and suggestions — post them on our Mattermost Chat, Holochain/Tech Q&A channel.

--

--

Holochain Design
Holochain

Creating an ecosystem of decentralized applications with distributed, user-controlled storage. Cheaper, faster, better than #Blockchain @metacurrency @H_O_L_O_