Browse Source
Merge pull request #1 from LN-Zap/move_host
move host to url authority component
make_cert_optional
Tom Kirkpatrick
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
4 additions and
4 deletions
-
lnd_connect_uri.md
-
lndconnect.go
|
|
@ -5,7 +5,7 @@ Zap-iOS can open URLs with the scheme `lndconnect:` to directly connect to remot |
|
|
|
### Syntax |
|
|
|
|
|
|
|
``` |
|
|
|
lndconnect:?cert=<base64url DER certifcate>&macaroon=<base64url macaroon>&host=<host> |
|
|
|
lndconnect://<host>:<port>?cert=<base64url DER certifcate>&macaroon=<base64url macaroon> |
|
|
|
``` |
|
|
|
|
|
|
|
### Javascript reference implementation |
|
|
@ -26,7 +26,7 @@ var macaroonPath = os.homedir() + '/.lnd/data/chain/bitcoin/testnet/admin.macaro |
|
|
|
var macaroonData = fs.readFileSync(macaroonPath); |
|
|
|
var macaroon = base64url(new Buffer(macaroonData)); |
|
|
|
|
|
|
|
var url = 'lndconnect:?cert=' + cert + '&macaroon=' + macaroon + '&host=' + ip.address() + ':10009' |
|
|
|
var url = 'lndconnect://' + ip.address() + ':10009?cert=' + cert + '&macaroon=' + macaroon |
|
|
|
``` |
|
|
|
|
|
|
|
## Example: |
|
|
@ -71,5 +71,5 @@ cml0ZQAABiAiUTBv3Eh6iDbdjmXCfNxp4HBEcOYNzXhrm+ncLHf5jA== |
|
|
|
### Zap connect URL |
|
|
|
|
|
|
|
``` |
|
|
|
lndconnect:?cert=MIICiDCCAi-gAwIBAgIQdo5v0QBXHnji4hRaeeMjNDAKBggqhkjOPQQDAjBHMR8wHQYDVQQKExZsbmQgYXV0b2dlbmVyYXRlZCBjZXJ0MSQwIgYDVQQDExtKdXN0dXNzLU1hY0Jvb2stUHJvLTMubG9jYWwwHhcNMTgwODIzMDU1ODEwWhcNMTkxMDE4MDU1ODEwWjBHMR8wHQYDVQQKExZsbmQgYXV0b2dlbmVyYXRlZCBjZXJ0MSQwIgYDVQQDExtK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CfNxp4HBEcOYNzXhrm-ncLHf5jA |
|
|
|
``` |
|
|
|
|
|
@ -96,7 +96,7 @@ func main() { |
|
|
|
ipString, fmt.Sprint(loadedConfig.LndConnect.Port), |
|
|
|
) |
|
|
|
|
|
|
|
urlString := fmt.Sprintf("lndconnect:?cert=%s&macaroon=%s&host=%s", certificate, macaroonB64, ipString) |
|
|
|
urlString := fmt.Sprintf("lndconnect://%s?cert=%s&macaroon=%s", ipString, certificate, macaroonB64) |
|
|
|
|
|
|
|
if loadedConfig.LndConnect.Json { |
|
|
|
fmt.Println(urlString) |
|
|
|