Skip to content

Commit

Permalink
Bugfix, choosing a free port to run client in a test (hyperledger#70)
Browse files Browse the repository at this point in the history
* using the correct mechanism to choose random port

* show node registry only when it is non empty and do not show the message of missing pool transaction file on startup (hyperledger#68)

* update help message for 'missing genesis txns file'

* Revert "update help message for 'missing genesis txns file'"

This reverts commit 4b15c4b.

* update help message for 'missing genesis txns file'

* show help info aoubt  when  trigger

* Revert "show help info aoubt  when  trigger"

This reverts commit 730e74c.

* show 'missing genesis txn' help text only when 'connect test' is trigger

* show node registery only if available

Signed-off-by: Lovesh Harchandani <[email protected]>
Sign-off-executed-by: toktar <[email protected]>
Approved-at: h-master
  • Loading branch information
lovesh authored Feb 21, 2017
1 parent 26ec829 commit bf01b8d
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 11 deletions.
9 changes: 0 additions & 9 deletions plenum/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,15 +259,6 @@ def __init__(self, looper, basedirpath, nodeReg=None, cliNodeReg=None,
if nodeReg:
self.print("Node registry loaded.")
self.showNodeRegistry()
else:
msg = """
The information required to connect this client to the nodes cannot be found.
This is an error. To correct the error, get the file containing genesis transactions
(the file name is `{}`) from the github repository and place it in directory
`{}`. The github url is {}.\n""".format(self.config.poolTransactionsFile,
self.config.baseDir,
self.githubUrl)
self.print(msg)

self.print("Type 'help' for more information.")
self.print("Running {} {}\n".format(self.properName,
Expand Down
4 changes: 2 additions & 2 deletions plenum/common/script_helper.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import os
import random

from jsonpickle import json

from ledger.stores.text_file_store import TextFileStore
from plenum.client.client import Client
from plenum.client.wallet import Wallet
from plenum.common.eventually import eventually
from plenum.common.port_dispenser import genHa
from plenum.common.raet import initLocalKeep, getLocalVerKey, getLocalPubKey
from plenum.common.signer_simple import SimpleSigner
from plenum.common.txn import TXN_TYPE, TARGET_NYM, DATA, NODE_IP, \
Expand Down Expand Up @@ -250,7 +250,7 @@ def changeHA(looper, config, nodeName, nodeSeed, newNodeHA,
stewardWallet.addIdentifier(signer=stewardSigner)

# prepare client to submit change ha request to sovrin
randomClientPort = random.randint(9700, 9799)
_, randomClientPort = genHa()
client = Client(stewardName,
ha=('0.0.0.0', randomClientPort), config=config)
looper.add(client)
Expand Down

0 comments on commit bf01b8d

Please sign in to comment.