Skip to content

Commit 51b8b2f

Browse files
Documentation cleanup with new naming convention for the application version
1 parent 00be567 commit 51b8b2f

File tree

12 files changed

+8393
-5601
lines changed

12 files changed

+8393
-5601
lines changed

.github/docs/Contributing.md

Lines changed: 129 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,129 @@
1-
Development
2-
-----------
3-
* Clone the project: git clone https://github.com/ElementsProject/cln-application.git
4-
* Change directory: cd cln-application
5-
* Install dependencies: Assuming that nodejs (v14 & above) and npm are already installed, run `npm install`.
6-
* Setup environment variables: Assuming that bitcoind and core-lightning are already running, adjust environment variables listed in `./env.sh` file and execute the script with `'. env.sh'` to setup required environment variables to connect to the node.
7-
* Setup Commando auth: Update `LIGHTNING_PUBKEY` and `LIGHTNING_RUNE` variables in `.commando` for successful backend authentication and connection via commando. Or run `entrypoint.sh` with correct lightningd path to do the same.
8-
* Run backend server: Get backend server up by running `npm run backend:serve`.
9-
* Watch backend server: Watch backend server for realtime changes with `npm run backend:watch`.
10-
* React frontend server: React development server is set to serve on port 4300. Run `npm run frontend:dev` script to get it working.
11-
12-
13-
Releasing and packaging on Github
14-
----------------------------------
15-
* Merge the `Release-<x.y.z>` branch into `main` branch.
16-
* Set VERSION env `VERSION=v<x.y.z>`.
17-
* Tag the commit with `git tag -a -s ${VERSION} -m ${VERSION} && git push --tags`.
18-
* Go to repo's `Releases` page and draft a new release from above tag.
19-
* Prepare release notes with the help of milestone, issues and PRs. Add them on the release page.
20-
* Signing the release:
21-
** `mkdir -p ./release & git archive --format zip --output ./release/cln-application-${VERSION}.zip main`
22-
** `cd release`
23-
** `sha256sum cln* > SHA256SUMS`
24-
** `gpg -sb --armor -o SHA256SUMS.asc SHA256SUMS`
25-
* Verify the release with `gpg --verify SHA256SUMS.asc`.
26-
* Upload `cln-application-${VERSION}.zip`, `SHA256SUMS` and `SHA256SUMS.asc` files on release assets.
27-
* Go to repo's `Actions` tab and confirm that actions have been triggered for `Artifact` and `Build and publish Github image`.
28-
* Confirm that both actions finished successfully and the latest package is available at `https://github.com/orgs/ElementsProject/packages?repo_name=cln-application`.
1+
Development Setup
2+
------------------
3+
### Prerequisites
4+
- Node.js (v14 or higher)
5+
- npm
6+
- Running instances of bitcoind and core-lightning
7+
8+
### Installation
9+
#### Clone the repository:
10+
11+
```sh
12+
git clone https://github.com/ElementsProject/cln-application.git
13+
cd cln-application
14+
```
15+
16+
#### Install dependencies:
17+
18+
```sh
19+
npm install
20+
```
21+
22+
#### Configure environment:
23+
24+
```sh
25+
cp env.sh env-local.sh
26+
# Edit env-local.sh with your configuration
27+
source env-local.sh
28+
```
29+
30+
#### Set up Commando authentication:
31+
- Manually update `LIGHTNING_PUBKEY` and `LIGHTNING_RUNE` in your `LIGHTNING_VARS_FILE`
32+
- OR Run the setup script:
33+
34+
```sh
35+
source entrypoint.sh
36+
```
37+
38+
Running the Application
39+
------------------------
40+
### Backend server:
41+
42+
```sh
43+
npm run backend:watch
44+
npm run backend:serve
45+
```
46+
47+
### Frontend development server (port 4300):
48+
```sh
49+
npm run frontend:dev
50+
```
51+
52+
Creating a Pull Request
53+
------------------------
54+
- Fork the repository on GitHub
55+
- Create a feature branch:
56+
57+
```sh
58+
git checkout -b feat/your-feature-name
59+
```
60+
- Commit your changes:
61+
62+
```sh
63+
git commit -m "feat: description of your changes"
64+
```
65+
- Push to your fork:
66+
67+
```sh
68+
git push fork feat/your-feature-name
69+
```
70+
- Open a PR against the next-release branch
71+
- Include clear description
72+
- Add relevant labels
73+
- Request reviews from maintainers
74+
75+
- Code Standards
76+
- Include tests for new features
77+
- Update documentation when adding/changing functionality
78+
- Keep commits atomic and well-described
79+
80+
- Basic Git Workflow:
81+
<p align="center">
82+
<img src="../images/basic-git-flow.jpg" alt="Basic Github Workflow">
83+
</p>
84+
85+
Release Process
86+
----------------
87+
88+
- Merge the release branch into main:
89+
90+
```sh
91+
git checkout main
92+
git merge Release-yy.mm.n
93+
```
94+
- Create versioned tag:
95+
96+
```sh
97+
export VERSION=vyy.mm.n
98+
git tag -a -s $VERSION -m "$VERSION"
99+
git push --tags
100+
```
101+
102+
- Creating the Release On GitHub:
103+
- Go to Repository → Releases → Draft new release
104+
- Select the tag you created
105+
- Add release notes summarizing changes
106+
107+
- Package and sign the release:
108+
109+
```sh
110+
mkdir -p ./release
111+
git archive --format zip --output ./release/cln-application-${VERSION}.zip main
112+
cd release
113+
sha256sum cln* > SHA256SUMS
114+
gpg -sb --armor -o SHA256SUMS.asc SHA256SUMS
115+
```
116+
117+
- Verify the signature:
118+
119+
```sh
120+
gpg --verify SHA256SUMS.asc
121+
```
122+
123+
- Upload to GitHub:
124+
- Add cln-application-${VERSION}.zip
125+
- Add SHA256SUMS and SHA256SUMS.asc
126+
127+
- Post-Release Checks
128+
- Verify CI/CD pipelines complete successfully
129+
- Confirm package availability at: https://github.com/orgs/ElementsProject/packages?repo_name=cln-application

.github/images/basic-git-flow.jpg

128 KB
Loading

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -52,30 +52,33 @@
5252
This application accepts & depends upon these variables to be passed through environment:
5353
5454
```
55-
- BITCOIN_HOST: Hostname/IP address of bitcoin node container (configurable to run lightningd with `--bitcoin-rpcconnect`, default: `localhost`)
56-
- BITCOIN_NETWORK: Bitcoin network type (for entrypoint.sh and lightningd with `--network`; valid values: bitcoin/signet/testnet/regtest; default: `bitcoin`)
55+
# Required by entrypoint.sh script
56+
- LIGHTNING_DATA_DIR: Path for core lightning (used by entrypoint.sh, default: ``)
57+
- BITCOIN_NETWORK: Bitcoin network type (for entrypoint.sh; valid values: bitcoin/signet/testnet/regtest; default: `bitcoin`)
5758
59+
# cln-application Values
5860
- APP_SINGLE_SIGN_ON: Flag to bypass application level authentication (valid values: true/false, default: false)
5961
- APP_PROTOCOL: Protocol on which the application will be served (valid values: http/https, default: `http`)
6062
- APP_HOST: Hostname/IP address of cln-application's container (default: `localhost`)
6163
- APP_PORT: Port on which this application should be served (default: `2103`)
62-
6364
- APP_CONFIG_FILE: Path for cln-application's configuration file (default: `./config.json`)
6465
- APP_LOG_FILE: Path for cln-application's log file (default: `./application-cln.log`)
6566
- APP_MODE: Mode for logging and other settings (valid values: production/development/testing, default: `production`)
6667
- APP_CONNECT: Choose how to connect to CLN (valid values: COMMANDO/REST/GRPC, default: `COMMANDO`)
6768
68-
- LIGHTNING_DATA_DIR: Path for core lightning (used by entrypoint.sh, default: ``)
69+
# Core lightning Values
6970
- LIGHTNING_HOST: IP address of Core lightning node container (used for `COMMANDO` APP_CONNECT, default: `localhost`)
7071
- LIGHTNING_TOR_HOST: REST hidden service url (default: ``)
71-
7272
- LIGHTNING_VARS_FILE: Full Path including the file name for connection auth with LIGHTNING_PUBKEY & LIGHTNING_RUNE (defult: `./.commando-env`)
73+
74+
# CLN Commando (WS) Values
7375
- LIGHTNING_WS_PROTOCOL: Core lightning's web socket is serving on ws or serving via WSSProxy (valid values: ws/wss, default: `ws`)
7476
- LIGHTNING_WS_PORT: Core lightning's websocket port (used by `COMMANDO` APP_CONNECT; with `bind-addr=ws:`/`wss-bind-addr` in CLN config; default: `5001`)
7577
- LIGHTNING_WS_CLIENT_KEY_FILE: Client key file path including file name for websocket TLS authentication (used by `COMMANDO` APP_CONNECT and `wss` LIGHTNING_WS_PROTOCOL; default: `./client-key.pem`)
7678
- LIGHTNING_WS_CLIENT_CERT_FILE: Client certificate file path including file name for websocket TLS authentication (used by `COMMANDO` APP_CONNECT and `wss` LIGHTNING_WS_PROTOCOL; default: `./client.pem`)
7779
- LIGHTNING_WS_CA_CERT_FILE: CA certificate file path including file name for websocket TLS authentication (default: `./ca.pem`)
7880
81+
# CLN REST Values
7982
- LIGHTNING_REST_PROTOCOL: Protocol on which REST is served (valid values: http/https, default: `https`)
8083
- LIGHTNING_REST_HOST: IP address/hostname of Core Lightning REST interface (used if APP_CONNECT is `REST`, default: `localhost`)
8184
- LIGHTNING_REST_TOR_HOST: Tor hidden service URL for Core Lightning REST interface (default: ``)
@@ -84,6 +87,7 @@
8487
- LIGHTNING_REST_CLIENT_CERT_FILE: Client certificate file path including file name for REST TLS authentication (default: `./client.pem`)
8588
- LIGHTNING_REST_CA_CERT_FILE: CA certificate file path including file name for REST TLS authentication (used by `REST` APP_CONNECT and `https` LIGHTNING_REST_PROTOCOL; default: `./ca.pem`)
8689
90+
# CLN gRPC Values
8791
- LIGHTNING_GRPC_HOST: IP address/hostname of Core Lightning GRPC interface (used if APP_CONNECT is `GRPC`, default: `localhost`)
8892
- LIGHTNING_GRPC_TOR_HOST: Tor hidden service URL for Core Lightning GRPC interface (default: ``)
8993
- LIGHTNING_GRPC_PORT: Core lightning's GRPC port (used if APP_CONNECT is `GRPC`; default: `9736`)

apps/backend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cln-application-backend",
3-
"version": "0.0.8",
3+
"version": "25.07",
44
"description": "Core lightning application backend",
55
"private": true,
66
"license": "MIT",

apps/backend/source/shared/consts.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ export const SECRET_KEY = crypto.randomBytes(64).toString('hex');
3535

3636
export const DEFAULT_ENV_VALUES = {
3737
APP_SINGLE_SIGN_ON: 'false',
38-
BITCOIN_HOST: 'localhost',
3938
BITCOIN_NETWORK: 'bitcoin',
4039
APP_PROTOCOL: 'http',
4140
APP_HOST: 'localhost',
@@ -72,7 +71,6 @@ export const DEFAULT_ENV_VALUES = {
7271

7372
export const APP_CONSTANTS = {
7473
APP_SINGLE_SIGN_ON: process.env.APP_SINGLE_SIGN_ON || DEFAULT_ENV_VALUES.APP_SINGLE_SIGN_ON,
75-
BITCOIN_HOST: process.env.BITCOIN_HOST || DEFAULT_ENV_VALUES.BITCOIN_HOST,
7674
BITCOIN_NETWORK: process.env.BITCOIN_NETWORK || DEFAULT_ENV_VALUES.BITCOIN_NETWORK,
7775
APP_PROTOCOL: process.env.APP_PROTOCOL || DEFAULT_ENV_VALUES.APP_PROTOCOL,
7876
APP_HOST: process.env.APP_HOST || DEFAULT_ENV_VALUES.APP_HOST,

apps/frontend/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "cln-application-frontend",
3-
"version": "0.0.8",
3+
"version": "25.07",
44
"description": "Core lightning application frontend",
55
"private": true,
66
"license": "MIT",

apps/frontend/src/types/root.type.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ export type NodeInfo = {
5454
export type WalletConnect = {
5555
isLoading: boolean;
5656
APP_SINGLE_SIGN_ON?: boolean;
57-
BITCOIN_HOST?: string;
5857
BITCOIN_NETWORK?: string;
5958
APP_PROTOCOL?: string;
6059
APP_HOST?: string;

apps/frontend/src/utilities/test-utilities/mockData.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,6 @@ export const mockShowToast = {
226226
export const mockConnectWallet = {
227227
isLoading: false,
228228
APP_SINGLE_SIGN_ON: false,
229-
BITCOIN_HOST: "localhost",
230229
BITCOIN_NETWORK: "regtest",
231230
APP_PROTOCOL: "http",
232231
APP_HOST: "localhost",
@@ -258,7 +257,7 @@ export const mockConnectWallet = {
258257
LIGHTNING_GRPC_CLIENT_KEY_FILE: "/home/network/regtest/grpc/client-key.pem",
259258
LIGHTNING_GRPC_CLIENT_CERT_FILE: "/home/network/regtest/grpc/client.pem",
260259
LIGHTNING_GRPC_CA_CERT_FILE: "/home/network/regtest/grpc/ca.pem",
261-
APP_VERSION: "0.0.8",
260+
APP_VERSION: "25.07",
262261
NODE_PUBKEY: "nodepubkey123456nodepubkey123456nodepubkey123456nodepubkey123456",
263262
ADMIN_RUNE: "adminrune==",
264263
INVOICE_RUNE: mockInvoiceRune.rune,

0 commit comments

Comments
 (0)