Giter Club home page Giter Club logo

holochain-rust's Introduction

Holochain-rust

holochain logo

Project Chat

Twitter Follow

Travis: Build Status Circle CI: CircleCI Codecov: Codecov License: License: GPL v3

This code is loosely based on the previous Golang prototype.

Code Status: This Rust version is alpha software -- not for production use. You should expect unstable code APIs and data chains.

NO LONGER CURRENT REPOSITORY: This version of Holochain has been replaced by a version that is more performant, stable, and secure. We suggest porting applications to the new version of Holochain which is receiving regular updates and feature enhancements.

Find releases here.

Holochain Links: FAQ Developer Docs White Paper

Overview

Holochain-Rust Architectural Overview

Application Developer

Setup a development environment with the latest release to build Holochain applications:

https://developer.holochain.org/start.html

Core Developer

Setup a core development environment to work on Holochain itself:

Core Developer Setup

Documentation

API Reference

Auto generated documentation for all of the code written in Rust is published online, with different versions to match the releases here: https://developer.holochain.org/docs/api.

The Holochain Guidebook

There is a guide for understanding and developing with Holochain. It is published online, with different versions to match the releases here: https://developer.holochain.org/guide.

See instructions for how to contribute to the book at doc/holochain_101/src/how_to_contribute.md.

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, as well as specific expectations around things like code formatting, testing practices, continuous integration, etc.

Some helpful links:

License

License: GPL v3

Copyright (C) 2017 - 2020, Holochain Foundation

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.

holochain-rust's People

Contributors

chrisminnick avatar connoropolous avatar ddd-mtl avatar dellams avatar duffybelfield avatar dymayday avatar emalinus avatar freesig avatar jamesray1 avatar jdeepee avatar jhonatanhern avatar jonathan-s avatar jryanhaber avatar julioholon avatar lucksus avatar lukateras avatar maackle avatar murrayjbrown avatar neonphog avatar pdaoust avatar philipbeadle avatar pjkundert avatar sphinxc0re avatar staticallytypedanxiety avatar struktured avatar thedavidmeister avatar timotree3 avatar willemolding avatar zippy avatar zo-el avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

holochain-rust's Issues

add code coverage into CI

As a Holochain Core team we need to know how much of our code has tests written for it.

In the go implementation we had a code coverage that ran to check our testing. We need to:

  • find a fust code coverage tool for our CI
  • add it to travis
  • decide on code coverage % targets

add type to headers in source chain

in the go version all headers had a type and there were helper fns like TopType that gave types first class support

i think we can add the type, but get away without forcing TopType into the source chain trait

errors in `arm64v8/ubuntu` docker

W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-updates/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-backports/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Failed to fetch http://ports.ubuntu.com/ubuntu-ports/dists/bionic-security/InRelease  Temporary failure resolving 'ports.ubuntu.com'
W: Some index files failed to download. They have been ignored, or old ones used instead.
Reading package lists...

create web access to api docs

child of #117

As an container developer and as a core developer, I want web access to rust library documentation, so as to be able to understand and navigate the codebase easily.

cargo doc builds all the docs and puts them into the target directory which is (rightfully) ignored in .gitignore

  • setup github pages on this repo (or other solution) to serve the api docs.
  • create a build script for release (maybe in travis) that deploys the docs build

get `cargo build` working in alpine docker

current errors:

error: linking with `cc` failed: exit code: 1
  |
  = note: "cc" "-Wl,--as-needed" "-Wl,-z,noexecstack" "-m64" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build0.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build1.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build10.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build11.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build12.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build13.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build14.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build15.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build2.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build3.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build4.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build5.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build6.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build7.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build8.rcgu.o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.build_script_build9.rcgu.o" "-o" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd" "/root/holochain/target/debug/build/num-integer-ee7fbdeb912bb4dd/build_script_build-ee7fbdeb912bb4dd.crate.allocator.rcgu.o" "-Wl,--gc-sections" "-pie" "-Wl,-z,relro,-z,now" "-nodefaultlibs" "-L" "/root/holochain/target/debug/deps" "-L" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,--start-group" "-Wl,-Bstatic" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-68ef171a75dfd5dc.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-4a380244b10d6a5c.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-cd20fbe618e0ef78.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-6b45cc0c1f58bda3.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_system-72362966f5e95133.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-7e3cdca8cafd62fc.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-00d127618b8240f9.rlib" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-6ac02a98cd149424.rlib" "-Wl,--end-group" "/root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-2743c400e5187c22.rlib" "-Wl,-Bdynamic" "-l" "dl" "-l" "rt" "-l" "pthread" "-l" "pthread" "-l" "gcc_s" "-l" "c" "-l" "m" "-l" "rt" "-l" "pthread" "-l" "util" "-l" "util"
  = note: /root/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc_jemalloc-cd20fbe618e0ef78.rlib(ctl.pic.o): In function `ctl_lookup':
          /checkout/src/liballoc_jemalloc/../jemalloc/src/ctl.c:909: undefined reference to `__rawmemchr'
          /checkout/src/liballoc_jemalloc/../jemalloc/src/ctl.c:832: undefined reference to `__rawmemchr'
          collect2: error: ld returned 1 exit status
          

error: aborting due to previous error

error: Could not compile `num-integer`.

add malloc to wasm

Currently the returned serialized parameter from a function call overwrites the input parameters (which is probably ok), but if the return value were longer than one page of memory this would be a problem.

  • add malloc so we can increase page size
  • use malloc in the serialization of the output params

merge all hash references into a single header property

discussed with @zippy this morning

we currently have three hash references in the header:

  • previous header
  • entry for this header
  • previous header with the same type

and entries do their own hash referencing, e.g. with links

would it make sense to have a single property in the header links or refs that covers all of this?

Handle partial Init edge cases

child of #86
Handling error cases where not all of the Zomes have done their genesis() for some reason and we would want to call a second InitApplication Action to complete the Init and do genesis() only on the remaining Zomes.

port all chain.go functionality and tests

Checklist

A checklist to keep track of the chain.go basic port to the source_chain module:

  • a concept of a "chain" of headers and entries
    • implemented as source_chain::Pair
  • chains can be saved/loaded from the file system #231
  • headers and entries use the correct hashing algo #20
  • headers and entries reference each other by hash
    • implemented as common::entry::Entry and common::entry::Header
  • helper fn top to get top header (most recently added)
  • helper fn nth to get nth most recently added header
  • helper fn TopType to get most recently added header of given type
  • ability to provide an entry + key and have it appended with correct headers + signatures
  • helper fn get to lookup header by hash: #30
  • helper fn getEntry to lookup entry by entry hash: #30
  • helper fn getEntryHeader to lookup header by entry hash: #30
    • this should be merged with getEntry if all lookups return pairs
  • ability to serialize/deserialize a chain: #61
  • ability to "dump" a chain to a string
  • ability to walk a chain from most recent to least recent
    • implemented move and ref for loop as chain.iter(), (&chain).into_iter() and chain.into_iter()
  • ability to validate a chain: #31
  • ability to JSON stringify a chain #61
  • ability to graphvis a chain
  • helper fn Length to get the number of entries in a chain
  • helper fn BundleStarted to get the start index of the active bundle
  • ability to start/close bundles

Diff

summary of major differences planned/implemented between the go/rust versions:

  • multiple implementations of the source chain trait, so memory/file/db chains can all be independently maintained
  • dump/JSON/graphvis functionality will all come under the serialize/deserialize banner
  • rust chains:
    • append entries (internally generating headers/pairs)
    • return pairs
    • perform direct lookups by hash
    • prefer composable iteration methods/traits over ad-hoc DSL (e.g.filter vs. TopType ๐Ÿ˜ฌ )
    • leverage immutability much more

Ongoing

things that will likely come up again in the future, that are not solved in the go version currently.

  • source chains that support concurrency

implement Iterator for source chain, not just IntoIter

current memory source chain implementation only supports moving into_iter() not iter() or references so we can't currently iterate by reference - which means lots of inefficient cloning of the source chain to get anything done

helpers to map some sequence of content to pairs

source chain tests could be much neater with a little destructuring:

        let p1 = test_pair(None, "foo");
        let p2 = test_pair(Some(&p1), "bar");
        let p3 = test_pair(Some(&p2), "baz");

could be more like:

    let (p1, p2, p3) = test_pairs(["foo", "bar", "baz"]);

solve the logging problem

As Holochain core dev, I want to be able to log from different parts of the application and enable them variably.

  • decide on standards for using log crate target variable for different contexts
  • implement a complex logger that can handle a complex target for multi-coloring for the use case of hcdev using that standard

address redux state model bloat

In the current implementation of #71 each function call results in two additions to the state via the actions: ExecuteZomeFunction(FunctionCall),
ReturnZomeFunctionResult(FunctionResult),

this means the state object will grow in size for each function call, which means that eventually it has to get cleaned up or garbage collected.

Also there's discussion of the history in the state in PR #37 that would affect this.

clippy problem in travis

There are some kinds of weirdnesses with clippy in travis. The first time it ran on the a branch it complained with an error like no such subcommand: clippy This was fixed by adding

- cargo +nightly install clippy

Into the install section of the .travis.yml file. But then on next push it would fail the travis run with this error:

cargo +nightly install clippy
    Updating registry `https://github.com/rust-lang/crates.io-index`
  Installing clippy v0.0.209
error: binary `cargo-clippy` already exists in destination as part of `clippy v0.0.209`
binary `clippy-driver` already exists in destination as part of `clippy v0.0.209`

Furthermore clippy was being too conservative and requiring Boxing an Enum that we don't want to box right now, so I didn't want it to fail the tests just because of that.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.