Skip to content

Commit

Permalink
fixed naming inconsistencies pubkey->nodeId
Browse files Browse the repository at this point in the history
  • Loading branch information
pm47 committed Apr 25, 2017
1 parent 66cb538 commit 8589294
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ option | description | default value

method | params | description
-------------|-----------------------------------------------|-----------------------------------------------------------
connect | host, port, pubkey | connect to another lightning node through a secure connection
open | host, port, pubkey, fundingSatoshis, pushMsat | opens a channel with another lightning node
connect | host, port, nodeId | connect to another lightning node through a secure connection
open | host, port, nodeId, fundingSatoshis, pushMsat | opens a channel with another lightning node
peers | | list existing local peers
channels | | list existing local channels
channel | channelId | retrieve detailed information about a given channel
Expand Down
16 changes: 8 additions & 8 deletions eclair-node/src/main/scala/fr/acinq/eclair/api/Service.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,10 @@ trait Service extends Logging {
entity(as[JsonRPCBody]) {
req =>
val f_res: Future[AnyRef] = req match {
case JsonRPCBody(_, _, "connect", JString(host) :: JInt(port) :: JString(pubkey) :: Nil) =>
(switchboard ? NewConnection(PublicKey(pubkey), new InetSocketAddress(host, port.toInt), None)).mapTo[String]
case JsonRPCBody(_, _, "open", JString(host) :: JInt(port) :: JString(pubkey) :: JInt(fundingSatoshi) :: JInt(pushMsat) :: Nil) =>
(switchboard ? NewConnection(PublicKey(pubkey), new InetSocketAddress(host, port.toInt), Some(NewChannel(Satoshi(fundingSatoshi.toLong), MilliSatoshi(pushMsat.toLong))))).mapTo[String]
case JsonRPCBody(_, _, "connect", JString(host) :: JInt(port) :: JString(nodeId) :: Nil) =>
(switchboard ? NewConnection(PublicKey(nodeId), new InetSocketAddress(host, port.toInt), None)).mapTo[String]
case JsonRPCBody(_, _, "open", JString(host) :: JInt(port) :: JString(nodeId) :: JInt(fundingSatoshi) :: JInt(pushMsat) :: Nil) =>
(switchboard ? NewConnection(PublicKey(nodeId), new InetSocketAddress(host, port.toInt), Some(NewChannel(Satoshi(fundingSatoshi.toLong), MilliSatoshi(pushMsat.toLong))))).mapTo[String]
case JsonRPCBody(_, _, "peers", _) =>
(switchboard ? 'peers).mapTo[Iterable[PublicKey]].map(_.map(_.toBin))
case JsonRPCBody(_, _, "channels", _) =>
Expand All @@ -101,14 +101,14 @@ trait Service extends Logging {
getChannel(channelIdHex).flatMap(_ ? CMD_CLOSE(scriptPubKey = None)).mapTo[String]
case JsonRPCBody(_, _, "help", _) =>
Future.successful(List(
"connect (host, port, pubkey): connect to another lightning node through a secure connection",
"open (host, port, pubkey, fundingSatoshi, pushMsat): open a channel with another lightning node",
"connect (host, port, nodeId): connect to another lightning node through a secure connection",
"open (host, port, nodeId, fundingSatoshi, pushMsat): open a channel with another lightning node",
"peers: list existing local peers",
"channels: list existing local channels",
"channel (channelIdHex): retrieve detailed informations about a given channel",
"channel (channelIdHex): retrieve detailed information about a given channel",
"network: list all the nodes announced in network",
"receive (amountMsat): generate a payment request for a given amount",
"send (amountMsat, paymentHash, pubkey): send a payment to a lightning node",
"send (amountMsat, paymentHash, nodeId): send a payment to a lightning node",
"close (channelIdHex): close a channel",
"close (channelIdHex, scriptPubKey): close a channel and send the funds to the given scriptPubKey",
"help: display this message"))
Expand Down

0 comments on commit 8589294

Please sign in to comment.