|
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 |
0 commit comments