Skip to content

Commit

Permalink
chore: Rename to dag-service (#381)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gozala authored Aug 12, 2020
1 parent 51af593 commit cdb99b5
Show file tree
Hide file tree
Showing 7 changed files with 93 additions and 192 deletions.
77 changes: 2 additions & 75 deletions CODE-OF-CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,76 +1,3 @@
# Contributor Covenant Code of Conduct
# Contributor Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

- The use of sexualized language or imagery and unwelcome sexual attention or
advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic
address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [INSERT EMAIL ADDRESS]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org

For answers to common questions about this code of conduct, see
https://www.contributor-covenant.org/faq
The `js-dag-service` project follows the [`IPFS Community Code of Conduct`](https://github.com/ipfs/community/blob/master/code-of-conduct.md)
32 changes: 8 additions & 24 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,24 +1,8 @@
Copyright (c) 2019-2020 Textile <contact@textile.io>

Copyright (c) 2015-2019 IPFS, 2014 Juan Batiz-Benet
Copyright (c) 2019 Hector Sanjuan (Apache License 2.0)

MIT License

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This project is transitioning from an MIT-only license to a dual MIT/Apache-2.0 license.
Unless otherwise noted, all code contributed prior to 2020-08-12 and not contributed by
a user listed in [this signoff issue](https://github.com/ipfs/js-dag-service/issues/382) is
licensed under MIT-only. All new contributions (and past contributions since 2020-08-12)
are licensed under a dual MIT/Apache-2.0 license.

MIT: https://www.opensource.org/licenses/mit
Apache-2.0: https://www.apache.org/licenses/license-2.0
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
133 changes: 49 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,23 @@
# IPFS Lite _(js-ipfs-lite)_

[![Made by Textile](https://img.shields.io/badge/made%20by-Textile-informational.svg?style=flat-square)](https://textile.io)
[![Chat on Slack](https://img.shields.io/badge/slack-slack.textile.io-informational.svg?style=flat-square)](https://slack.textile.io)
[![GitHub license](https://img.shields.io/github/license/textileio/js-ipfs-lite.svg?style=flat-square)](./LICENSE)
[![GitHub package.json version](https://img.shields.io/github/package-json/v/textileio/js-ipfs-lite.svg?style=popout-square)](./package.json)
[![npm (scoped)](https://img.shields.io/npm/v/@textile/ipfs-lite.svg?style=popout-square)](https://www.npmjs.com/package/@textile/ipfs-lite)
[![Release](https://img.shields.io/github/release/textileio/js-ipfs-lite.svg?style=flat-square)](https://github.com/textileio/js-ipfs-lite/releases/latest)
[![docs](https://img.shields.io/badge/docs-master-success.svg?style=popout-square)](https://textileio.github.io/js-ipfs-lite/)
# DAGService

[![Chat on IRC](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs)
[![Chat on Matrix](https://img.shields.io/badge/matrix-%23ipfs%3Amatrix.org-blue.svg?style=popout-square)](https://riot.im/app/#/room/#ipfs-dev:matrix.org)
[![GitHub license](https://img.shields.io/github/license/ipfs/js-dag-service.svg?style=flat-square)](./LICENSE)
[![GitHub package.json version](https://img.shields.io/github/package-json/v/ipfs/js-dag-service.svg?style=popout-square)](./package.json)
[![npm (scoped)](https://img.shields.io/npm/v/dag-service.svg?style=popout-square)](https://www.npmjs.com/package/dag-service)
[![Release](https://img.shields.io/github/release/textileio/js-ipfs-lite.svg?style=flat-square)](https://github.com/ipfs/js-dag-service/releases/latest)
[![docs](https://img.shields.io/badge/docs-master-success.svg?style=popout-square)](https://ipfs.github.io/js-dag-service/)
[![standard-readme compliant](https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square)](https://github.com/RichardLitt/standard-readme)

> A lightweight, extensible IPFS peer for Nodejs and the browser.
> DAGService is a library for storing and replicating hash-linked
> data over the IPFS network.
IPFS Lite runs the minimal setup required to get and put data on the IPFS network.
DAGService is aiming to be a bare minimum needed for [IPLD][]-based applications
to interact with the IPFS network by getting and putting blocks to it.

**NOTE** For now, this is a highly experimental library. Use with caution. Ask for help on https://slack.textile.io. We are hoping to dedicate additional development time soon, but cannot guarantee support at this time.
**NOTE** For now, this is a highly experimental library. Use with caution.

> This project was originally developed under the [@textileio](https://github.com/textileio/) organization, and was contributed to the IPFS community for ongoing maintenance and development.
## Table of Contents

Expand All @@ -27,114 +31,75 @@ IPFS Lite runs the minimal setup required to get and put data on the IPFS networ

## Background

The goal of IPFS Lite is to run the bare minimal functionality for any application to interact with the IPFS network (by getting and putting IPLD blocks). This saves having to deal with the complexities of using a full IPFS peer, while maintaining the ability to share the underlying libp2p host and DAG service with other components. It is also extremely lightweight, highly extensible, and easy to work with in both Nodejs and the browser. It supports async/await by default, and the library comes with additional tools to help bootstrap a default IPFS Lite instance with minimal configuration. It is a port of the [Go IPFS Lite](https://github.com/hsanjuan/ipfs-lite) library, and as such, has most of the same requirements.

### IPFS-lite Libraries

> The following includes information about support for ipfs-lite.
| Name | Build | Target | Description |
|:---------|:---------|:---------|:---------|
| [`ipfs-lite`](https://github.com/hsanjuan/ipfs-lite) | [![Build Status](https://img.shields.io/travis/hsanjuan/ipfs-lite.svg?branch=master&style=flat-square)](https://travis-ci.org/hsanjuan/ipfs-lite) | [![golang](https://img.shields.io/badge/golang-blueviolet.svg?style=popout-square)](https://github.com/hsanjuan/ipfs-lite) | The reference implementation of ipfs-lite, written in Go. |
| [`js-ipfs-lite`](//github.com/textileio/js-ipfs-lite) | [![Build status](https://img.shields.io/github/workflow/status/textileio/js-ipfs-lite/Test/master.svg?style=popout-square)](https://github.com/textileio/js-ipfs-lite/actions?query=branch%3Amaster) | [![nodejs](https://img.shields.io/badge/nodejs-blueviolet.svg?style=popout-square)](https://github.com/textileio/js-ipfs-lite) [![web](https://img.shields.io/badge/web-blueviolet.svg?style=popout-square)](https://github.com/textileio/js-ipfs-lite) [![react-native](https://img.shields.io/badge/react--native-blueviolet.svg?style=popout-square)](https://github.com/textileio/js-ipfs-lite) | The Javascript version of ipfs-lite available for web and nodejs. |
The goal of DAGService to provied a minimal layer between data model of [IPLD][]
and full blown [IPFS][]. It provides bare minimum functionality for any
application to interact with the IPFS network (by getting and putting [IPLD][]
blocks) without having to deal with the complexities of operating a full
IPFS node. It is an attempt to remake core piece of IPFS node reusable on it's
own.

### Why?

Because 99% of the time, a browser or mobile (d)App only needs to be able to add and get small bits of data over the IPFS network. This library provides that, in a much smaller package (currently less than 1/2 the size of `js-ipfs` without much optimization -- we will continue to optimize further). It is also highly extensible, so developers need only include the features they _need_, keeping load times fast, and (d)Apps feeling snappy. Additionally, Textile needed a Typescript-based IPFS solution, and we think others will find the type safety useful as well. Feel free to use the [Typescript declarations](https://github.com/textileio/js-ipfs-lite/tree/master/src/@types) in your own projects.

### What?

Our goal is to provide a highly extensible IPFS "implementation" that supports and small subset of the core IPFS APIs. If you have opinions about what should and should not be included, please [let us know](https://github.com/textileio/js-ipfs-lite/issues).

## Install

> Note: `js-ipfs-lite` includes TypeScript type definitions.
```
npm i @textile/ipfs-lite
npm install dag-service
```

### Browser

For now, you'll have to bundle your own browser builds, but default builds are coming soon!

## Usage

Only import what you need, keeping your bundles small and your load times faster. You can grab a full-featured IPFS Lite peer from the top-level library, or grab specific sub-modules as needed:

```typescript
// Grab a fully-loaded Peer
import { Peer, BlockStore } from '@textile/ipfs-lite'
import { setupLibP2PHost, MemoryDatastore } = from '@textile/ipfs-lite/dist/setup'
```

### Typescript

```typescript
import { Peer, BlockStore } from '@textile/ipfs-lite'
import { Peer, BlockStore } from "dag-service"
// Use any interface-datastore compliant store
import { MemoryDatastore } from 'interface-datastore'
import Libp2p from 'libp2p'
import { MemoryDatastore } from "interface-datastore"
import Libp2p from "libp2p"

const store = new BlockStore(new MemoryDatastore())

;(async function() {
// Bring your own libp2p host....
const host = new Libp2p({ ...libp2Options })
// ...or, use a full-featured default host
// const host = await setupLibP2PHost()
const lite = new Peer(store, host)

await lite.start()

const cid = 'QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u'
const data = await lite.getFile(cid)
console.log(data.toString())
// Hello World
await lite.stop()
}
```
### Nodejs
const main = async () => {
// Bring your own libp2p host....
const host = new Libp2p({ ...libp2Options })
const lite = new Peer(store, host)

```javascript
let { Peer, BlockStore } = require('@textile/ipfs-lite')
let { setupLibP2PHost } = require('@textile/ipfs-lite/dist/setup')
let { MemoryDatastore } = require('interface-datastore')

let store = new BlockStore(new MemoryDatastore())

;(async function() {
let host = await setupLibP2PHost()
let lite = new Peer(store, host)
await lite.start()

let cid = 'QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u'
let data = await lite.getFile(cid)
const cid = "QmWATWQ7fVPP2EFGu71UkfnqhYXDYH566qy47CnJDgvs8u"
const data = await lite.getFile(cid)
console.log(data.toString())
// Hello World
await lite.stop()
})()
}
```

There are also several useful examples included in the tests of this repo, with tools for creating a default `libp2p` host exported by default. We've also thrown in some useful interfaces to use when building on IPFS Lite, as well as the Buffer API for use in the browser.

## API

See [https://textileio.github.io/js-ipfs-lite](https://textileio.github.io/js-ipfs-lite)
See [https://ipfs.github.io/js-dag-service/](https://ipfs.github.io/js-dag-service/)

## Maintainers

[Carson Farmer](https://github.com/carsonfarmer)
- [Irakli Gozalishvili](https://github.com/gozala/)
- [Carson Farmer](https://github.com/carsonfarmer)

## Contributing
## Contribute

See [our code of conduct](CODE-OF-CONDUCT.md)!
Feel free to dive in! [Open an issue](https://github.com/ipfs/js-dag-service/issues/new) or submit PRs.

PRs accepted.
To contribute to IPFS in general, see the [contributing guide](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md).

Small note: If editing the README, please conform to the [standard-readme](https://github.com/RichardLitt/standard-readme) specification.
[![](https://cdn.rawgit.com/jbenet/contribute-ipfs-gif/master/img/contribute.gif)](https://github.com/ipfs/community/blob/master/CONTRIBUTING.md)

Project follows the [IPFS Community Code of Conduct](https://github.com/ipfs/community/blob/master/code-of-conduct.md)

## License

[MIT](LICENSE) (c) 2019-2020 Textile
The js-dag-service project is dual-licensed under Apache 2.0 and MIT terms:

- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)
- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)

[ipld]: https://ipld.io/
[ipfs]: https://ipfs.io/
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@textile/ipfs-lite",
"version": "0.1.5",
"description": "A lightweight minimal IPFS peer for typescript/javascript.",
"name": "dag-service",
"version": "0.0.0-dev",
"description": "Library for storing and replicating hash-linked data over IPFS network",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"browser": {
Expand All @@ -21,22 +21,23 @@
},
"repository": {
"type": "git",
"url": "git+https://github.com/textileio/js-ipfs-lite.git"
"url": "git+https://github.com/ipfs/js-dag-service.git"
},
"keywords": [
"ipfs",
"lite",
"ipld",
"dag-service",
"dag",
"typescript",
"browser",
"node"
],
"author": "Carson Farmer <carson@textile.io>",
"license": "MIT",
"license": "(Apache-2.0 AND MIT)",
"bugs": {
"url": "https://github.com/textileio/js-ipfs-lite/issues"
"url": "https://github.com/ipfs/js-dag-service/issues"
},
"homepage": "https://github.com/textileio/js-ipfs-lite#readme",
"homepage": "https://github.com/ipfs/js-dag-service#readme",
"devDependencies": {
"@types/browser-or-node": "^1.2.0",
"@types/chai": "^4.2.12",
Expand Down

0 comments on commit cdb99b5

Please sign in to comment.