Skip to content
This repository was archived by the owner on Aug 11, 2021. It is now read-only.

Commit f4ae96d

Browse files
Initial commit
0 parents  commit f4ae96d

File tree

51 files changed

+779
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+779
-0
lines changed

.gitignore

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
tests/repo-just-for-test*
2+
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
13+
# Directory for instrumented libs generated by jscoverage/JSCover
14+
lib-cov
15+
16+
# Coverage directory used by tools like istanbul
17+
coverage
18+
19+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
20+
.grunt
21+
22+
# node-waf configuration
23+
.lock-wscript
24+
25+
# Compiled binary addons (http://nodejs.org/api/addons.html)
26+
build/Release
27+
28+
# Dependency directory
29+
node_modules
30+
31+
# Optional npm cache directory
32+
.npm
33+
34+
# Optional REPL history
35+
.node_repl_history
36+
37+
lib
38+
dist

.npmignore

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
tests/repo-just-for-test*
2+
3+
# Logs
4+
logs
5+
*.log
6+
npm-debug.log*
7+
8+
# Runtime data
9+
pids
10+
*.pid
11+
*.seed
12+
13+
# Directory for instrumented libs generated by jscoverage/JSCover
14+
lib-cov
15+
16+
# Coverage directory used by tools like istanbul
17+
coverage
18+
19+
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
20+
.grunt
21+
22+
# node-waf configuration
23+
.lock-wscript
24+
25+
# Compiled binary addons (http://nodejs.org/api/addons.html)
26+
build/Release
27+
28+
# Dependency directory
29+
node_modules
30+
31+
# Optional npm cache directory
32+
.npm
33+
34+
# Optional REPL history
35+
.node_repl_history

.travis.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: node_js
2+
node_js:
3+
- '4'
4+
- '5'
5+
- stable
6+
7+
addons:
8+
firefox: 'latest'
9+
10+
before_script:
11+
- npm install -g npm
12+
- export DISPLAY=:99.0
13+
- sh -e /etc/init.d/xvfb start
14+
15+
script:
16+
- npm run lint
17+
- npm run test

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 IPFS
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# IPFS IPLD
2+
3+
[![](https://img.shields.io/badge/made%20by-Protocol%20Labs-blue.svg?style=flat-square)](http://ipn.io) [![](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](http://ipfs.io/) [![](https://img.shields.io/badge/freenode-%23ipfs-blue.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23ipfs) [![Dependency Status](https://david-dm.org/ipfs/js-ipfs-ipld.svg?style=flat-square)](https://david-dm.org/ipfs/js-ipfs-ipld)
4+
[![Travis CI](https://travis-ci.org/ipfs/js-ipfs-ipld.svg?branch=master)](https://travis-ci.org/ipfs/js-ipfs-ipld)

package.json

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
{
2+
"name": "js-ipfs-ipld",
3+
"version": "1.0.0",
4+
"description": "",
5+
"main": "lib/index.js",
6+
"jsnext:main": "src/index.js",
7+
"pre-commit": [
8+
"lint",
9+
"test"
10+
],
11+
"scripts": {
12+
"lint": "dignified-lint",
13+
"build": "dignified-build",
14+
"test": "dignified-test",
15+
"test:node": "dignified-test node",
16+
"test:browser": "dignified-test browser",
17+
"release": "dignified-release",
18+
"coverage": "dignified-coverage"
19+
},
20+
"keywords": [
21+
"IPFS"
22+
],
23+
"author": "Friedel Ziegelmayer dignifiedquire<@gmail.com>",
24+
"repository": {
25+
"type": "git",
26+
"url": "git+https://github.com/ipfs/js-ipfs-ipld.git"
27+
},
28+
"bugs": {
29+
"url": "https://github.com/ipfs/js-ipfs-ipld/issues"
30+
},
31+
"homepage": "https://github.com/ipfs/js-ipfs-ipld#readme",
32+
"license": "MIT",
33+
"devDependencies": {
34+
"chai": "^3.5.0",
35+
"dignified.js": "^1.0.0",
36+
"ipfs-repo": "^0.5.3",
37+
"ncp": "^2.0.0",
38+
"pre-commit": "^1.1.2",
39+
"rimraf": "^2.5.2"
40+
},
41+
"dependencies": {
42+
"ipfs-blocks": "^0.1.0"
43+
}
44+
}

src/.#ipld-service.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dignifiedquire@Friedels-MacBook-Air.local.4224

src/index.js

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
'use strict'
2+
3+
exports.IPLDService = require('./ipld-service')

src/ipld-service.js

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
'use strict'
2+
3+
const isIPFS = require('is-ipfs')
4+
5+
class IPLDService {
6+
constructor (blockService) {
7+
if (!blockService) {
8+
throw new Error('IPLDService requires a BlockService instance')
9+
}
10+
11+
this.bs = blockService
12+
}
13+
14+
add (node, cb) {
15+
}
16+
17+
get (multihash, cb) {
18+
}
19+
20+
getRecursive (multihash, cb) {
21+
}
22+
23+
remove (multihash, cb) {
24+
if (!multihash || !isIPFS.multihash(multihash)) {
25+
return cb(new Error('Invalid multihash'))
26+
}
27+
28+
this.bs.deleteBlock(multihash, cb)
29+
}
30+
}
31+
32+
module.exports = IPLDService
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
2+
��Hello and Welcome to IPFS!
3+
4+
██╗██████╗ ███████╗███████╗
5+
██║██╔══██╗██╔════╝██╔════╝
6+
██║██████╔╝█████╗ ███████╗
7+
██║██╔═══╝ ██╔══╝ ╚════██║
8+
██║██║ ██║ ███████║
9+
╚═╝╚═╝ ╚═╝ ╚══════╝
10+
11+
If you're seeing this, you have successfully installed
12+
IPFS and are now interfacing with the ipfs merkledag!
13+
14+
-------------------------------------------------------
15+
| Warning: |
16+
| This is alpha software. Use at your own discretion! |
17+
| Much is missing or lacking polish. There are bugs. |
18+
| Not yet secure. Read the security notes for more. |
19+
-------------------------------------------------------
20+
21+
Check out some of the other files in this directory:
22+
23+
./about
24+
./help
25+
./quick-start <-- usage examples
26+
./readme <-- this file
27+
./security-notes
28+
�
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
5
2+
" ���׾F�_�uؔ�l��z�S?��|ڲ��Pc@ js-ipfs-repo�
3+
4+

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
2+
ys# js-ipfs-repo
3+
Implementation of the IPFS repo spec (https://github.com/ipfs/specs/tree/master/repo) in JavaScript
4+
s
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
�� IPFS Alpha Security Notes
3+
4+
We try hard to ensure our system is safe and robust, but all software
5+
has bugs, especially new software. This distribution is meant to be an
6+
alpha preview, don't use it for anything mission critical.
7+
8+
Please note the following:
9+
10+
- This is alpha software and has not been audited. It is our goal
11+
to conduct a proper security audit once we close in on a 1.0 release.
12+
13+
- ipfs is a networked program, and may have serious undiscovered
14+
vulnerabilities. It is written in Go, and we do not execute any
15+
user provided data. But please point any problems out to us in a
16+
github issue, or email [email protected] privately.
17+
18+
- ipfs uses encryption for all communication, but it's NOT PROVEN SECURE
19+
YET! It may be totally broken. For now, the code is included to make
20+
sure we benchmark our operations with encryption in mind. In the future,
21+
there will be an "unsafe" mode for high performance intranet apps.
22+
If this is a blocking feature for you, please contact us.
23+
�
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
2+


test/example-repo/blocks/122062ce/122062ce1f2c91a13a97b596e873b5a3346a644605d7614dca53cd3a59f7385a8abb.data

+114
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
2+
��# 0.1 - Quick Start
3+
4+
This is a set of short examples with minimal explanation. It is meant as
5+
a "quick start". Soon, we'll write a longer tour :-)
6+
7+
8+
Add a file to ipfs:
9+
10+
echo "hello world" >hello
11+
ipfs add hello
12+
13+
14+
View it:
15+
16+
ipfs cat <the-hash-you-got-here>
17+
18+
19+
Try a directory:
20+
21+
mkdir foo
22+
mkdir foo/bar
23+
echo "baz" > foo/baz
24+
echo "baz" > foo/bar/baz
25+
ipfs add -r foo
26+
27+
28+
View things:
29+
30+
ipfs ls <the-hash-here>
31+
ipfs ls <the-hash-here>/bar
32+
ipfs cat <the-hash-here>/baz
33+
ipfs cat <the-hash-here>/bar/baz
34+
ipfs cat <the-hash-here>/bar
35+
ipfs ls <the-hash-here>/baz
36+
37+
38+
References:
39+
40+
ipfs refs <the-hash-here>
41+
ipfs refs -r <the-hash-here>
42+
ipfs refs --help
43+
44+
45+
Get:
46+
47+
ipfs get <the-hash-here> foo2
48+
diff foo foo2
49+
50+
51+
Objects:
52+
53+
ipfs object get <the-hash-here>
54+
ipfs object get <the-hash-here>/foo2
55+
ipfs object --help
56+
57+
58+
Pin + GC:
59+
60+
ipfs pin -r <the-hash-here>
61+
ipfs gc
62+
ipfs ls <the-hash-here>
63+
ipfs unpin -r <the-hash-here>
64+
ipfs gc
65+
66+
67+
Daemon:
68+
69+
ipfs daemon (in another terminal)
70+
ipfs id
71+
72+
73+
Network:
74+
75+
(must be online)
76+
ipfs swarm peers
77+
ipfs id
78+
ipfs cat <hash-of-remote-object>
79+
80+
81+
Mount:
82+
83+
(warning: fuse is finicky!)
84+
ipfs mount
85+
cd /ipfs/<
86+
87+
88+
Tool:
89+
90+
ipfs version
91+
ipfs update
92+
ipfs commands
93+
ipfs config --help
94+
open http://localhost:5001/webui
95+
96+
97+
Browse:
98+
99+
webui:
100+
101+
http://localhost:5001/webui
102+
103+
video:
104+
105+
http://localhost:8080/ipfs/QmVc6zuAneKJzicnJpfrqCH9gSy6bz54JhcypfJYhGUFQu/play#/ipfs/QmTKZgRNwDNZwHtJSjCp6r5FYefzpULfy37JvMt9DwvXse
106+
107+
images:
108+
109+
http://localhost:8080/ipfs/QmZpc3HvfjEXvLWGQPWbHk3AjD5j8NEN4gmFN8Jmrd5g83/cs
110+
111+
markdown renderer app:
112+
113+
http://localhost:8080/ipfs/QmX7M9CiYXjVeFnkfVGf3y5ixTZ2ACeSGyL1vBJY1HvQPp/mdown
114+
�
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
4
2+
" Y��9_)a���˹2�R�m�Ŗke�9�� js-ipfs-repo
3+


0 commit comments

Comments
 (0)