1
0
mirror of https://github.com/ipfs/kubo.git synced 2025-09-09 23:42:20 +08:00

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).
This commit is contained in:
Juan Batiz-Benet
2014-12-28 06:25:45 -08:00
parent 735c3de7fa
commit 49cb135ca2
8 changed files with 11 additions and 11 deletions

View File

@ -21,7 +21,7 @@ import (
merkledag "github.com/jbenet/go-ipfs/merkledag"
namesys "github.com/jbenet/go-ipfs/namesys"
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"
peer "github.com/jbenet/go-ipfs/peer"
pin "github.com/jbenet/go-ipfs/pin"
@ -122,7 +122,7 @@ func NewIpfsNode(ctx context.Context, cfg *config.Config, online bool) (n *IpfsN
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 {
return nil, debugerror.Wrap(err)
}

View File

@ -8,7 +8,7 @@ import (
"time"
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"
eventlog "github.com/jbenet/go-ipfs/util/eventlog"

View File

@ -6,7 +6,7 @@ import (
inet "github.com/jbenet/go-ipfs/net"
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"
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"

View File

@ -5,9 +5,9 @@ import (
"testing"
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"
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"
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"

View File

@ -8,7 +8,7 @@ import (
context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
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

View File

@ -4,20 +4,20 @@ import (
"testing"
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"
tu "github.com/jbenet/go-ipfs/util/testutil"
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)
ps := peer.NewPeerstore()
ps.AddAddress(p.ID, p.Addr)
ps.AddPubKey(p.ID, p.PubKey)
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 {
t.Fatal(err)
}

View File

@ -14,7 +14,7 @@ import (
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"
ipfsnet "github.com/jbenet/go-ipfs/net/ipfsnet"
swarmnet "github.com/jbenet/go-ipfs/net/swarmnet"
peer "github.com/jbenet/go-ipfs/peer"
routing "github.com/jbenet/go-ipfs/routing"
u "github.com/jbenet/go-ipfs/util"
@ -49,7 +49,7 @@ func setupDHT(ctx context.Context, t *testing.T, addr ma.Multiaddr) *IpfsDHT {
peerstore.AddPubKey(p, pk)
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 {
t.Fatal(err)
}