Skip to content
This repository has been archived by the owner on Jan 27, 2022. It is now read-only.

can not create new wallet with lndgrpc. #15

Open
ShaAmos opened this issue May 17, 2019 · 2 comments
Open

can not create new wallet with lndgrpc. #15

ShaAmos opened this issue May 17, 2019 · 2 comments

Comments

@ShaAmos
Copy link

ShaAmos commented May 17, 2019

hi there,
I can't create new wallet with lndgrpc. do you know what's the problem?

@adrienemery
Copy link
Owner

hi @ShaAmos I haven't implemented it yet unfortunately.

@ShaAmos
Copy link
Author

ShaAmos commented May 18, 2019

hi Adrienemery,
based on the lightning API and i can create the new wallet with below python3 code:
could you combine this to you python package ? i think you can do that better than me.

import grpc
import os, codecs
import rpc_pb2 as ln
import rpc_pb2_grpc as lnrpc

os.environ['GRPC_SSL_CIPHER_SUITES'] = 'HIGH+ECDSA'
cert = open('/Users/amos/Library/Application Support/Lnd/tls.cert', 'rb').read()
ssl_creds = grpc.ssl_channel_credentials(cert)
channel = grpc.secure_channel('localhost:10009', ssl_creds)
stub = lnrpc.WalletUnlockerStub(channel)
request = ln.GenSeedRequest()
response = stub.GenSeed(request)

myseed = str(response).split('\n') # convert the response to list from GenSeed function.
myGenSeed = []
mywords = []
for seeds in myseed:
seed = seeds.replace("cipher_seed_mnemonic: ","")
myGenSeed.append(seed)

for word in myGenSeed[:-2]:
myword = word.strip('"')
mywords.append(myword) # to get 24-word mnemonic
print(mywords)
print(type(mywords))

password = bytes('12345678',encoding='utf-8')
request2 = ln.InitWalletRequest(wallet_password=password,
cipher_seed_mnemonic=mywords)
wallet_response = stub.InitWallet(request2)
print(wallet_response)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants