提交 49cb135c 作者: Juan Batiz-Benet

ipfsnet -> swarmnet

swarmnet is a better name for the package, because
it's just a Network implemented with a Swarm.
(ipfsnet will be something slightly different).
上级 735c3de7
...@@ -21,7 +21,7 @@ import ( ...@@ -21,7 +21,7 @@ import (
merkledag "github.com/jbenet/go-ipfs/merkledag" merkledag "github.com/jbenet/go-ipfs/merkledag"
namesys "github.com/jbenet/go-ipfs/namesys" namesys "github.com/jbenet/go-ipfs/namesys"
inet "github.com/jbenet/go-ipfs/net" inet "github.com/jbenet/go-ipfs/net"
ipfsnet "github.com/jbenet/go-ipfs/net/ipfsnet" swarmnet "github.com/jbenet/go-ipfs/net/swarmnet"
path "github.com/jbenet/go-ipfs/path" path "github.com/jbenet/go-ipfs/path"
peer "github.com/jbenet/go-ipfs/peer" peer "github.com/jbenet/go-ipfs/peer"
pin "github.com/jbenet/go-ipfs/pin" pin "github.com/jbenet/go-ipfs/pin"
...@@ -122,7 +122,7 @@ func NewIpfsNode(ctx context.Context, cfg *config.Config, online bool) (n *IpfsN ...@@ -122,7 +122,7 @@ func NewIpfsNode(ctx context.Context, cfg *config.Config, online bool) (n *IpfsN
return nil, debugerror.Wrap(err) return nil, debugerror.Wrap(err)
} }
n.Network, err = ipfsnet.NewNetwork(ctx, listenAddrs, n.Identity, n.Peerstore) n.Network, err = swarmnet.NewNetwork(ctx, listenAddrs, n.Identity, n.Peerstore)
if err != nil { if err != nil {
return nil, debugerror.Wrap(err) return nil, debugerror.Wrap(err)
} }
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
"time" "time"
inet "github.com/jbenet/go-ipfs/net" inet "github.com/jbenet/go-ipfs/net"
netutil "github.com/jbenet/go-ipfs/net/ipfsnet/util" netutil "github.com/jbenet/go-ipfs/net/swarmnet/util"
peer "github.com/jbenet/go-ipfs/peer" peer "github.com/jbenet/go-ipfs/peer"
eventlog "github.com/jbenet/go-ipfs/util/eventlog" eventlog "github.com/jbenet/go-ipfs/util/eventlog"
......
...@@ -6,7 +6,7 @@ import ( ...@@ -6,7 +6,7 @@ import (
inet "github.com/jbenet/go-ipfs/net" inet "github.com/jbenet/go-ipfs/net"
handshake "github.com/jbenet/go-ipfs/net/handshake" handshake "github.com/jbenet/go-ipfs/net/handshake"
netutil "github.com/jbenet/go-ipfs/net/ipfsnet/util" netutil "github.com/jbenet/go-ipfs/net/swarmnet/util"
peer "github.com/jbenet/go-ipfs/peer" peer "github.com/jbenet/go-ipfs/peer"
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
......
...@@ -5,9 +5,9 @@ import ( ...@@ -5,9 +5,9 @@ import (
"testing" "testing"
inet "github.com/jbenet/go-ipfs/net" inet "github.com/jbenet/go-ipfs/net"
netutil "github.com/jbenet/go-ipfs/net/ipfsnet/util"
mux "github.com/jbenet/go-ipfs/net/services/mux" mux "github.com/jbenet/go-ipfs/net/services/mux"
relay "github.com/jbenet/go-ipfs/net/services/relay" relay "github.com/jbenet/go-ipfs/net/services/relay"
netutil "github.com/jbenet/go-ipfs/net/swarmnet/util"
eventlog "github.com/jbenet/go-ipfs/util/eventlog" eventlog "github.com/jbenet/go-ipfs/util/eventlog"
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
inet "github.com/jbenet/go-ipfs/net" inet "github.com/jbenet/go-ipfs/net"
netutil "github.com/jbenet/go-ipfs/net/ipfsnet/util" netutil "github.com/jbenet/go-ipfs/net/swarmnet/util"
) )
// TestConnectednessCorrect starts a few networks, connects a few // TestConnectednessCorrect starts a few networks, connects a few
......
...@@ -4,20 +4,20 @@ import ( ...@@ -4,20 +4,20 @@ import (
"testing" "testing"
inet "github.com/jbenet/go-ipfs/net" inet "github.com/jbenet/go-ipfs/net"
in "github.com/jbenet/go-ipfs/net/ipfsnet" sn "github.com/jbenet/go-ipfs/net/swarmnet"
peer "github.com/jbenet/go-ipfs/peer" peer "github.com/jbenet/go-ipfs/peer"
tu "github.com/jbenet/go-ipfs/util/testutil" tu "github.com/jbenet/go-ipfs/util/testutil"
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context" context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
) )
func GenNetwork(t *testing.T, ctx context.Context) *in.Network { func GenNetwork(t *testing.T, ctx context.Context) *sn.Network {
p := tu.RandPeerNetParamsOrFatal(t) p := tu.RandPeerNetParamsOrFatal(t)
ps := peer.NewPeerstore() ps := peer.NewPeerstore()
ps.AddAddress(p.ID, p.Addr) ps.AddAddress(p.ID, p.Addr)
ps.AddPubKey(p.ID, p.PubKey) ps.AddPubKey(p.ID, p.PubKey)
ps.AddPrivKey(p.ID, p.PrivKey) ps.AddPrivKey(p.ID, p.PrivKey)
n, err := in.NewNetwork(ctx, ps.Addresses(p.ID), p.ID, ps) n, err := sn.NewNetwork(ctx, ps.Addresses(p.ID), p.ID, ps)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
...@@ -14,7 +14,7 @@ import ( ...@@ -14,7 +14,7 @@ import (
dssync "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync" dssync "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync"
ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr" ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
ipfsnet "github.com/jbenet/go-ipfs/net/ipfsnet" swarmnet "github.com/jbenet/go-ipfs/net/swarmnet"
peer "github.com/jbenet/go-ipfs/peer" peer "github.com/jbenet/go-ipfs/peer"
routing "github.com/jbenet/go-ipfs/routing" routing "github.com/jbenet/go-ipfs/routing"
u "github.com/jbenet/go-ipfs/util" u "github.com/jbenet/go-ipfs/util"
...@@ -49,7 +49,7 @@ func setupDHT(ctx context.Context, t *testing.T, addr ma.Multiaddr) *IpfsDHT { ...@@ -49,7 +49,7 @@ func setupDHT(ctx context.Context, t *testing.T, addr ma.Multiaddr) *IpfsDHT {
peerstore.AddPubKey(p, pk) peerstore.AddPubKey(p, pk)
peerstore.AddAddress(p, addr) peerstore.AddAddress(p, addr)
n, err := ipfsnet.NewNetwork(ctx, []ma.Multiaddr{addr}, p, peerstore) n, err := swarmnet.NewNetwork(ctx, []ma.Multiaddr{addr}, p, peerstore)
if err != nil { if err != nil {
t.Fatal(err) t.Fatal(err)
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论