spore

A Decentral package manager for dApp development based on ethereum and ipfs

86
14
JavaScript

Gitter

IMPORTANT: This is a proof of concept prototype and shouldn’t be used in production

For fast development of DApps a package management is needed.
Spore is a Proof of Concept prototype for a such package manager build on top of truffle, ethereum and ipfs.

Any form on Feedback and contribution is highly wellcome.

Installation

Make sure you have node v4+ installed:

$ node --version
v4.0.0

Install Spore:

npm i -g eth-spore

On your first run spore will guide you trough a eth-rpc and ipfs configuration.

Currently it is optimized for truffle, you may want to install truffle as well:

npm -g i truffle

For full decentral usage:

Usage

$ spore --help

Simple package management for Ethereum

Usage:
  spore init
  spore upgrade
  spore publish 
  spore add       <path>
  spore link
  
  spore info     [<package>]
  spore install  [<package>]
  spore clone     <package>
  spore uninstall <package>
  
  spore remote list
  spore remote select <name>
  spore remote add    <name>
  spore remote remove <name>
  
  spore update
  spore search <string>
  
  spore instance add <package> <address> [--contract <contract>]
  spore instance list <package>
  
Arguments:
  <package>                    Package name or hash
  <path>                       path to file/ directory
  <name>                       rpc settings name
  
Options:
  -v, --version                Shows the version of spore
  -h, --help                   Shows this help screen
  --verbose                    Shows interlal logs


GUI

http://spore.memhub.io


(Decentral version on IPFS will follow shortly)

Workflow

Create a new project:

mkdir mypackage 
cd mypackage
truffle init
spore init

this will create a spore.json in your root project directory:

{
  "name": "mypackage",
  "version": "0.1.0",
  "description": "description",
  "dependencies": {},
  "contracts": [],
  "ignore": [],
  "files": [],
  "tags": []
}

install a dependency:

spore install mortal

import dependency to your contract: contracts/mcontract.sol

import "mortal";

contract mycontract is mortal {
...

link the dependencies:

spore link

add some files:

spore add contracts/mycontract.sol
spore add readme.md

publish the package:

spore publish

Now you can install the package mypackage along with it’s dependencies in another project via:

spore install mypackage

Beginner Turorial

How to write a coin tutorial with truffle and spore

API documentation

Read the Full API Documentation here.

Development - Installation

This will guide you trough a local development installation. The contract is not deployed on a global chain, yet.

Make sure you have node v4+ installed:

$ node --version
v4.0.0

Make sure you have solidity installed:

$ solc --version
solc, the solidity compiler commandline interface
Version: 0.1.1-ed7a8a35/Release-Darwin/clang/JIT

Install eth-testrpc for testing/ dev purposes.
pip install eth-testrpc

Install truffle.
npm install -g truffle

Install ipfs.

clone this repo:
git clone https://github.com/mhhf/spore.git

install:

cd spore
npm install
npm link

Run your rpc client( In this case testrpc testrpc )

Deploy the spore ethereum contract with: truffle deploy

Test

Run a local chain:
testrpc

Deploy the contract:
truffle deploy

Run the test:
mocha test

How it works

This Ethereum contract has a name => ipfs-hash mapping and some functionallity to access and manipulate it.

The ipfs-hash is pointing to a package-header which specified by this json schema.
An example header for spore is:

{
  "name": "spore",
  "version": "0.1.0",
  "description": "Simple package manager for dapp development.",
  "dependencies": {},
  "contracts": [
    "Spore"
  ],
  "ignore": [],
  "files": [
    "contracts/Spore.sol"
  ],
  "tags": [
    "spore",
    "package manager"
  ]
}

The dependencies property contains packages with their ipfs header file.
The root property points to a ipfs directory node which contains the package files.

Next steps

  • filling spore with content
  • integrate a light-wallet into it, so that the user don’t need to run a full node to publish packages.
  • extend it to other dev-tools and testing-frameworks like populus or embark
  • add a ( decentral ) plugin system with pre publish and post publish hooks. Use cases could be:
    • different proposals (pull request) for one package
    • ownership based change voting
    • oracle filter which only allows a new version of a package, if all tests succeeded