Ben would like to peer with Stefan. So he logs into his server running ILP kit and runs:
$ ilp-admin help
Usage: ilp-admin [command] ...
peer list List my peers
peer add Add a new peer (interactive)
peer remove Remove an existing peer
$ ilp-admin peer add
Who would you like to peer with? (Enter hostname, e.g. red.ilpdemo.org)
nexus.justmoon.com
What should the currency of the trustline be? (default: USD) (my currency)
USD
How much can the other side borrow before they have to settle? (in USD)
2000
Which MQTT broker would you like to use? (default: mqtt.ripple.com)
mqtt.ripple.com
Generating…. done!
Internally, ILP Kit CLI will query the destination hostname using a well-known URI:
GET /.well-known/ilp-kit.json HTTP/1.1
Host: nexus.justmoon.com
Accept: application/json
HTTP/1.1 200 OK
Content-Type: application/json
{
"publicKey": "n++1M9z7NkgUmqkRw7IkEHmlXArUlJrCi+pN7yL7KWs",
"ledger": "https://nexus.justmoon.com/ledger"
}
ILP Kit CLI generates the plugin configuration which looks like this:
{
// MQTT broker to use
broker: 'mqtt.ripple.com',
// Peer's public key
peerPublicKey: 'n++1M9z7NkgUmqkRw7IkEHmlXArUlJrCi+pN7yL7KWs',
// The most credit that we are willing to extend
maxBalance: '100'
}
When running the plugin, the connector will inject two additional properties:
{
// Key/value store (provided by connector)
_store: {},
// Some kind of connector-provided secret that stays constant
_privateKey: 'HyjOMnubNVmYwOrEMjidQ+JaBhXyT3maOZ39y8tf5eI=',
// …
}