Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
dms3
go-unixfs
Commits
7cebb33e
Commit
7cebb33e
authored
Jan 10, 2015
by
Brian Tiger Chow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: remove dead code
parent
5c46597c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
68 deletions
+2
-68
test/epictest/core.go
test/epictest/core.go
+2
-68
No files found.
test/epictest/core.go
View file @
7cebb33e
...
...
@@ -8,7 +8,6 @@ import (
blockstore
"github.com/jbenet/go-ipfs/blocks/blockstore"
blockservice
"github.com/jbenet/go-ipfs/blockservice"
core
"github.com/jbenet/go-ipfs/core"
exchange
"github.com/jbenet/go-ipfs/exchange"
bitswap
"github.com/jbenet/go-ipfs/exchange/bitswap"
bsnet
"github.com/jbenet/go-ipfs/exchange/bitswap/network"
merkledag
"github.com/jbenet/go-ipfs/merkledag"
...
...
@@ -23,74 +22,9 @@ import (
var
log
=
eventlog
.
Logger
(
"epictest"
)
// TODO merge with core.IpfsNode
type
Core
struct
{
*
core
.
IpfsNode
}
func
(
c
*
Core
)
ID
()
peer
.
ID
{
return
c
.
IpfsNode
.
Identity
}
func
(
c
*
Core
)
Bootstrap
(
ctx
context
.
Context
,
p
peer
.
PeerInfo
)
error
{
return
c
.
IpfsNode
.
Bootstrap
(
ctx
,
[]
peer
.
PeerInfo
{
p
})
}
func
makeCore
(
ctx
context
.
Context
,
rf
RepoFactory
)
(
*
Core
,
error
)
{
node
,
err
:=
rf
(
ctx
)
if
err
!=
nil
{
return
nil
,
err
}
// to make sure nothing is omitted, init each individual field and assign
// all at once at the bottom.
return
&
Core
{
IpfsNode
:
node
,
},
nil
}
type
RepoFactory
func
(
ctx
context
.
Context
)
(
*
core
.
IpfsNode
,
error
)
type
Repo
interface
{
ID
()
peer
.
ID
Blockstore
()
blockstore
.
Blockstore
Exchange
()
exchange
.
Interface
Bootstrap
(
ctx
context
.
Context
,
peer
peer
.
ID
)
error
}
type
repo
struct
{
// DHT, Exchange, Network,Datastore
bitSwapNetwork
bsnet
.
BitSwapNetwork
blockstore
blockstore
.
Blockstore
exchange
exchange
.
Interface
datastore
datastore
.
ThreadSafeDatastore
host
host
.
Host
dht
*
dht
.
IpfsDHT
id
peer
.
ID
}
func
(
r
*
repo
)
ID
()
peer
.
ID
{
return
r
.
id
}
func
(
c
*
repo
)
Bootstrap
(
ctx
context
.
Context
,
p
peer
.
ID
)
error
{
return
c
.
dht
.
Connect
(
ctx
,
p
)
}
func
(
r
*
repo
)
Datastore
()
datastore
.
ThreadSafeDatastore
{
return
r
.
datastore
}
func
(
r
*
repo
)
Blockstore
()
blockstore
.
Blockstore
{
return
r
.
blockstore
}
func
(
r
*
repo
)
Exchange
()
exchange
.
Interface
{
return
r
.
exchange
}
type
ConfigOption
func
(
ctx
context
.
Context
)
(
*
core
.
IpfsNode
,
error
)
func
MocknetTestRepo
(
p
peer
.
ID
,
h
host
.
Host
,
conf
testutil
.
LatencyConfig
)
RepoFactory
{
func
MocknetTestRepo
(
p
peer
.
ID
,
h
host
.
Host
,
conf
testutil
.
LatencyConfig
)
ConfigOption
{
return
func
(
ctx
context
.
Context
)
(
*
core
.
IpfsNode
,
error
)
{
const
kWriteCacheElems
=
100
const
alwaysSendToPeer
=
true
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment