• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

mhhf/spore: A Decentral package manager for dApp development based on ethereum a ...

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称:

mhhf/spore

开源软件地址:

https://github.com/mhhf/spore

开源编程语言:

JavaScript 99.2%

开源软件介绍:

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



鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
larsks/git-remote-ipfs发布时间:2022-06-22
下一篇:
cloudflarearchive/ipfs-ext: Validates IPFS resources served by Cloudflare&#39;s ...发布时间:2022-06-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap