diff --git a/.gitignore b/.gitignore index de0cdd09..13534782 100644 --- a/.gitignore +++ b/.gitignore @@ -120,3 +120,7 @@ modifiedDate\.txt ipfs\.out clusterDriver\.out + +\.node-xmlhttprequest-sync-8770 + +\.node-xmlhttprequest-sync-1849 diff --git a/Driver.py b/Driver.py index bc39e83e..492b74df 100755 --- a/Driver.py +++ b/Driver.py @@ -59,13 +59,13 @@ def isSlurmOn(): yes = set(['yes', 'y', 'ye']); no = set(['no' , 'n']); - if constants.WHOAMI == '': print('Once please run: bash initialize.sh'); sys.exit(); -isContractExist = os.popen('python $contractCallPath/isContractExist.py $clusterID').read(); -if isContractExist == 'False': +isContractExist = os.popen('python $contractCallPath/isContractExist.py').read(); + +if 'False' in isContractExist: print('Please check that you are using eBloc-blockchain.'); sys.exit(); diff --git a/contractCalls/isContractExist.py b/contractCalls/isContractExist.py index 894fc1a8..a7de73ea 100644 --- a/contractCalls/isContractExist.py +++ b/contractCalls/isContractExist.py @@ -17,8 +17,8 @@ contractAddress = web3.toChecksumAddress(contractAddress); eBlocBroker = web3.eth.contract(contractAddress, abi=abi); -if __name__ == '__main__': #{ - if web3.eth.getCode(contractAddress) == '0x': +if __name__ == '__main__': #{ + if web3.eth.getCode(contractAddress) == '0x' or web3.eth.getCode(contractAddress) == b'': print('False') else: print('True') diff --git a/initialize.sh b/initialize.sh index b703b718..c6128ee8 100644 --- a/initialize.sh +++ b/initialize.sh @@ -56,6 +56,7 @@ else exit fi fi + source $HOME/.profile currentDir=$PWD; @@ -118,7 +119,7 @@ sudo sed -i.bak "s/^\(MailProg=\).*/\1$var\/slurmScript.sh/" /usr/local/etc/slur grep "MailProg" /usr/local/etc/slurm.conf # IPFS setups -sudo chown -R "$logname:$logname" ~/.ipfs/ +sudo chown -R "$logname:$logname" $HOME/.ipfs/ echo -e "Note: Update the following file 'eudatPassword.txt' with your EUDAT account's password. \nBest to make sure the file is not readable or even listable for anyone but you. You achieve this with:\n 'chmod 700 eudatPassword.txt'"