mirror of
https://github.com/ipfs/kubo.git
synced 2025-10-25 02:16:56 +08:00
vendor binary deps in test/dependencies
License: MIT Signed-off-by: Jeromy <jeromyj@gmail.com>
This commit is contained in:
10
Godeps/Godeps.json
generated
10
Godeps/Godeps.json
generated
@ -1,6 +1,6 @@
|
||||
{
|
||||
"ImportPath": "github.com/ipfs/go-ipfs",
|
||||
"GoVersion": "go1.4.2",
|
||||
"GoVersion": "go1.5",
|
||||
"Packages": [
|
||||
"./..."
|
||||
],
|
||||
@ -43,10 +43,6 @@
|
||||
"ImportPath": "github.com/cheggaaa/pb",
|
||||
"Rev": "d7729fd7ec1372c15b83db39834bf842bf2d69fb"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/chriscool/go-sleep",
|
||||
"Rev": "743ab5f1bb487edf1772bc29ca0bdf572b40785e"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/codahale/hdrhistogram",
|
||||
"Rev": "5fd85ec0b4e2dd5d4158d257d943f2e586d86b62"
|
||||
@ -286,10 +282,6 @@
|
||||
"ImportPath": "github.com/whyrusleeping/go-metrics",
|
||||
"Rev": "1cd8009604ec2238b5a71305a0ecd974066e0e16"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/whyrusleeping/iptb",
|
||||
"Rev": "3970c95a864f1a40037f796ff596607ce8ae43be"
|
||||
},
|
||||
{
|
||||
"ImportPath": "github.com/whyrusleeping/multiaddr-filter",
|
||||
"Rev": "9e26222151125ecd3fc1fd190179b6bdd55f5608"
|
||||
|
||||
@ -5,9 +5,9 @@ IPFS_CMD = ../cmd/ipfs
|
||||
RANDOM_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random
|
||||
RANDOM_FILES_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-random-files
|
||||
MULTIHASH_SRC = ../Godeps/_workspace/src/github.com/jbenet/go-multihash
|
||||
IPTB_SRC = ../Godeps/_workspace/src/github.com/whyrusleeping/iptb
|
||||
IPTB_SRC = ./dependencies/iptb
|
||||
POLLENDPOINT_SRC= ../thirdparty/pollEndpoint
|
||||
GOSLEEP_SRC = ../Godeps/_workspace/src/github.com/chriscool/go-sleep
|
||||
GOSLEEP_SRC = ./dependencies/go-sleep
|
||||
|
||||
# User might want to override those on the command line
|
||||
GOFLAGS =
|
||||
|
||||
1
test/dependencies/go-sleep/.gitignore
vendored
Normal file
1
test/dependencies/go-sleep/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
go-sleep
|
||||
@ -12,6 +12,8 @@ easy!
|
||||
- -n=[number of nodes]
|
||||
- -f : force overwriting of existing nodes
|
||||
- -bootstrap : select bootstrapping style for cluster choices: star, none
|
||||
- -mdns=[true||false] : defaults to false
|
||||
- -p=[start port] : port to start allocations from
|
||||
- start
|
||||
- starts up all testbed nodes
|
||||
- Options:
|
||||
3
test/dependencies/iptb/lib/todo.go
Normal file
3
test/dependencies/iptb/lib/todo.go
Normal file
@ -0,0 +1,3 @@
|
||||
package iptb
|
||||
|
||||
// TODO: move code here to be used as a lib
|
||||
@ -12,13 +12,15 @@ import (
|
||||
"os/exec"
|
||||
"path"
|
||||
"strconv"
|
||||
"strings"
|
||||
"sync"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
serial "github.com/ipfs/go-ipfs/repo/fsrepo/serialize"
|
||||
|
||||
ma "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr"
|
||||
manet "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/jbenet/go-multiaddr-net"
|
||||
serial "github.com/ipfs/go-ipfs/repo/fsrepo/serialize"
|
||||
)
|
||||
|
||||
// GetNumNodes returns the number of testbed nodes configured in the testbed directory
|
||||
@ -70,6 +72,7 @@ type initCfg struct {
|
||||
Force bool
|
||||
Bootstrap string
|
||||
PortStart int
|
||||
Mdns bool
|
||||
}
|
||||
|
||||
func (c *initCfg) swarmAddrForPeer(i int) string {
|
||||
@ -144,6 +147,7 @@ func starBootstrap(icfg *initCfg) error {
|
||||
bcfg.Addresses.Swarm = []string{icfg.swarmAddrForPeer(0)}
|
||||
bcfg.Addresses.API = icfg.apiAddrForPeer(0)
|
||||
bcfg.Addresses.Gateway = ""
|
||||
bcfg.Discovery.MDNS.Enabled = icfg.Mdns
|
||||
err = serial.WriteConfigFile(cfgpath, bcfg)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -156,8 +160,11 @@ func starBootstrap(icfg *initCfg) error {
|
||||
return err
|
||||
}
|
||||
|
||||
cfg.Bootstrap = []string{fmt.Sprintf("%s/ipfs/%s", bcfg.Addresses.Swarm[0], bcfg.Identity.PeerID)}
|
||||
ba := fmt.Sprintf("%s/ipfs/%s", bcfg.Addresses.Swarm[0], bcfg.Identity.PeerID)
|
||||
ba = strings.Replace(ba, "0.0.0.0", "127.0.0.1", -1)
|
||||
cfg.Bootstrap = []string{ba}
|
||||
cfg.Addresses.Gateway = ""
|
||||
cfg.Discovery.MDNS.Enabled = icfg.Mdns
|
||||
cfg.Addresses.Swarm = []string{
|
||||
icfg.swarmAddrForPeer(i),
|
||||
}
|
||||
@ -182,6 +189,7 @@ func clearBootstrapping(icfg *initCfg) error {
|
||||
cfg.Addresses.Gateway = ""
|
||||
cfg.Addresses.Swarm = []string{icfg.swarmAddrForPeer(i)}
|
||||
cfg.Addresses.API = icfg.apiAddrForPeer(i)
|
||||
cfg.Discovery.MDNS.Enabled = icfg.Mdns
|
||||
err = serial.WriteConfigFile(cfgpath, cfg)
|
||||
if err != nil {
|
||||
return err
|
||||
@ -440,6 +448,7 @@ func main() {
|
||||
flag.IntVar(&cfg.Count, "n", 0, "number of ipfs nodes to initialize")
|
||||
flag.IntVar(&cfg.PortStart, "p", 4002, "port to start allocations from")
|
||||
flag.BoolVar(&cfg.Force, "f", false, "force initialization (overwrite existing configs)")
|
||||
flag.BoolVar(&cfg.Mdns, "mdns", false, "turn on mdns for nodes")
|
||||
flag.StringVar(&cfg.Bootstrap, "bootstrap", "star", "select bootstrapping style for cluster")
|
||||
|
||||
wait := flag.Bool("wait", false, "wait for nodes to come fully online before exiting")
|
||||
@ -4,11 +4,6 @@ package util
|
||||
// Godep will drop it if we dont use it in ipfs. There should be a better way to do this.
|
||||
import _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/dustin/go-humanize"
|
||||
|
||||
// similar to the above, only used in the tests makefile
|
||||
import _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/whyrusleeping/iptb"
|
||||
|
||||
import _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/chriscool/go-sleep"
|
||||
|
||||
// imported by chegga/pb on windows, this is here so running godeps on non-windows doesnt
|
||||
// drop it from our vendoring
|
||||
import _ "github.com/ipfs/go-ipfs/Godeps/_workspace/src/github.com/olekukonko/ts"
|
||||
|
||||
Reference in New Issue
Block a user