Skip to content

Commit

Permalink
feat(p2p): Bootstrap on 80/443
Browse files Browse the repository at this point in the history
  • Loading branch information
gfanton committed Nov 6, 2018
1 parent 6cb6637 commit 8200287
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 2 additions & 5 deletions core/cmd/berty/daemon.go
Expand Up @@ -2,15 +2,12 @@ package main

import (
"berty.tech/core/manager/account"
"berty.tech/core/network/p2p"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
"github.com/spf13/viper"
)

var defaultBootstrap = []string{
"/ip4/104.248.78.238/tcp/4004/ipfs/QmPCbsVWDtLTdCtwfp5ftZ96xccUNe4hegKStgbss8YACT",
}

type daemonOptions struct {
sql sqlOptions `mapstructure:"sql"`

Expand Down Expand Up @@ -47,7 +44,7 @@ func daemonSetupFlags(flags *pflag.FlagSet, opts *daemonOptions) {
flags.StringVar(&opts.grpcBind, "grpc-bind", ":1337", "gRPC listening address")
flags.StringVar(&opts.gqlBind, "gql-bind", ":8700", "Bind graphql api")
flags.StringVarP(&opts.identity, "p2p-identity", "i", "", "set p2p identity")
flags.StringSliceVar(&opts.bootstrap, "bootstrap", defaultBootstrap, "boostrap peers")
flags.StringSliceVar(&opts.bootstrap, "bootstrap", p2p.DefaultBootstrap, "boostrap peers")
// flags.StringSliceVar(&opts.bindP2P, "bind-p2p", []string{"/ip4/0.0.0.0/tcp/0", "/ble/00000000-0000-0000-0000-000000000000"}, "p2p listening address")
flags.StringSliceVar(&opts.bindP2P, "bind-p2p", []string{"/ip4/0.0.0.0/tcp/0"}, "p2p listening address")
flags.StringSliceVar(&opts.transportP2P, "transport-p2p", []string{"default"}, "p2p transport to enable")
Expand Down
2 changes: 1 addition & 1 deletion core/manager/account/p2p.go
Expand Up @@ -41,7 +41,7 @@ func createP2PNetwork(opts *P2PNetworkOptions, db *gorm.DB) (network.Driver, net
if opts.DefaultBootstrap {
opts.Bootstrap = append(
opts.Bootstrap,
"/ip4/104.248.78.238/tcp/4004/ipfs/QmPCbsVWDtLTdCtwfp5ftZ96xccUNe4hegKStgbss8YACT",
p2p.DefaultBootstrap,
)
}

Expand Down
6 changes: 6 additions & 0 deletions core/network/p2p/options.go
Expand Up @@ -25,6 +25,12 @@ import (
uuid "github.com/satori/go.uuid"
)

var DefaultBootstrap = []string{
"/ip4/104.248.78.238/tcp/4004/ipfs/QmPCbsVWDtLTdCtwfp5ftZ96xccUNe4hegKStgbss8YACT",
"/ip4/104.248.78.238/tcp/443/ipfs/QmPCbsVWDtLTdCtwfp5ftZ96xccUNe4hegKStgbss8YACT",
"/ip4/104.248.78.238/tcp/80/ipfs/QmPCbsVWDtLTdCtwfp5ftZ96xccUNe4hegKStgbss8YACT",
}

var BootstrapIpfs = []string{
"/ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ",
"/ip4/104.236.179.241/tcp/4001/ipfs/QmSoLPppuBtQSGwKDZT2M73ULpjvfd3aZ6ha4oFGL1KrGM",
Expand Down

0 comments on commit 8200287

Please sign in to comment.