mirror of
https://github.com/fluencelabs/tendermint
synced 2025-04-26 07:12:16 +00:00
rename manual peers to persistent peers
This commit is contained in:
parent
37f86f9518
commit
e4897b7bdd
@ -28,8 +28,8 @@ BUG FIXES:
|
|||||||
## 0.16.0 (TBD)
|
## 0.16.0 (TBD)
|
||||||
|
|
||||||
BREAKING CHANGES:
|
BREAKING CHANGES:
|
||||||
- rpc: `/unsafe_dial_seeds` renamed to `/unsafe_dial_manual_peers`
|
- rpc: `/unsafe_dial_seeds` renamed to `/unsafe_dial_persistent_peers`
|
||||||
- [p2p] old `seeds` is now `manual_peers` (persistent peers to which TM will always connect to)
|
- [p2p] old `seeds` is now `persistent_peers` (persistent peers to which TM will always connect to)
|
||||||
- [p2p] now `seeds` only used for getting addresses (if addrbook is empty; not persistent)
|
- [p2p] now `seeds` only used for getting addresses (if addrbook is empty; not persistent)
|
||||||
|
|
||||||
## 0.15.0 (December 29, 2017)
|
## 0.15.0 (December 29, 2017)
|
||||||
|
@ -51,7 +51,7 @@ tendermint node \
|
|||||||
--proxy_app dummy \
|
--proxy_app dummy \
|
||||||
--p2p.laddr tcp://127.0.0.1:56666 \
|
--p2p.laddr tcp://127.0.0.1:56666 \
|
||||||
--rpc.laddr tcp://127.0.0.1:56667 \
|
--rpc.laddr tcp://127.0.0.1:56667 \
|
||||||
--p2p.manual_peers 127.0.0.1:56656 \
|
--p2p.persistent_peers 127.0.0.1:56656 \
|
||||||
--log_level error &
|
--log_level error &
|
||||||
|
|
||||||
# wait for node to start up so we only count time where we are actually syncing
|
# wait for node to start up so we only count time where we are actually syncing
|
||||||
|
@ -29,7 +29,7 @@ func AddNodeFlags(cmd *cobra.Command) {
|
|||||||
// p2p flags
|
// p2p flags
|
||||||
cmd.Flags().String("p2p.laddr", config.P2P.ListenAddress, "Node listen address. (0.0.0.0:0 means any interface, any port)")
|
cmd.Flags().String("p2p.laddr", config.P2P.ListenAddress, "Node listen address. (0.0.0.0:0 means any interface, any port)")
|
||||||
cmd.Flags().String("p2p.seeds", config.P2P.Seeds, "Comma delimited host:port seed nodes")
|
cmd.Flags().String("p2p.seeds", config.P2P.Seeds, "Comma delimited host:port seed nodes")
|
||||||
cmd.Flags().String("p2p.manual_peers", config.P2P.ManualPeers, "Comma delimited host:port manual peers")
|
cmd.Flags().String("p2p.persistent_peers", config.P2P.PersistentPeers, "Comma delimited host:port persistent peers")
|
||||||
cmd.Flags().Bool("p2p.skip_upnp", config.P2P.SkipUPNP, "Skip UPNP configuration")
|
cmd.Flags().Bool("p2p.skip_upnp", config.P2P.SkipUPNP, "Skip UPNP configuration")
|
||||||
cmd.Flags().Bool("p2p.pex", config.P2P.PexReactor, "Enable/disable Peer-Exchange")
|
cmd.Flags().Bool("p2p.pex", config.P2P.PexReactor, "Enable/disable Peer-Exchange")
|
||||||
|
|
||||||
|
@ -170,7 +170,7 @@ type RPCConfig struct {
|
|||||||
// NOTE: This server only supports /broadcast_tx_commit
|
// NOTE: This server only supports /broadcast_tx_commit
|
||||||
GRPCListenAddress string `mapstructure:"grpc_laddr"`
|
GRPCListenAddress string `mapstructure:"grpc_laddr"`
|
||||||
|
|
||||||
// Activate unsafe RPC commands like /dial_manual_peers and /unsafe_flush_mempool
|
// Activate unsafe RPC commands like /dial_persistent_peers and /unsafe_flush_mempool
|
||||||
Unsafe bool `mapstructure:"unsafe"`
|
Unsafe bool `mapstructure:"unsafe"`
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,9 +206,9 @@ type P2PConfig struct {
|
|||||||
// We only use these if we can’t connect to peers in the addrbook
|
// We only use these if we can’t connect to peers in the addrbook
|
||||||
Seeds string `mapstructure:"seeds"`
|
Seeds string `mapstructure:"seeds"`
|
||||||
|
|
||||||
// Comma separated list of manual peers to connect to
|
// Comma separated list of persistent peers to connect to
|
||||||
// We always connect to these
|
// We always connect to these
|
||||||
ManualPeers string `mapstructure:"manual_peers"`
|
PersistentPeers string `mapstructure:"persistent_peers"`
|
||||||
|
|
||||||
// Skip UPNP port forwarding
|
// Skip UPNP port forwarding
|
||||||
SkipUPNP bool `mapstructure:"skip_upnp"`
|
SkipUPNP bool `mapstructure:"skip_upnp"`
|
||||||
|
@ -42,7 +42,7 @@ laddr = "tcp://0.0.0.0:46657"
|
|||||||
[p2p]
|
[p2p]
|
||||||
laddr = "tcp://0.0.0.0:46656"
|
laddr = "tcp://0.0.0.0:46656"
|
||||||
seeds = ""
|
seeds = ""
|
||||||
manual_peers = ""
|
persistent_peers = ""
|
||||||
`
|
`
|
||||||
|
|
||||||
func defaultConfig(moniker string) string {
|
func defaultConfig(moniker string) string {
|
||||||
@ -107,7 +107,7 @@ laddr = "tcp://0.0.0.0:36657"
|
|||||||
[p2p]
|
[p2p]
|
||||||
laddr = "tcp://0.0.0.0:36656"
|
laddr = "tcp://0.0.0.0:36656"
|
||||||
seeds = ""
|
seeds = ""
|
||||||
manual_peers = ""
|
persistent_peers = ""
|
||||||
`
|
`
|
||||||
|
|
||||||
func testConfig(moniker string) (testConfig string) {
|
func testConfig(moniker string) (testConfig string) {
|
||||||
|
@ -24,13 +24,13 @@ Here are the steps to setting up a testnet manually:
|
|||||||
``tendermint gen_validator``
|
``tendermint gen_validator``
|
||||||
4) Compile a list of public keys for each validator into a
|
4) Compile a list of public keys for each validator into a
|
||||||
``genesis.json`` file.
|
``genesis.json`` file.
|
||||||
5) Run ``tendermint node --p2p.manual_peers=< peer addresses >`` on each node,
|
5) Run ``tendermint node --p2p.persistent_peers=< peer addresses >`` on each node,
|
||||||
where ``< peer addresses >`` is a comma separated list of the IP:PORT
|
where ``< peer addresses >`` is a comma separated list of the IP:PORT
|
||||||
combination for each node. The default port for Tendermint is
|
combination for each node. The default port for Tendermint is
|
||||||
``46656``. Thus, if the IP addresses of your nodes were
|
``46656``. Thus, if the IP addresses of your nodes were
|
||||||
``192.168.0.1, 192.168.0.2, 192.168.0.3, 192.168.0.4``, the command
|
``192.168.0.1, 192.168.0.2, 192.168.0.3, 192.168.0.4``, the command
|
||||||
would look like:
|
would look like:
|
||||||
``tendermint node --p2p.manual_peers=192.168.0.1:46656,192.168.0.2:46656,192.168.0.3:46656,192.168.0.4:46656``.
|
``tendermint node --p2p.persistent_peers=192.168.0.1:46656,192.168.0.2:46656,192.168.0.3:46656,192.168.0.4:46656``.
|
||||||
|
|
||||||
After a few seconds, all the nodes should connect to eachother and start
|
After a few seconds, all the nodes should connect to eachother and start
|
||||||
making blocks! For more information, see the Tendermint Networks section
|
making blocks! For more information, see the Tendermint Networks section
|
||||||
|
@ -49,7 +49,7 @@ The main config parameters are defined
|
|||||||
- ``p2p.pex``: Enable Peer-Exchange (dev feature). *Default*: ``false``
|
- ``p2p.pex``: Enable Peer-Exchange (dev feature). *Default*: ``false``
|
||||||
- ``p2p.seeds``: Comma delimited host:port seed nodes. *Default*:
|
- ``p2p.seeds``: Comma delimited host:port seed nodes. *Default*:
|
||||||
``""``
|
``""``
|
||||||
- ``p2p.manual_peers``: Comma delimited host:port manual peers. *Default*:
|
- ``p2p.persistent_peers``: Comma delimited host:port persistent peers. *Default*:
|
||||||
``""``
|
``""``
|
||||||
- ``p2p.skip_upnp``: Skip UPNP detection. *Default*: ``false``
|
- ``p2p.skip_upnp``: Skip UPNP detection. *Default*: ``false``
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ An HTTP Get request to the root RPC endpoint (e.g.
|
|||||||
http://localhost:46657/broadcast_tx_commit?tx=_
|
http://localhost:46657/broadcast_tx_commit?tx=_
|
||||||
http://localhost:46657/broadcast_tx_sync?tx=_
|
http://localhost:46657/broadcast_tx_sync?tx=_
|
||||||
http://localhost:46657/commit?height=_
|
http://localhost:46657/commit?height=_
|
||||||
http://localhost:46657/dial_manual_peers?manual_peers=_
|
http://localhost:46657/dial_persistent_peers?persistent_peers=_
|
||||||
http://localhost:46657/subscribe?event=_
|
http://localhost:46657/subscribe?event=_
|
||||||
http://localhost:46657/tx?hash=_&prove=_
|
http://localhost:46657/tx?hash=_&prove=_
|
||||||
http://localhost:46657/unsafe_start_cpu_profiler?filename=_
|
http://localhost:46657/unsafe_start_cpu_profiler?filename=_
|
||||||
|
@ -270,14 +270,14 @@ For instance,
|
|||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
tendermint node --p2p.manual_peers "1.2.3.4:46656,5.6.7.8:46656"
|
tendermint node --p2p.persistent_peers "1.2.3.4:46656,5.6.7.8:46656"
|
||||||
|
|
||||||
Alternatively, you can use the ``/dial_manual_peers`` endpoint of the RPC to
|
Alternatively, you can use the ``/dial_persistent_peers`` endpoint of the RPC to
|
||||||
specify peers for a running node to connect to:
|
specify peers for a running node to connect to:
|
||||||
|
|
||||||
::
|
::
|
||||||
|
|
||||||
curl --data-urlencode "manual_peers=[\"1.2.3.4:46656\",\"5.6.7.8:46656\"]" localhost:46657/dial_manual_peers
|
curl --data-urlencode "persistent_peers=[\"1.2.3.4:46656\",\"5.6.7.8:46656\"]" localhost:46657/dial_persistent_peers
|
||||||
|
|
||||||
Additionally, the peer-exchange protocol can be enabled using the
|
Additionally, the peer-exchange protocol can be enabled using the
|
||||||
``--pex`` flag, though this feature is `still under
|
``--pex`` flag, though this feature is `still under
|
||||||
@ -290,7 +290,7 @@ Adding a Non-Validator
|
|||||||
|
|
||||||
Adding a non-validator is simple. Just copy the original
|
Adding a non-validator is simple. Just copy the original
|
||||||
``genesis.json`` to ``~/.tendermint`` on the new machine and start the
|
``genesis.json`` to ``~/.tendermint`` on the new machine and start the
|
||||||
node, specifying manual_peers as necessary. If no manual_peers are specified, the node
|
node, specifying persistent_peers as necessary. If no persistent_peers are specified, the node
|
||||||
won't make any blocks, because it's not a validator, and it won't hear
|
won't make any blocks, because it's not a validator, and it won't hear
|
||||||
about any blocks, because it's not connected to the other peer.
|
about any blocks, because it's not connected to the other peer.
|
||||||
|
|
||||||
@ -363,7 +363,7 @@ and the new ``priv_validator.json`` to the ``~/.tendermint`` on a new
|
|||||||
machine.
|
machine.
|
||||||
|
|
||||||
Now run ``tendermint node`` on both machines, and use either
|
Now run ``tendermint node`` on both machines, and use either
|
||||||
``--p2p.manual_peers`` or the ``/dial_manual_peers`` to get them to peer up. They
|
``--p2p.persistent_peers`` or the ``/dial_persistent_peers`` to get them to peer up. They
|
||||||
should start making blocks, and will only continue to do so as long as
|
should start making blocks, and will only continue to do so as long as
|
||||||
both of them are online.
|
both of them are online.
|
||||||
|
|
||||||
|
@ -380,9 +380,9 @@ func (n *Node) OnStart() error {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always connect to manual peers
|
// Always connect to persistent peers
|
||||||
if n.config.P2P.ManualPeers != "" {
|
if n.config.P2P.PersistentPeers != "" {
|
||||||
err = n.sw.DialPeersAsync(n.addrBook, strings.Split(n.config.P2P.ManualPeers, ","), true)
|
err = n.sw.DialPeersAsync(n.addrBook, strings.Split(n.config.P2P.PersistentPeers, ","), true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ func (r *PEXReactor) GetChannels() []*ChannelDescriptor {
|
|||||||
func (r *PEXReactor) AddPeer(p Peer) {
|
func (r *PEXReactor) AddPeer(p Peer) {
|
||||||
if p.IsOutbound() {
|
if p.IsOutbound() {
|
||||||
// For outbound peers, the address is already in the books.
|
// For outbound peers, the address is already in the books.
|
||||||
// Either it was added in DialManualPeers or when we
|
// Either it was added in DialPersistentPeers or when we
|
||||||
// received the peer's address in r.Receive
|
// received the peer's address in r.Receive
|
||||||
if r.book.NeedMoreAddrs() {
|
if r.book.NeedMoreAddrs() {
|
||||||
r.RequestPEX(p)
|
r.RequestPEX(p)
|
||||||
|
@ -323,7 +323,7 @@ func (sw *Switch) DialPeersAsync(addrBook *AddrBook, peers []string, persistent
|
|||||||
}
|
}
|
||||||
|
|
||||||
if addrBook != nil {
|
if addrBook != nil {
|
||||||
// add manual peers to `addrBook`
|
// add persistent peers to `addrBook`
|
||||||
ourAddrS := sw.nodeInfo.ListenAddr
|
ourAddrS := sw.nodeInfo.ListenAddr
|
||||||
ourAddr, _ := NewNetAddressString(ourAddrS)
|
ourAddr, _ := NewNetAddressString(ourAddrS)
|
||||||
for _, netAddr := range netAddrs {
|
for _, netAddr := range netAddrs {
|
||||||
|
@ -84,8 +84,8 @@ func (Local) DumpConsensusState() (*ctypes.ResultDumpConsensusState, error) {
|
|||||||
return core.DumpConsensusState()
|
return core.DumpConsensusState()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Local) DialManualPeers(manual_peers []string) (*ctypes.ResultDialManualPeers, error) {
|
func (Local) DialPersistentPeers(persistent_peers []string) (*ctypes.ResultDialPersistentPeers, error) {
|
||||||
return core.UnsafeDialManualPeers(manual_peers)
|
return core.UnsafeDialPersistentPeers(persistent_peers)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (Local) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) {
|
func (Local) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) {
|
||||||
|
@ -107,8 +107,8 @@ func (c Client) NetInfo() (*ctypes.ResultNetInfo, error) {
|
|||||||
return core.NetInfo()
|
return core.NetInfo()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Client) DialManualPeers(manual_peers []string) (*ctypes.ResultDialManualPeers, error) {
|
func (c Client) DialPersistentPeers(persistent_peers []string) (*ctypes.ResultDialPersistentPeers, error) {
|
||||||
return core.UnsafeDialManualPeers(manual_peers)
|
return core.UnsafeDialPersistentPeers(persistent_peers)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c Client) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) {
|
func (c Client) BlockchainInfo(minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) {
|
||||||
|
@ -94,7 +94,7 @@ Endpoints that require arguments:
|
|||||||
/broadcast_tx_commit?tx=_
|
/broadcast_tx_commit?tx=_
|
||||||
/broadcast_tx_sync?tx=_
|
/broadcast_tx_sync?tx=_
|
||||||
/commit?height=_
|
/commit?height=_
|
||||||
/dial_manual_peers?manual_peers=_
|
/dial_persistent_peers?persistent_peers=_
|
||||||
/subscribe?event=_
|
/subscribe?event=_
|
||||||
/tx?hash=_&prove=_
|
/tx?hash=_&prove=_
|
||||||
/unsafe_start_cpu_profiler?filename=_
|
/unsafe_start_cpu_profiler?filename=_
|
||||||
|
@ -54,18 +54,18 @@ func NetInfo() (*ctypes.ResultNetInfo, error) {
|
|||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func UnsafeDialManualPeers(manual_peers []string) (*ctypes.ResultDialManualPeers, error) {
|
func UnsafeDialPersistentPeers(persistent_peers []string) (*ctypes.ResultDialPersistentPeers, error) {
|
||||||
|
|
||||||
if len(manual_peers) == 0 {
|
if len(persistent_peers) == 0 {
|
||||||
return &ctypes.ResultDialManualPeers{}, fmt.Errorf("No manual peers provided")
|
return &ctypes.ResultDialPersistentPeers{}, fmt.Errorf("No persistent peers provided")
|
||||||
}
|
}
|
||||||
// starts go routines to dial each peer after random delays
|
// starts go routines to dial each peer after random delays
|
||||||
logger.Info("DialManualPeers", "addrBook", addrBook, "manual_peers", manual_peers)
|
logger.Info("DialPersistentPeers", "addrBook", addrBook, "persistent_peers", persistent_peers)
|
||||||
err := p2pSwitch.DialPeersAsync(addrBook, manual_peers, true)
|
err := p2pSwitch.DialPeersAsync(addrBook, persistent_peers, true)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return &ctypes.ResultDialManualPeers{}, err
|
return &ctypes.ResultDialPersistentPeers{}, err
|
||||||
}
|
}
|
||||||
return &ctypes.ResultDialManualPeers{"Dialing manual peers in progress. See /net_info for details"}, nil
|
return &ctypes.ResultDialPersistentPeers{"Dialing persistent peers in progress. See /net_info for details"}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get genesis file.
|
// Get genesis file.
|
||||||
|
@ -38,7 +38,7 @@ var Routes = map[string]*rpc.RPCFunc{
|
|||||||
|
|
||||||
func AddUnsafeRoutes() {
|
func AddUnsafeRoutes() {
|
||||||
// control API
|
// control API
|
||||||
Routes["dial_manual_peers"] = rpc.NewRPCFunc(UnsafeDialManualPeers, "manual_peers")
|
Routes["dial_persistent_peers"] = rpc.NewRPCFunc(UnsafeDialPersistentPeers, "persistent_peers")
|
||||||
Routes["unsafe_flush_mempool"] = rpc.NewRPCFunc(UnsafeFlushMempool, "")
|
Routes["unsafe_flush_mempool"] = rpc.NewRPCFunc(UnsafeFlushMempool, "")
|
||||||
|
|
||||||
// profiler API
|
// profiler API
|
||||||
|
@ -82,7 +82,7 @@ type ResultNetInfo struct {
|
|||||||
Peers []Peer `json:"peers"`
|
Peers []Peer `json:"peers"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type ResultDialManualPeers struct {
|
type ResultDialPersistentPeers struct {
|
||||||
Log string `json:"log"`
|
Log string `json:"log"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ for i in $(seq 1 4); do
|
|||||||
--name local_testnet_$i \
|
--name local_testnet_$i \
|
||||||
--entrypoint tendermint \
|
--entrypoint tendermint \
|
||||||
-e TMHOME=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$i/core \
|
-e TMHOME=/go/src/github.com/tendermint/tendermint/test/p2p/data/mach$i/core \
|
||||||
tendermint_tester node --p2p.manual_peers 172.57.0.101:46656,172.57.0.102:46656,172.57.0.103:46656,172.57.0.104:46656 --proxy_app=dummy
|
tendermint_tester node --p2p.persistent_peers 172.57.0.101:46656,172.57.0.102:46656,172.57.0.103:46656,172.57.0.104:46656 --proxy_app=dummy
|
||||||
done
|
done
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -23,11 +23,11 @@ docker rm -vf local_testnet_$ID
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
# restart peer - should have an empty blockchain
|
# restart peer - should have an empty blockchain
|
||||||
MANUAL_PEERS="$(test/p2p/ip.sh 1):46656"
|
PERSISTENT_PEERS="$(test/p2p/ip.sh 1):46656"
|
||||||
for j in `seq 2 $N`; do
|
for j in `seq 2 $N`; do
|
||||||
MANUAL_PEERS="$MANUAL_PEERS,$(test/p2p/ip.sh $j):46656"
|
PERSISTENT_PEERS="$PERSISTENT_PEERS,$(test/p2p/ip.sh $j):46656"
|
||||||
done
|
done
|
||||||
bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $ID $PROXY_APP "--p2p.manual_peers $MANUAL_PEERS --p2p.pex --rpc.unsafe"
|
bash test/p2p/peer.sh $DOCKER_IMAGE $NETWORK_NAME $ID $PROXY_APP "--p2p.persistent_peers $PERSISTENT_PEERS --p2p.pex --rpc.unsafe"
|
||||||
|
|
||||||
# wait for peer to sync and check the app hash
|
# wait for peer to sync and check the app hash
|
||||||
bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME fs_$ID "test/p2p/fast_sync/check_peer.sh $ID"
|
bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME fs_$ID "test/p2p/fast_sync/check_peer.sh $ID"
|
||||||
|
@ -7,10 +7,10 @@ N=$3
|
|||||||
APP_PROXY=$4
|
APP_PROXY=$4
|
||||||
|
|
||||||
set +u
|
set +u
|
||||||
MANUAL_PEERS=$5
|
PERSISTENT_PEERS=$5
|
||||||
if [[ "$MANUAL_PEERS" != "" ]]; then
|
if [[ "$PERSISTENT_PEERS" != "" ]]; then
|
||||||
echo "ManualPeers: $MANUAL_PEERS"
|
echo "PersistentPeers: $PERSISTENT_PEERS"
|
||||||
MANUAL_PEERS="--p2p.manual_peers $MANUAL_PEERS"
|
PERSISTENT_PEERS="--p2p.persistent_peers $PERSISTENT_PEERS"
|
||||||
fi
|
fi
|
||||||
set -u
|
set -u
|
||||||
|
|
||||||
@ -20,5 +20,5 @@ cd "$GOPATH/src/github.com/tendermint/tendermint"
|
|||||||
docker network create --driver bridge --subnet 172.57.0.0/16 "$NETWORK_NAME"
|
docker network create --driver bridge --subnet 172.57.0.0/16 "$NETWORK_NAME"
|
||||||
|
|
||||||
for i in $(seq 1 "$N"); do
|
for i in $(seq 1 "$N"); do
|
||||||
bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$i" "$APP_PROXY" "$MANUAL_PEERS --p2p.pex --rpc.unsafe"
|
bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$i" "$APP_PROXY" "$PERSISTENT_PEERS --p2p.pex --rpc.unsafe"
|
||||||
done
|
done
|
||||||
|
@ -5,8 +5,8 @@ N=$1
|
|||||||
|
|
||||||
cd "$GOPATH/src/github.com/tendermint/tendermint"
|
cd "$GOPATH/src/github.com/tendermint/tendermint"
|
||||||
|
|
||||||
manual_peers="$(test/p2p/ip.sh 1):46656"
|
persistent_peers="$(test/p2p/ip.sh 1):46656"
|
||||||
for i in $(seq 2 $N); do
|
for i in $(seq 2 $N); do
|
||||||
manual_peers="$manual_peers,$(test/p2p/ip.sh $i):46656"
|
persistent_peers="$persistent_peers,$(test/p2p/ip.sh $i):46656"
|
||||||
done
|
done
|
||||||
echo "$manual_peers"
|
echo "$persistent_peers"
|
||||||
|
@ -19,13 +19,13 @@ for i in `seq 1 $N`; do
|
|||||||
done
|
done
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
# manual_peers need quotes
|
# persistent_peers need quotes
|
||||||
manual_peers="\"$(test/p2p/ip.sh 1):46656\""
|
persistent_peers="\"$(test/p2p/ip.sh 1):46656\""
|
||||||
for i in `seq 2 $N`; do
|
for i in `seq 2 $N`; do
|
||||||
manual_peers="$manual_peers,\"$(test/p2p/ip.sh $i):46656\""
|
persistent_peers="$persistent_peers,\"$(test/p2p/ip.sh $i):46656\""
|
||||||
done
|
done
|
||||||
echo $manual_peers
|
echo $persistent_peers
|
||||||
|
|
||||||
echo $manual_peers
|
echo $persistent_peers
|
||||||
IP=$(test/p2p/ip.sh 1)
|
IP=$(test/p2p/ip.sh 1)
|
||||||
curl --data-urlencode "manual_peers=[$manual_peers]" "$IP:46657/dial_manual_peers"
|
curl --data-urlencode "persistent_peers=[$persistent_peers]" "$IP:46657/dial_persistent_peers"
|
||||||
|
@ -11,5 +11,5 @@ cd $GOPATH/src/github.com/tendermint/tendermint
|
|||||||
echo "Test reconnecting from the address book"
|
echo "Test reconnecting from the address book"
|
||||||
bash test/p2p/pex/test_addrbook.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP
|
bash test/p2p/pex/test_addrbook.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP
|
||||||
|
|
||||||
echo "Test connecting via /dial_manual_peers"
|
echo "Test connecting via /dial_persistent_peers"
|
||||||
bash test/p2p/pex/test_dial_manual_peers.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP
|
bash test/p2p/pex/test_dial_persistent_peers.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP
|
||||||
|
@ -9,7 +9,7 @@ PROXY_APP=$4
|
|||||||
ID=1
|
ID=1
|
||||||
|
|
||||||
echo "----------------------------------------------------------------------"
|
echo "----------------------------------------------------------------------"
|
||||||
echo "Testing pex creates the addrbook and uses it if manual_peers are not provided"
|
echo "Testing pex creates the addrbook and uses it if persistent_peers are not provided"
|
||||||
echo "(assuming peers are started with pex enabled)"
|
echo "(assuming peers are started with pex enabled)"
|
||||||
|
|
||||||
CLIENT_NAME="pex_addrbook_$ID"
|
CLIENT_NAME="pex_addrbook_$ID"
|
||||||
@ -22,7 +22,7 @@ set +e #CIRCLE
|
|||||||
docker rm -vf "local_testnet_$ID"
|
docker rm -vf "local_testnet_$ID"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# NOTE that we do not provide manual_peers
|
# NOTE that we do not provide persistent_peers
|
||||||
bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$ID" "$PROXY_APP" "--p2p.pex --rpc.unsafe"
|
bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$ID" "$PROXY_APP" "--p2p.pex --rpc.unsafe"
|
||||||
docker cp "/tmp/addrbook.json" "local_testnet_$ID:/go/src/github.com/tendermint/tendermint/test/p2p/data/mach1/core/addrbook.json"
|
docker cp "/tmp/addrbook.json" "local_testnet_$ID:/go/src/github.com/tendermint/tendermint/test/p2p/data/mach1/core/addrbook.json"
|
||||||
echo "with the following addrbook:"
|
echo "with the following addrbook:"
|
||||||
@ -35,7 +35,7 @@ echo ""
|
|||||||
bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$CLIENT_NAME" "test/p2p/pex/check_peer.sh $ID $N"
|
bash test/p2p/client.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$CLIENT_NAME" "test/p2p/pex/check_peer.sh $ID $N"
|
||||||
|
|
||||||
echo "----------------------------------------------------------------------"
|
echo "----------------------------------------------------------------------"
|
||||||
echo "Testing other peers connect to us if we have neither manual_peers nor the addrbook"
|
echo "Testing other peers connect to us if we have neither persistent_peers nor the addrbook"
|
||||||
echo "(assuming peers are started with pex enabled)"
|
echo "(assuming peers are started with pex enabled)"
|
||||||
|
|
||||||
CLIENT_NAME="pex_no_addrbook_$ID"
|
CLIENT_NAME="pex_no_addrbook_$ID"
|
||||||
@ -46,7 +46,7 @@ set +e #CIRCLE
|
|||||||
docker rm -vf "local_testnet_$ID"
|
docker rm -vf "local_testnet_$ID"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# NOTE that we do not provide manual_peers
|
# NOTE that we do not provide persistent_peers
|
||||||
bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$ID" "$PROXY_APP" "--p2p.pex --rpc.unsafe"
|
bash test/p2p/peer.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$ID" "$PROXY_APP" "--p2p.pex --rpc.unsafe"
|
||||||
|
|
||||||
# if the client runs forever, it means other peers have removed us from their books (which should not happen)
|
# if the client runs forever, it means other peers have removed us from their books (which should not happen)
|
||||||
|
@ -11,7 +11,7 @@ ID=1
|
|||||||
cd $GOPATH/src/github.com/tendermint/tendermint
|
cd $GOPATH/src/github.com/tendermint/tendermint
|
||||||
|
|
||||||
echo "----------------------------------------------------------------------"
|
echo "----------------------------------------------------------------------"
|
||||||
echo "Testing full network connection using one /dial_manual_peers call"
|
echo "Testing full network connection using one /dial_persistent_peers call"
|
||||||
echo "(assuming peers are started with pex enabled)"
|
echo "(assuming peers are started with pex enabled)"
|
||||||
|
|
||||||
# stop the existing testnet and remove local network
|
# stop the existing testnet and remove local network
|
||||||
@ -21,16 +21,16 @@ set -e
|
|||||||
|
|
||||||
# start the testnet on a local network
|
# start the testnet on a local network
|
||||||
# NOTE we re-use the same network for all tests
|
# NOTE we re-use the same network for all tests
|
||||||
MANUAL_PEERS=""
|
PERSISTENT_PEERS=""
|
||||||
bash test/p2p/local_testnet_start.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP $MANUAL_PEERS
|
bash test/p2p/local_testnet_start.sh $DOCKER_IMAGE $NETWORK_NAME $N $PROXY_APP $PERSISTENT_PEERS
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# dial manual_peers from one node
|
# dial persistent_peers from one node
|
||||||
CLIENT_NAME="dial_manual_peers"
|
CLIENT_NAME="dial_persistent_peers"
|
||||||
bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $CLIENT_NAME "test/p2p/pex/dial_manual_peers.sh $N"
|
bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $CLIENT_NAME "test/p2p/pex/dial_persistent_peers.sh $N"
|
||||||
|
|
||||||
# test basic connectivity and consensus
|
# test basic connectivity and consensus
|
||||||
# start client container and check the num peers and height for all nodes
|
# start client container and check the num peers and height for all nodes
|
||||||
CLIENT_NAME="dial_manual_peers_basic"
|
CLIENT_NAME="dial_persistent_peers_basic"
|
||||||
bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $CLIENT_NAME "test/p2p/basic/test.sh $N"
|
bash test/p2p/client.sh $DOCKER_IMAGE $NETWORK_NAME $CLIENT_NAME "test/p2p/basic/test.sh $N"
|
||||||
|
@ -13,11 +13,11 @@ set +e
|
|||||||
bash test/p2p/local_testnet_stop.sh "$NETWORK_NAME" "$N"
|
bash test/p2p/local_testnet_stop.sh "$NETWORK_NAME" "$N"
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
MANUAL_PEERS=$(bash test/p2p/manual_peers.sh $N)
|
PERSISTENT_PEERS=$(bash test/p2p/persistent_peers.sh $N)
|
||||||
|
|
||||||
# start the testnet on a local network
|
# start the testnet on a local network
|
||||||
# NOTE we re-use the same network for all tests
|
# NOTE we re-use the same network for all tests
|
||||||
bash test/p2p/local_testnet_start.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" "$PROXY_APP" "$MANUAL_PEERS"
|
bash test/p2p/local_testnet_start.sh "$DOCKER_IMAGE" "$NETWORK_NAME" "$N" "$PROXY_APP" "$PERSISTENT_PEERS"
|
||||||
|
|
||||||
# test basic connectivity and consensus
|
# test basic connectivity and consensus
|
||||||
# start client container and check the num peers and height for all nodes
|
# start client container and check the num peers and height for all nodes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user