Skip to content

Commit

Permalink
Merge pull request EOSIO#136 from enumivo/staging
Browse files Browse the repository at this point in the history
use enuwalletd
  • Loading branch information
Enumivo authored May 18, 2018
2 parents dcd16db + 3b44489 commit fc3c00e
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 37 deletions.
4 changes: 2 additions & 2 deletions contracts/enumivolib/rpc.dox
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ Before you can query `enudaemon` you must first enable the necessary API plugin(
plugin = enumivo::chain_api_plugin // Enable Chain API
plugin = enumivo::wallet_api_plugin // Enable Wallet API
```
Alternatively, for Wallet API, you can also have the wallet functionality separate from `enudaemon`, by running `eos-walletd` separately.
Alternatively, for Wallet API, you can also have the wallet functionality separate from `enudaemon`, by running `enuwalletd` separately.

For the following guide, we will assume that we have `enudaemon` running on `127.0.0.1:8888` (Chain API Plugin enabled, Wallet API Plugin disabled) and `eos-walletd` running on `127.0.0.1:8889`.
For the following guide, we will assume that we have `enudaemon` running on `127.0.0.1:8888` (Chain API Plugin enabled, Wallet API Plugin disabled) and `enuwalletd` running on `127.0.0.1:8889`.

===

Expand Down
4 changes: 2 additions & 2 deletions plugins/wallet_plugin/wallet_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ std::string wallet_manager::create(const std::string& name) {
wallet->unlock(password);

// If we have name in our map then remove it since we want the emplace below to replace.
// This can happen if the wallet file is removed while enu-walletd is running.
// This can happen if the wallet file is removed while enuwalletd is running.
auto it = wallets.find(name);
if (it != wallets.end()) {
wallets.erase(it);
Expand All @@ -74,7 +74,7 @@ void wallet_manager::open(const std::string& name) {
}

// If we have name in our map then remove it since we want the emplace below to replace.
// This can happen if the wallet file is added while enu-walletd is running.
// This can happen if the wallet file is added while enuwalletd is running.
auto it = wallets.find(name);
if (it != wallets.end()) {
wallets.erase(it);
Expand Down
6 changes: 3 additions & 3 deletions programs/enucli/eosc.pot
Original file line number Diff line number Diff line change
Expand Up @@ -136,10 +136,10 @@ msgstr ""
msgid "the port where enudaemon is running"
msgstr ""

msgid "the host where enu-walletd is running"
msgid "the host where enuwalletd is running"
msgstr ""

msgid "the port where enu-walletd is running"
msgid "the port where enuwalletd is running"
msgstr ""

msgid "output verbose messages on error"
Expand Down Expand Up @@ -499,7 +499,7 @@ msgstr ""
msgid "Failed to connect to enu at ${ip}:${port}; is enudaemon running?"
msgstr ""

msgid "Failed to connect to enu-walletd at ${ip}:${port}; is enu-walletd running?"
msgid "Failed to connect to enuwalletd at ${ip}:${port}; is enuwalletd running?"
msgstr ""

msgid "Failed to connect"
Expand Down
6 changes: 3 additions & 3 deletions tests/consensus-validation-malicious-producers.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ def error(msg="", errorCode=1):
def myTest(transWillEnterBlock):
testSuccessful=False

cluster=testUtils.Cluster(walletd=True, staging=True)
cluster=testUtils.Cluster(enuwalletd=True, staging=True)
walletMgr=testUtils.WalletMgr(True)

try:
Expand All @@ -261,9 +261,9 @@ def myTest(transWillEnterBlock):
currencyAccount=accounts[0]
currencyAccount.name="currency0000"

Print("Stand up walletd")
Print("Stand up enuwalletd")
if walletMgr.launch() is False:
error("Failed to stand up enu walletd.")
error("Failed to stand up enuwalletd.")
return False

testWalletName="test"
Expand Down
2 changes: 1 addition & 1 deletion tests/distributed-transactions-test.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def errorExit(msg="", errorCode=1):
testSuccessful=False

random.seed(seed) # Use a fixed seed for repeatability.
cluster=testUtils.Cluster(walletd=True)
cluster=testUtils.Cluster(enuwalletd=True)
walletMgr=testUtils.WalletMgr(True)

try:
Expand Down
10 changes: 5 additions & 5 deletions tests/enunode_run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def cmdError(name, cmdCode=0, exitNow=False):

testUtils.Utils.Debug=debug
localTest=True if server == LOCAL_HOST else False
cluster=testUtils.Cluster(walletd=True, enableMongo=enableMongo, defproduceraPrvtKey=defproduceraPrvtKey, defproducerbPrvtKey=defproducerbPrvtKey)
cluster=testUtils.Cluster(enuwalletd=True, enableMongo=enableMongo, defproduceraPrvtKey=defproduceraPrvtKey, defproducerbPrvtKey=defproducerbPrvtKey)
walletMgr=testUtils.WalletMgr(True)
testSuccessful=False
killEnuInstances=not dontKill
killWallet=not dontKill

WalletdName="enuwallet"
EnuWalletDName="enuwallet"
ClientName="enucli"
# testUtils.Utils.setMongoSyncTime(50)

Expand Down Expand Up @@ -127,12 +127,12 @@ def cmdError(name, cmdCode=0, exitNow=False):
exchangeAccount.ownerPrivateKey=PRV_KEY2
exchangeAccount.ownerPublicKey=PUB_KEY2

Print("Stand up walletd")
Print("Stand up enuwalletd")
walletMgr.killall()
walletMgr.cleanup()
if walletMgr.launch() is False:
cmdError("%s" % (WalletdName))
errorExit("Failed to stand up enu walletd.")
cmdError("%s" % (EnuWalletDName))
errorExit("Failed to stand up enuwalletd.")

testWalletName="test"
Print("Creating wallet \"%s\"." % (testWalletName))
Expand Down
10 changes: 5 additions & 5 deletions tests/nodeos_run_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def cmdError(name, cmdCode=0, exitNow=False):

testUtils.Utils.Debug=debug
localTest=True if server == LOCAL_HOST else False
cluster=testUtils.Cluster(walletd=True, enableMongo=enableMongo, defproduceraPrvtKey=defproduceraPrvtKey, defproducerbPrvtKey=defproducerbPrvtKey)
cluster=testUtils.Cluster(enuwalletd=True, enableMongo=enableMongo, defproduceraPrvtKey=defproduceraPrvtKey, defproducerbPrvtKey=defproducerbPrvtKey)
walletMgr=testUtils.WalletMgr(True)
testSuccessful=False
killEnuInstances=not dontKill
killWallet=not dontKill

WalletdName="enuwallet"
EnuWalletDName="enuwallet"
ClientName="enucli"
# testUtils.Utils.setMongoSyncTime(50)

Expand Down Expand Up @@ -124,12 +124,12 @@ def cmdError(name, cmdCode=0, exitNow=False):
exchangeAccount.ownerPrivateKey=PRV_KEY2
exchangeAccount.ownerPublicKey=PUB_KEY2

Print("Stand up walletd")
Print("Stand up enuwalletd")
walletMgr.killall()
walletMgr.cleanup()
if walletMgr.launch() is False:
cmdError("%s" % (WalletdName))
errorExit("Failed to stand up enu walletd.")
cmdError("%s" % (EnuWalletDName))
errorExit("Failed to stand up enuwalletd.")

testWalletName="test"
Print("Creating wallet \"%s\"." % (testWalletName))
Expand Down
10 changes: 5 additions & 5 deletions tests/p2p_network_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
parser.add_argument("--impaired_network", help="test impaired network", action='store_true')
parser.add_argument("--lossy_network", help="test lossy network", action='store_true')
parser.add_argument("--stress_network", help="test load/stress network", action='store_true')
parser.add_argument("--not_kill_wallet", help="not killing walletd", action='store_true')
parser.add_argument("--not_kill_wallet", help="not killing enuwalletd", action='store_true')

args = parser.parse_args()
testOutputFile=args.output
Expand All @@ -58,7 +58,7 @@
else:
errorExit("one of impaired_network, lossy_network or stress_network must be set. Please also check peer configs in p2p_test_peers.py.")

cluster=testUtils.Cluster(walletd=True, enableMongo=enableMongo, defproduceraPrvtKey=defproduceraPrvtKey, defproducerbPrvtKey=defproducerbPrvtKey, walletHost=args.wallet_host, walletPort=args.wallet_port)
cluster=testUtils.Cluster(enuwalletd=True, enableMongo=enableMongo, defproduceraPrvtKey=defproduceraPrvtKey, defproducerbPrvtKey=defproducerbPrvtKey, walletHost=args.wallet_host, walletPort=args.wallet_port)

print("BEGIN")
print("TEST_OUTPUT: %s" % (testOutputFile))
Expand Down Expand Up @@ -107,10 +107,10 @@
exchangeAccount.ownerPrivateKey=PRV_KEY2
exchangeAccount.ownerPublicKey=PUB_KEY2

print("Stand up walletd")
print("Stand up enuwalletd")
if walletMgr.launch() is False:
cmdError("%s" % (WalletdName))
errorExit("Failed to stand up enu walletd.")
cmdError("%s" % (EnuWalletDName))
errorExit("Failed to stand up enuwalletd.")

testWalletName="test"
Print("Creating wallet \"%s\"." % (testWalletName))
Expand Down
22 changes: 11 additions & 11 deletions tests/testUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -1064,9 +1064,9 @@ class WalletMgr(object):
__walletDataDir="test_wallet_0"

# pylint: disable=too-many-arguments
# walletd [True|False] True=Launch wallet(enuwallet) process; False=Manage launch process externally.
def __init__(self, walletd, enunodePort=8888, enunodeHost="localhost", port=8899, host="localhost"):
self.walletd=walletd
# enuwalletd [True|False] True=Launch wallet(enuwallet) process; False=Manage launch process externally.
def __init__(self, enuwalletd, enunodePort=8888, enunodeHost="localhost", port=8899, host="localhost"):
self.enuwalletd=enuwalletd
self.enunodePort=enunodePort
self.enunodeHost=enunodeHost
self.port=port
Expand All @@ -1075,12 +1075,12 @@ def __init__(self, walletd, enunodePort=8888, enunodeHost="localhost", port=8899
self.__walletPid=None
self.endpointArgs="--url http://%s:%d" % (self.enunodeHost, self.enunodePort)
self.walletEndpointArgs=""
if self.walletd:
if self.enuwalletd:
self.walletEndpointArgs += " --wallet-url http://%s:%d" % (self.host, self.port)
self.endpointArgs += self.walletEndpointArgs

def launch(self):
if not self.walletd:
if not self.enuwalletd:
Utils.Print("ERROR: Wallet Manager wasn't configured to launch enuwallet")
return False

Expand Down Expand Up @@ -1244,10 +1244,10 @@ class Cluster(object):
__BiosPort=8788

# pylint: disable=too-many-arguments
# walletd [True|False] Is enuwallet running. If not load the wallet plugin
def __init__(self, walletd=False, localCluster=True, host="localhost", port=8888, walletHost="localhost", walletPort=8899, enableMongo=False, mongoHost="localhost", mongoPort=27017, mongoDb="ENUtest", defproduceraPrvtKey=None, defproducerbPrvtKey=None, staging=False):
# enuwalletd [True|False] Is enuwallet running. If not load the wallet plugin
def __init__(self, enuwalletd=False, localCluster=True, host="localhost", port=8888, walletHost="localhost", walletPort=8899, enableMongo=False, mongoHost="localhost", mongoPort=27017, mongoDb="ENUtest", defproduceraPrvtKey=None, defproducerbPrvtKey=None, staging=False):
"""Cluster container.
walletd [True|False] Is wallet enuwallet running. If not load the wallet plugin
enuwalletd [True|False] Is wallet enuwallet running. If not load the wallet plugin
localCluster [True|False] Is cluster local to host.
host: enu server host
port: enu server port
Expand All @@ -1263,7 +1263,7 @@ def __init__(self, walletd=False, localCluster=True, host="localhost", port=8888
self.nodes={}
self.localCluster=localCluster
self.wallet=None
self.walletd=walletd
self.enuwalletd=enuwalletd
self.enableMongo=enableMongo
self.mongoHost=mongoHost
self.mongoPort=mongoPort
Expand All @@ -1274,7 +1274,7 @@ def __init__(self, walletd=False, localCluster=True, host="localhost", port=8888
self.walletHost=walletHost
self.walletPort=walletPort
self.walletEndpointArgs=""
if self.walletd:
if self.enuwalletd:
self.walletEndpointArgs += " --wallet-url http://%s:%d" % (self.walletHost, self.walletPort)
self.mongoEndpointArgs=""
self.mongoUri=""
Expand Down Expand Up @@ -1328,7 +1328,7 @@ def launch(self, pnodes=1, totalNodes=1, prodCount=1, topo="mesh", delay=1, only
cmdArr.append("--nogen")

enunodeArgs="--max-transaction-time 5000"
if not self.walletd:
if not self.enuwalletd:
enunodeArgs += " --plugin enumivo::wallet_api_plugin"
if self.enableMongo:
enunodeArgs += " --plugin enumivo::mongo_db_plugin --resync --mongodb-uri %s" % self.mongoUri
Expand Down

0 comments on commit fc3c00e

Please sign in to comment.