Skip to content

Instantly share code, notes, and snippets.

View dignifiedquire's full-sized avatar

Friedel Ziegelmayer dignifiedquire

View GitHub Profile
QmepsDPxWtLDuKvEoafkpJxGij4kMax11uTH7WnKqD25Dq (50)
/ip4/104.236.32.22/tcp/1032
/ip4/104.236.32.22/tcp/1037
/ip4/104.236.32.22/tcp/1041
/ip4/104.236.32.22/tcp/1046
/ip4/104.236.32.22/tcp/1048
/ip4/104.236.32.22/tcp/1051
/ip4/104.236.32.22/tcp/1067
/ip4/104.236.32.22/tcp/1072
/ip4/104.236.32.22/tcp/1073
libp2p:swarm:dial dialing QmVqkWPYn5WSgETUdviL63uR62sRT7ZKQHAohanttCgQ5C +4s
libp2p:swarm:transport dialing ws +1ms [ '/ip4/127.0.0.1/tcp/4011/ws/ipfs/QmVqkWPYn5WSgETUdviL63uR62sRT7ZKQHAohanttCgQ5C' ]
libp2p:websockets:dialer dialing ws://127.0.0.1:4011 +3ms
multistream:dialer (fl6qk2) dialer handle conn +8ms
multistream:agreement (fl6qk2) writing multicodec /multistream/1.0.0 +1ms
multistream:agreement (fl6qk2) received ack: /multistream/1.0.0 +13ms
multistream:dialer (fl6qk2) handshake success +0ms
libp2p:swarm:dial selecting crypto: /secio/1.0.0 +1ms
multistream:dialer (fl6qk2) dialer select /secio/1.0.0 +0ms
multistream:agreement (fl6qk2) writing multicodec /secio/1.0.0 +0ms
const through = reuquire('through2')
getResponse((response) => {
const mapper = through((chunk, enc, cb) => {
let parsed
try {
parsed = JSON.parse(chunk.toString())
} catch (err) {
return cb(err)

Distributing JavaScript

JS IPFS is a large collection of modules that aim to implement IPFS in Node.js and the browser. As such the distributions of these modules has a specific set of constraints.

Our current setup is not bad, and does generate bundles usable in Node.js and the browser, but there are some pain points that need work.

Current Pain Points

  1. Bundles are quite large
  2. Lots of dependencies are duplicated, for example readable-stream is included 12 times in the current js-ipfs browser bundle.

Audiences

IPFS's audiences are:

  • Developers
  • Protocol Technologists / Academics
  • "Users"
    • Service Providers
    • Content Creators
'use strict';
var Lock = require('lock');
var stream = require('stream');
var bl = require('bl');
var Block = require('ipfs-block');
var fs = require('fs')
var join = require('path').join
var mkdirp = require('mkdirp')
DEBUG=libp2p* npm run test:node
> [email protected] test:node /Users/dignifiedquire/opensource/ipfs/libp2p/js-libp2p-secio
> aegir-test --env node
(node:18498) fs: re-evaluating native module sources is not supported. If you are using the graceful-fs module, please update it to a more recent version.
[15:46:26] Starting 'test:node'...
[15:46:26] Starting 'mocha'...
class Connection extends DuplexStream {
static isConnection (conn) {
return conn && conn._stream && conn.getPeerInfo
}
constructor (stream) {
this._stream = stream
}
get stream () {
[email protected] /Users/dignifiedquire/opensource/ipfs/aegir
├── [email protected]
├─┬ [email protected]
│ ├─┬ [email protected]
│ │ └── [email protected]
│ ├─┬ [email protected]
│ │ └─┬ [email protected]
│ │ └─┬ [email protected]
│ │ └── [email protected]
│ ├── [email protected]
conn git:(master) go test
conn.go:11:2: cannot find package "github.com/ipfs/go-libp2p-loggables" in any of:
/usr/local/Cellar/go/1.6.2/libexec/src/github.com/ipfs/go-libp2p-loggables (from $GOROOT)
/Users/dignifiedquire/.go/src/github.com/ipfs/go-libp2p-loggables (from $GOPATH)
dial.go:12:2: cannot find package "github.com/ipfs/go-libp2p-transport" in any of:
/usr/local/Cellar/go/1.6.2/libexec/src/github.com/ipfs/go-libp2p-transport (from $GOROOT)
/Users/dignifiedquire/.go/src/github.com/ipfs/go-libp2p-transport (from $GOPATH)
listen.go:15:2: cannot find package "github.com/jbenet/go-temp-err-catcher" in any of:
/usr/local/Cellar/go/1.6.2/libexec/src/github.com/jbenet/go-temp-err-catcher (from $GOROOT)
/Users/dignifiedquire/.go/src/github.com/jbenet/go-temp-err-catcher (from $GOPATH)