Skip to content

Commit

Permalink
protos
Browse files Browse the repository at this point in the history
  • Loading branch information
rsafier committed Dec 10, 2024
1 parent 91e13e9 commit 702bc76
Show file tree
Hide file tree
Showing 13 changed files with 194 additions and 14 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/nuget.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,10 @@ jobs:
dotnet pack /p:Version=$GITHUB_REF_NAME --configuration Release
package=$(ls bin/Release/LNUnit.LND.*.nupkg)
dotnet nuget push $package --api-key ${{ secrets.NUGET }} --source https://api.nuget.org/v3/index.json --skip-duplicate
# - name: Pack and Push NuGet Package LNBolt
# run: |
# cd LNBolt
# dotnet pack /p:Version=$GITHUB_REF_NAME --configuration Release
# package=$(ls bin/Release/LNBolt.*.nupkg)
# dotnet nuget push $package --api-key ${{ secrets.NUGET }} --source https://api.nuget.org/v3/index.json --skip-duplicate
#
#
- name: Pack and Push NuGet Package LNBolt
run: |
cd LNBolt
dotnet pack /p:Version=$GITHUB_REF_NAME --configuration Release
package=$(ls bin/Release/LNBolt.*.nupkg)
dotnet nuget push $package --api-key ${{ secrets.NUGET }} --source https://api.nuget.org/v3/index.json --skip-duplicate
33 changes: 33 additions & 0 deletions Docker/bitcoin/28.0/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
FROM debian:stable-slim

ARG BITCOIN_VERSION=28.0
ENV PATH=/opt/bitcoin-${BITCOIN_VERSION}/bin:$PATH

RUN apt-get update -y \
&& apt-get install -y curl gosu \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

RUN SYS_ARCH="$(uname -m)" \
&& curl -SLO https://bitcoincore.org/bin/bitcoin-core-${BITCOIN_VERSION}/bitcoin-${BITCOIN_VERSION}-${SYS_ARCH}-linux-gnu.tar.gz \
&& tar -xzf *.tar.gz -C /opt \
&& rm *.tar.gz

RUN curl -SLO https://raw.githubusercontent.com/bitcoin/bitcoin/master/contrib/bitcoin-cli.bash-completion \
&& mkdir /etc/bash_completion.d \
&& mv bitcoin-cli.bash-completion /etc/bash_completion.d/ \
&& curl -SLO https://raw.githubusercontent.com/scop/bash-completion/master/bash_completion \
&& mv bash_completion /usr/share/bash-completion/

COPY docker-entrypoint.sh /entrypoint.sh
COPY bashrc /home/bitcoin/.bashrc

RUN chmod a+x /entrypoint.sh

VOLUME ["/home/bitcoin/.bitcoin"]

EXPOSE 18443 18444 28334 28335

ENTRYPOINT ["/entrypoint.sh"]

CMD ["bitcoind"]
8 changes: 8 additions & 0 deletions Docker/bitcoin/28.0/bashrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# enable bash completion in interactive shells
if ! shopt -oq posix; then
if [ -f /usr/share/bash-completion/bash_completion ]; then
. /usr/share/bash-completion/bash_completion
elif [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
fi
29 changes: 29 additions & 0 deletions Docker/bitcoin/28.0/docker-entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#!/bin/sh
set -e

# containers on linux share file permissions with hosts.
# assigning the same uid/gid from the host user
# ensures that the files can be read/write from both sides
if ! id bitcoin > /dev/null 2>&1; then
USERID=${USERID:-1000}
GROUPID=${GROUPID:-1000}

echo "adding user bitcoin ($USERID:$GROUPID)"
groupadd -f -g $GROUPID bitcoin
useradd -r -u $USERID -g $GROUPID bitcoin
chown -R $USERID:$GROUPID /home/bitcoin
fi

if [ $(echo "$1" | cut -c1) = "-" ]; then
echo "$0: assuming arguments for bitcoind"

set -- bitcoind "$@"
fi

if [ "$1" = "bitcoind" ] || [ "$1" = "bitcoin-cli" ] || [ "$1" = "bitcoin-tx" ]; then
echo "Running as bitcoin user: $@"
exec gosu bitcoin "$@"
fi

echo "$@"
exec "$@"
18 changes: 18 additions & 0 deletions LNUnit.LND/Grpc/devrpc/dev.proto
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,25 @@ service Dev {
used for development.
*/
rpc ImportGraph (lnrpc.ChannelGraph) returns (ImportGraphResponse);

/*
Quiesce instructs a channel to initiate the quiescence (stfu) protocol. This
RPC is for testing purposes only. The commit that adds it will be removed
once interop is confirmed.
*/
rpc Quiesce (QuiescenceRequest) returns (QuiescenceResponse);
}

message ImportGraphResponse {
}

message QuiescenceRequest {
// The channel point of the channel we wish to quiesce
lnrpc.ChannelPoint chan_id = 1;
}

message QuiescenceResponse {
// Indicates whether or not we hold the initiator role or not once the
// negotiation completes
bool initiator = 1;
}
6 changes: 6 additions & 0 deletions LNUnit.LND/Grpc/invoicesrpc/invoices.proto
Original file line number Diff line number Diff line change
Expand Up @@ -242,4 +242,10 @@ message HtlcModifyResponse {
// HTLC carries other valuable items, as can be the case with custom channel
// types.
optional uint64 amt_paid = 2;

// This flag indicates whether the HTLCs associated with the invoices should
// be cancelled. The interceptor client may set this field if some
// unexpected behavior is encountered. Setting this will ignore the amt_paid
// field.
bool cancel_set = 3;
}
58 changes: 57 additions & 1 deletion LNUnit.LND/Grpc/lightning.proto
Original file line number Diff line number Diff line change
Expand Up @@ -643,6 +643,8 @@ message SendCustomMessageRequest {
}

message SendCustomMessageResponse {
// The status of the send operation.
string status = 1;
}

message Utxo {
Expand Down Expand Up @@ -755,11 +757,35 @@ message GetTransactionsRequest {

// An optional filter to only include transactions relevant to an account.
string account = 3;

/*
The index of a transaction that will be used in a query to determine which
transaction should be returned in the response.
*/
uint32 index_offset = 4;

/*
The maximal number of transactions returned in the response to this query.
This value should be set to 0 to return all transactions.
*/
uint32 max_transactions = 5;
}

message TransactionDetails {
// The list of transactions relevant to the wallet.
repeated Transaction transactions = 1;

/*
The index of the last item in the set of returned transactions. This can be
used to seek further, pagination style.
*/
uint64 last_index = 2;

/*
The index of the last item in the set of returned transactions. This can be
used to seek backwards, pagination style.
*/
uint64 first_index = 3;
}

message FeeLimit {
Expand Down Expand Up @@ -1317,13 +1343,17 @@ message ConnectPeerRequest {
uint64 timeout = 3;
}
message ConnectPeerResponse {
// The status of the connect operation.
string status = 1;
}

message DisconnectPeerRequest {
// The pubkey of the node to disconnect from
string pub_key = 1;
}
message DisconnectPeerResponse {
// The status of the disconnect operation.
string status = 1;
}

message HTLC {
Expand Down Expand Up @@ -1388,8 +1418,14 @@ enum CommitmentType {
A channel that uses musig2 for the funding output, and the new tapscript
features where relevant.
*/
// TODO(roasbeef): need script enforce mirror type for the above as well?
SIMPLE_TAPROOT = 5;

/*
Identical to the SIMPLE_TAPROOT channel type, but with extra functionality.
This channel type also commits to additional meta data in the tapscript
leaves for the scripts in a channel.
*/
SIMPLE_TAPROOT_OVERLAY = 6;
}

message ChannelConstraints {
Expand Down Expand Up @@ -3536,6 +3572,8 @@ message NetworkInfo {
message StopRequest {
}
message StopResponse {
// The status of the stop operation.
string status = 1;
}

message GraphTopologySubscription {
Expand Down Expand Up @@ -4360,9 +4398,13 @@ message DeleteAllPaymentsRequest {
}

message DeletePaymentResponse {
// The status of the delete operation.
string status = 1;
}

message DeleteAllPaymentsResponse {
// The status of the delete operation.
string status = 1;
}

message AbandonChannelRequest {
Expand All @@ -4379,6 +4421,8 @@ message AbandonChannelRequest {
}

message AbandonChannelResponse {
// The status of the abandon operation.
string status = 1;
}

message DebugLevelRequest {
Expand Down Expand Up @@ -4538,6 +4582,15 @@ message PolicyUpdateRequest {
// Optional inbound fee. If unset, the previously set value will be
// retained [EXPERIMENTAL].
InboundFee inbound_fee = 10;

// Under unknown circumstances a channel can exist with a missing edge in
// the graph database. This can cause an 'edge not found' error when calling
// `getchaninfo` and/or cause the default channel policy to be used during
// forwards. Setting this flag will recreate the edge if not found, allowing
// updating this channel policy and fixing the missing edge problem for this
// channel permanently. For fields not set in this command, the default
// policy will be created.
bool create_missing_edge = 11;
}

enum UpdateFailure {
Expand Down Expand Up @@ -4718,12 +4771,15 @@ message RestoreChanBackupRequest {
}
}
message RestoreBackupResponse {
// The number of channels successfully restored.
uint32 num_restored = 1;
}

message ChannelBackupSubscription {
}

message VerifyChanBackupResponse {
repeated string chan_points = 1;
}

message MacaroonPermission {
Expand Down
12 changes: 12 additions & 0 deletions LNUnit.LND/Grpc/looprpc/client.proto
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,12 @@ service SwapClient {
*/
rpc GetLsatTokens (TokensRequest) returns (TokensResponse);

/* loop: `fetchl402`
FetchL402Token fetches an L402 token from the server, this is required in
order to receive reservation notifications from the server.
*/
rpc FetchL402Token (FetchL402TokenRequest) returns (FetchL402TokenResponse);

/* loop: `getinfo`
GetInfo gets basic information about the loop daemon.
*/
Expand Down Expand Up @@ -830,6 +836,12 @@ message TokensResponse {
repeated L402Token tokens = 1;
}

message FetchL402TokenRequest {
}

message FetchL402TokenResponse {
}

message L402Token {
/*
The base macaroon that was baked by the auth server.
Expand Down
4 changes: 4 additions & 0 deletions LNUnit.LND/Grpc/routerrpc/router.proto
Original file line number Diff line number Diff line change
Expand Up @@ -1063,6 +1063,10 @@ message ForwardHtlcInterceptResponse {
// Any custom records that should be set on the p2p wire message message of
// the resumed HTLC. This field is ignored if the action is not
// RESUME_MODIFIED.
//
// This map will merge with the existing set of custom records (if any),
// replacing any conflicting types. Note that there currently is no support
// for deleting existing custom records (they can only be replaced).
map<uint64, bytes> out_wire_custom_records = 8;
}

Expand Down
19 changes: 17 additions & 2 deletions LNUnit.LND/Grpc/walletrpc/walletkit.proto
Original file line number Diff line number Diff line change
Expand Up @@ -222,14 +222,14 @@ service WalletKit {
*/
rpc SendOutputs (SendOutputsRequest) returns (SendOutputsResponse);

/*
/* lncli: `wallet estimatefeerate`
EstimateFee attempts to query the internal fee estimator of the wallet to
determine the fee (in sat/kw) to attach to a transaction in order to
achieve the confirmation target.
*/
rpc EstimateFee (EstimateFeeRequest) returns (EstimateFeeResponse);

/* lncli: `pendingsweeps`
/* lncli: `wallet pendingsweeps`
PendingSweeps returns lists of on-chain outputs that lnd is currently
attempting to sweep within its central batching engine. Outputs with similar
fee rates are batched together in order to sweep them within a single
Expand Down Expand Up @@ -414,6 +414,8 @@ message ReleaseOutputRequest {
}

message ReleaseOutputResponse {
// The status of the release operation.
string status = 1;
}

message KeyReq {
Expand Down Expand Up @@ -699,6 +701,8 @@ message ImportPublicKeyRequest {
AddressType address_type = 2;
}
message ImportPublicKeyResponse {
// The status of the import operation.
string status = 1;
}

message ImportTapscriptRequest {
Expand Down Expand Up @@ -1318,6 +1322,8 @@ message LabelTransactionRequest {
}

message LabelTransactionResponse {
// The status of the label operation.
string status = 1;
}

// The possible change address types for default accounts and single imported
Expand Down Expand Up @@ -1388,6 +1394,12 @@ message FundPsbtRequest {
input with.
*/
uint64 sat_per_vbyte = 4;

/*
The fee rate, expressed in sat/kWU, that should be used to spend the
input with.
*/
uint64 sat_per_kw = 11;
}

/*
Expand All @@ -1411,6 +1423,9 @@ message FundPsbtRequest {

// The strategy to use for selecting coins during funding the PSBT.
lnrpc.CoinSelectionStrategy coin_selection_strategy = 10;

// The max fee to total output amount ratio that this psbt should adhere to.
double max_fee_ratio = 12;
}
message FundPsbtResponse {
/*
Expand Down
2 changes: 1 addition & 1 deletion LNUnit.LND/LNUnit.LND.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<Nullable>enable</Nullable>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageId>LNUnit.LND</PackageId>
<Version>1.7.4</Version>
<Version>1.7.6</Version>
<PackageDescription>LNUnit LND Typed Clients</PackageDescription>
<TargetFramework>net8.0</TargetFramework>
<LangVersion>12.0</LangVersion>
Expand Down
2 changes: 1 addition & 1 deletion LNUnit.Tests/Abstract/AbcLightningAbstractTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public async Task OneTimeSetup()
}

await _client.CreateDockerImageFromPath("../../../../Docker/lnd", ["custom_lnd", "custom_lnd:latest"]);
await _client.CreateDockerImageFromPath("./../../../../Docker/bitcoin/27.1", ["bitcoin:latest", "bitcoin:27.1"]);
await _client.CreateDockerImageFromPath("./../../../../Docker/bitcoin/28.0", ["bitcoin:latest", "bitcoin:28.0"]);
await SetupNetwork(_lndImage, _tag, _lndRoot, _pullImage);
}

Expand Down
Loading

0 comments on commit 702bc76

Please sign in to comment.