-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bolt8 transport for electrum protocol #8049
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -327,6 +327,14 @@ async def setconfig(self, key, value): | |
self.config.set_key(key, value) | ||
return True | ||
|
||
@command('') | ||
async def create_key_for_server(self, server_pubkey:str) -> str: | ||
" returns a pubkey to add to electrumx, using the 'add_user' RPC" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we add import/export functionality? I guess it would be easier and cleaner not to, but tell users instead to generate new keys instead. Maybe this could be mentioned in the docstring. However, in time I expect users will ask for it. E.g. consider operating a server for your friends: generating a new key requires user-interaction/cooperation. Anyway, I guess it's easier to ignore this for now. |
||
privkey = os.urandom(32) | ||
pubkey = ecc.ECPrivkey(privkey).get_public_key_bytes(compressed=True) | ||
self.config.set_bolt8_privkey_for_server(server_pubkey, privkey.hex()) | ||
return pubkey.hex() | ||
|
||
@command('') | ||
async def get_ssl_domain(self): | ||
"""Check and return the SSL domain set in ssl_keyfile and ssl_certfile | ||
|
@@ -1241,8 +1249,8 @@ async def get_channel_ctx(self, channel_point, iknowwhatimdoing=False, wallet: A | |
|
||
@command('wnl') | ||
async def get_watchtower_ctn(self, channel_point, wallet: Abstract_Wallet = None): | ||
""" return the local watchtower's ctn of channel. used in regtests """ | ||
return await self.network.local_watchtower.sweepstore.get_ctn(channel_point, None) | ||
""" return the remote watchtower's ctn of channel. used in regtests """ | ||
return await self.network.watchtower_get_ctn(channel_point, None) | ||
|
||
@command('wnl') | ||
async def rebalance_channels(self, from_scid, dest_scid, amount, wallet: Abstract_Wallet = None): | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find this name confusing. Both the client and the server ultimately has keypair(s). So which one is
create_key_for_server
creating a keypair for?How about
create_userkey_for_server
?