Browse Source

formatted seed words

master
Christian Rotzoll 6 years ago
parent
commit
ea20f51f0a
  1. 4
      home.admin/70initLND.sh
  2. 21
      home.admin/config.scripts/lnd.initwallet.py

4
home.admin/70initLND.sh

@ -187,8 +187,8 @@ if [ ${walletExists} -eq 0 ]; then
ack=0 ack=0
while [ ${ack} -eq 0 ] while [ ${ack} -eq 0 ]
do do
whiptail --title "IMPORTANT - PLEASE WRITE DOWN" --msgbox "LND Wallet got created. Store these numbered words in a safe location:" 8 76 whiptail --title "IMPORTANT - PLEASE WRITE DOWN" --msgbox "LND Wallet got created. Store these numbered words in a safe location:\n${seedwords}" 8 76
whiptail --title "Please Confirm" --yes-button "Show Again" --no-button "CONTINUE" --yesno " Are you sure that you wrote down the word list?\n${seedwords}" 8 55 whiptail --title "Please Confirm" --yes-button "Show Again" --no-button "CONTINUE" --yesno " Are you sure that you wrote down the word list?" 8 55
if [ $? -eq 1 ]; then if [ $? -eq 1 ]; then
ack=1 ack=1
fi fi

21
home.admin/config.scripts/lnd.initwallet.py

@ -57,15 +57,24 @@ channel = grpc.secure_channel('localhost:10009', ssl_creds)
stub = lnrpc.WalletUnlockerStub(channel) stub = lnrpc.WalletUnlockerStub(channel)
if mode=="new": if mode=="new":
#request = ln.GenSeedRequest(
# aezeed_passphrase=<bytes>
#)
request = ln.GenSeedRequest() request = ln.GenSeedRequest()
try: try:
response = stub.GenSeed(request) response = stub.GenSeed(request)
seedwords = response.cipher_seed_mnemonic seedwords = response.cipher_seed_mnemonic
seedwordsString=','.join(seedwords) seedwordsString=','.join(seedwords)
print("seedwords='"+seedwordsString+"'") print("seedwords='"+seedwordsString+"'")
# add a 6x4 formatted version to the output
seedwords6x4=""
for i in range(0,len(seedwords)):
if (i % 6 == 0) && (i != 0):
seedwords6x4=seedwords6x4+"\n"
singleWord=(i+1)+":"+seedwords[i]
while len(singleWord)<12
singleWord=singleWord+" "
seedwords6x4=seedwords6x4+singleWord
print("seedwords6x4='"+seedwords6x4+"'")
except grpc.RpcError as err: except grpc.RpcError as err:
# - wallet might already exist # - wallet might already exist
print("err='grpc.RpcError'") print("err='grpc.RpcError'")
@ -76,12 +85,6 @@ if mode=="new":
print >> sys.stderr, err print >> sys.stderr, err
sys.exit(1) sys.exit(1)
# TODO: do first https://api.lightning.community/#genseed
#if len(seedpassword)>0:
# request = ln.InitWalletRequest(wallet_password=base64.b64encode(walletpassword.decode(),aezeed_passphrase=base64.b64encode(seedpassword).decode())
#else:
request = ln.InitWalletRequest( request = ln.InitWalletRequest(
wallet_password=walletpassword, wallet_password=walletpassword,
cipher_seed_mnemonic=seedwords cipher_seed_mnemonic=seedwords

Loading…
Cancel
Save