@cryptotaxi247 / kubo / commits / 49cb135ca

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).

Juan Batiz-Benet committed Dec 28, 2014 at 06:25 UTC 49cb135ca2906d101449f16577dfce80dc06cf29
8 files changed +11 -11
core/core.go
+2 -2
@@ -21,7 +21,7 @@ import (
21 merkledag "github.com/jbenet/go-ipfs/merkledag"
22 namesys "github.com/jbenet/go-ipfs/namesys"
23 inet "github.com/jbenet/go-ipfs/net"
24 - ipfsnet "github.com/jbenet/go-ipfs/net/ipfsnet"
24 + swarmnet "github.com/jbenet/go-ipfs/net/swarmnet"
25 path "github.com/jbenet/go-ipfs/path"
26 peer "github.com/jbenet/go-ipfs/peer"
27 pin "github.com/jbenet/go-ipfs/pin"
@@ -122,7 +122,7 @@ func NewIpfsNode(ctx context.Context, cfg *config.Config, online bool) (n *IpfsN
122 return nil, debugerror.Wrap(err)
123 }
124
125 - n.Network, err = ipfsnet.NewNetwork(ctx, listenAddrs, n.Identity, n.Peerstore)
125 + n.Network, err = swarmnet.NewNetwork(ctx, listenAddrs, n.Identity, n.Peerstore)
126 if err != nil {
127 return nil, debugerror.Wrap(err)
128 }
net/backpressure/backpressure_test.go
+1 -1
@@ -8,7 +8,7 @@ import (
8 "time"
9
10 inet "github.com/jbenet/go-ipfs/net"
11 - netutil "github.com/jbenet/go-ipfs/net/ipfsnet/util"
11 + netutil "github.com/jbenet/go-ipfs/net/swarmnet/util"
12 peer "github.com/jbenet/go-ipfs/peer"
13 eventlog "github.com/jbenet/go-ipfs/util/eventlog"
14
net/services/identify/id_test.go
+1 -1
@@ -6,7 +6,7 @@ import (
6
7 inet "github.com/jbenet/go-ipfs/net"
8 handshake "github.com/jbenet/go-ipfs/net/handshake"
9 - netutil "github.com/jbenet/go-ipfs/net/ipfsnet/util"
9 + netutil "github.com/jbenet/go-ipfs/net/swarmnet/util"
10 peer "github.com/jbenet/go-ipfs/peer"
11
12 context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
net/services/relay/relay_test.go
+1 -1
@@ -5,9 +5,9 @@ import (
5 "testing"
6
7 inet "github.com/jbenet/go-ipfs/net"
8 - netutil "github.com/jbenet/go-ipfs/net/ipfsnet/util"
8 mux "github.com/jbenet/go-ipfs/net/services/mux"
9 relay "github.com/jbenet/go-ipfs/net/services/relay"
10 + netutil "github.com/jbenet/go-ipfs/net/swarmnet/util"
11 eventlog "github.com/jbenet/go-ipfs/util/eventlog"
12
13 context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
net/swarmnet/net.go renamed
net/swarmnet/net_test.go renamed
+1 -1
@@ -8,7 +8,7 @@ import (
8 context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
9
10 inet "github.com/jbenet/go-ipfs/net"
11 - netutil "github.com/jbenet/go-ipfs/net/ipfsnet/util"
11 + netutil "github.com/jbenet/go-ipfs/net/swarmnet/util"
12 )
13
14 // TestConnectednessCorrect starts a few networks, connects a few
net/swarmnet/util/util.go renamed
+3 -3
@@ -4,20 +4,20 @@ import (
4 "testing"
5
6 inet "github.com/jbenet/go-ipfs/net"
7 - in "github.com/jbenet/go-ipfs/net/ipfsnet"
7 + sn "github.com/jbenet/go-ipfs/net/swarmnet"
8 peer "github.com/jbenet/go-ipfs/peer"
9 tu "github.com/jbenet/go-ipfs/util/testutil"
10
11 context "github.com/jbenet/go-ipfs/Godeps/_workspace/src/code.google.com/p/go.net/context"
12 )
13
14 -func GenNetwork(t *testing.T, ctx context.Context) *in.Network {
14 +func GenNetwork(t *testing.T, ctx context.Context) *sn.Network {
15 p := tu.RandPeerNetParamsOrFatal(t)
16 ps := peer.NewPeerstore()
17 ps.AddAddress(p.ID, p.Addr)
18 ps.AddPubKey(p.ID, p.PubKey)
19 ps.AddPrivKey(p.ID, p.PrivKey)
20 - n, err := in.NewNetwork(ctx, ps.Addresses(p.ID), p.ID, ps)
20 + n, err := sn.NewNetwork(ctx, ps.Addresses(p.ID), p.ID, ps)
21 if err != nil {
22 t.Fatal(err)
23 }
routing/dht/dht_test.go
+2 -2
@@ -14,7 +14,7 @@ import (
14 dssync "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-datastore/sync"
15 ma "github.com/jbenet/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
16
17 - ipfsnet "github.com/jbenet/go-ipfs/net/ipfsnet"
17 + swarmnet "github.com/jbenet/go-ipfs/net/swarmnet"
18 peer "github.com/jbenet/go-ipfs/peer"
19 routing "github.com/jbenet/go-ipfs/routing"
20 u "github.com/jbenet/go-ipfs/util"
@@ -49,7 +49,7 @@ func setupDHT(ctx context.Context, t *testing.T, addr ma.Multiaddr) *IpfsDHT {
49 peerstore.AddPubKey(p, pk)
50 peerstore.AddAddress(p, addr)
51
52 - n, err := ipfsnet.NewNetwork(ctx, []ma.Multiaddr{addr}, p, peerstore)
52 + n, err := swarmnet.NewNetwork(ctx, []ma.Multiaddr{addr}, p, peerstore)
53 if err != nil {
54 t.Fatal(err)
55 }