Skip to content

Commit

Permalink
Merge pull request #6 from lightningj-org/support_lnd_0_4_1_beta
Browse files Browse the repository at this point in the history
Support LND 0.4.1-beta
  • Loading branch information
herrvendil authored Apr 3, 2018
2 parents 9056e1e + 4cd289d commit 292e61d
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
group 'org.lightningj'

version '0.4-Beta'
version '0.4.1-Beta'

apply plugin: "groovy"
apply plugin: 'com.google.protobuf'
Expand Down
9 changes: 5 additions & 4 deletions docs/index.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,12 @@ to the license agreement can be found link:LICENSE.txt[here].

== Whats New

* 0.4-Beta : API generated from LDN rpc.proto for LND 0.4-Beta tag. Also check out
* 0.4.1-Beta : Generated API from LND 0.4.1 Beta release.
* 0.4-Beta : API generated from LDN rpc.proto for LND 0.4-Beta tag. Also check out
the new grails plugin as link:http://grails.lightningj.org[]
* 0.3-Beta : Z-Base32 encoder/decoder, updated API to support new Wallet Seed generation.
* 0.2-Beta : Added support for Macaroons authentication.
* 0.1-Beta : This is the initial release with generated APIs (Synchronous and Asynchronous) for
* 0.3-Beta : Z-Base32 encoder/decoder, updated API to support new Wallet Seed generation.
* 0.2-Beta : Added support for Macaroons authentication.
* 0.1-Beta : This is the initial release with generated APIs (Synchronous and Asynchronous) for
LND.

=== Roadmap
Expand Down
25 changes: 18 additions & 7 deletions src/main/proto/lightning.api.proto
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* This file is fetched from https://github.com/lightningnetwork/lnd/blob/master/lnrpc/rpc.proto
* And is distributed under LNDs MIT License.
* LND 0.4-Beta tag : Downloaded 2018-03-16
* LND 0.4.1-Beta tag : Downloaded 2018-04-03
*/
syntax = "proto3";

Expand All @@ -10,6 +10,7 @@ import "google/api/annotations.proto";
package lnrpc;

option java_package = "org.lightningj.lnd.proto";

/**
* Comments in this file will be directly parsed into the API
* Documentation as descriptions of the associated method, message, or field.
Expand Down Expand Up @@ -750,7 +751,7 @@ message HTLC {
uint32 expiration_height = 4 [json_name = "expiration_height"];
}

message ActiveChannel {
message Channel {
/// Whether this channel is active or not
bool active = 1 [json_name = "active"];

Expand Down Expand Up @@ -789,7 +790,7 @@ message ActiveChannel {
int64 commit_fee = 8 [json_name = "commit_fee"];

/// The weight of the commitment transaction
int64 commit_weight = 9 [ json_name = "commit_weight" ];
int64 commit_weight = 9 [json_name = "commit_weight"];

/**
The required number of satoshis per kilo-weight that the requester will pay
Expand Down Expand Up @@ -826,14 +827,21 @@ message ActiveChannel {
closed, we'll need to wait for this many blocks before we can regain our
funds.
*/
uint32 csv_delay = 16 [ json_name = "csv_delay" ];
uint32 csv_delay = 16 [json_name = "csv_delay"];

/// Whether this channel is advertised to the network or not
bool private = 17 [json_name = "private"];
}

message ListChannelsRequest {
bool active_only = 1;
bool inactive_only = 2;
bool public_only = 3;
bool private_only = 4;
}
message ListChannelsResponse {
/// The list of active channels
repeated ActiveChannel channels = 11 [json_name = "channels"];
repeated Channel channels = 11 [json_name = "channels"];
}

message Peer {
Expand Down Expand Up @@ -972,17 +980,20 @@ message OpenChannelRequest {
/// The number of satoshis to push to the remote side as part of the initial commitment state
int64 push_sat = 5 [json_name = "push_sat"];

/// The target number of blocks that the closure transaction should be confirmed by.
/// The target number of blocks that the funding transaction should be confirmed by.
int32 target_conf = 6;

/// A manual fee rate set in sat/byte that should be used when crafting the closure transaction.
/// A manual fee rate set in sat/byte that should be used when crafting the funding transaction.
int64 sat_per_byte = 7;

/// Whether this channel should be private, not announced to the greater network.
bool private = 8 [json_name = "private"];

/// The minimum value in millisatoshi we will require for incoming HTLCs on the channel.
int64 min_htlc_msat = 9 [json_name = "min_htlc_msat"];

/// The delay we require on the remote's commitment transaction. If this is not set, it will be scaled automatically with the channel size.
uint32 remote_csv_delay = 10 [json_name = "remote_csv_delay"];
}
message OpenStatusUpdate {
oneof update {
Expand Down
8 changes: 5 additions & 3 deletions src/test/groovy/org/lightningj/lnd/wrapper/MessageSpec.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class MessageSpec extends Specification {

def "Verify that toJsonAsString returns json in string format"(){
expect:
genOpenChannelRequest().toJsonAsString(false) == '{"node_pubkey":"","node_pubkey_string":"02ad1fddad0c572ec3e886cbea31bbafa30b5f7e745da7e936ed9d1471116cdc02","local_funding_amount":40000,"push_sat":25000,"targetConf":0,"satPerByte":0,"private":false,"min_htlc_msat":0}'
genOpenChannelRequest().toJsonAsString(false) == '{"node_pubkey":"","node_pubkey_string":"02ad1fddad0c572ec3e886cbea31bbafa30b5f7e745da7e936ed9d1471116cdc02","local_funding_amount":40000,"push_sat":25000,"targetConf":0,"satPerByte":0,"private":false,"min_htlc_msat":0,"remote_csv_delay":0}'
genOpenChannelRequest().toJsonAsString(true) == """
{
"node_pubkey": "",
Expand All @@ -68,7 +68,8 @@ class MessageSpec extends Specification {
"targetConf": 0,
"satPerByte": 0,
"private": false,
"min_htlc_msat": 0
"min_htlc_msat": 0,
"remote_csv_delay": 0
}"""
}

Expand Down Expand Up @@ -97,7 +98,8 @@ class MessageSpec extends Specification {
"targetConf": 0,
"satPerByte": 0,
"private": false,
"min_htlc_msat": 0
"min_htlc_msat": 0,
"remote_csv_delay": 0
}"""
}
Expand Down

0 comments on commit 292e61d

Please sign in to comment.