Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'master' into feat/dag-api-basics
  • Loading branch information
daviddias authored Feb 1, 2017
commit 6a867b4b51d06cf9ebdb82b388367974cf1b6e2d
61 changes: 2 additions & 59 deletions src/core/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,7 @@ const debug = require('debug')

const defaultRepo = require('./default-repo')

const goOnline = require('./components/go-online')
const goOffline = require('./components/go-offline')
const isOnline = require('./components/is-online')
const load = require('./components/load')
const version = require('./components/version')
const id = require('./components/id')
const repo = require('./components/repo')
const init = require('./components/init')
const bootstrap = require('./components/bootstrap')
const config = require('./components/config')
const block = require('./components/block')
const object = require('./components/object')
const dag = require('./components/dag')
const libp2p = require('./components/libp2p')
const swarm = require('./components/swarm')
const ping = require('./components/ping')
const files = require('./components/files')
const bitswap = require('./components/bitswap')
const pubsub = require('./components/pubsub')
const components = require('./components'

class IPFS {
constructor (configOpts) {
Expand Down Expand Up @@ -70,6 +52,7 @@ class IPFS {
this.config = components.config(this)
this.block = components.block(this)
this.object = components.object(this)
this.dag = dag(this)
this.libp2p = components.libp2p(this)
this.swarm = components.swarm(this)
this.files = components.files(this)
Expand All @@ -81,46 +64,6 @@ class IPFS {
this.log('EXPERIMENTAL pubsub is enabled')
}
}

if (typeof repoInstance === 'string' ||
repoInstance === undefined) {
repoInstance = defaultRepo(repoInstance)
}

// IPFS Core Internals
this._repo = repoInstance
this._peerInfoBook = new PeerBook()
this._peerInfo = null
this._libp2pNode = null
this._bitswap = null
this._blockService = new BlockService(this._repo)
this._ipldResolver = new IPLDResolver(this._blockService)
this._pubsub = null

// IPFS Core exposed components

// for booting up a node
this.goOnline = goOnline(this)
this.goOffline = goOffline(this)
this.isOnline = isOnline(this)
this.load = load(this)
this.init = init(this)

// interface-ipfs-core defined API
this.version = version(this)
this.id = id(this)
this.repo = repo(this)
this.bootstrap = bootstrap(this)
this.config = config(this)
this.block = block(this)
this.object = object(this)
this.dag = dag(this)
this.libp2p = libp2p(this)
this.swarm = swarm(this)
this.files = files(this)
this.bitswap = bitswap(this)
this.ping = ping(this)
this.pubsub = pubsub(this)
}

module.exports = IPFS
You are viewing a condensed version of this merge commit. You can view the full changes here.