You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[⚡️ Local Ark Regtest Environment](#️-local-ark-regtest-environment)
12
14
-[🏃 Running the Application](#-running-the-application)
13
15
-[📦 Building for Production](#-building-for-production)
14
16
-[📜 License](#-license)
@@ -26,128 +28,157 @@ Noah is a modern, self-custodial mobile wallet for Ark, a Bitcoin Layer 2 protoc
26
28
-**Data Fetching**: TanStack Query
27
29
-**Local Storage**: MMKV
28
30
-**Native Modules**: Nitro (Ark)
31
+
-**Development Environment**: Nix
29
32
30
33
---
31
34
32
-
## 🛠️ Prerequisites
35
+
## 🚀 Getting Started
33
36
34
-
Before you begin, ensure you have the following tools installed on your system:
37
+
You can set up the development environment using Nix (recommended) or by manually installing the dependencies.
35
38
36
-
-**Bun**: This project uses Bun for package management and script running. [Installation Guide](https://bun.sh/docs/installation).
37
-
-**Git**: For version control.
38
-
-**A code editor**: [Visual Studio Code](https://code.visualstudio.com/) is recommended.
39
-
-**iOS Development**:
40
-
- Xcode (from the Mac App Store)
41
-
- CocoaPods (`sudo gem install cocoapods`)
42
-
-**Android Development**:
43
-
- Android Studio & the Android SDK
44
-
- Java Development Kit (JDK)
39
+
### Using Nix (Recommended)
45
40
46
-
---
41
+
This project uses [Nix](https://nixos.org/) to provide a reproducible development environment. While most dependencies are managed by Nix, you will still need to install a few tools manually.
47
42
48
-
## 🚀 Getting Started
43
+
**Prerequisites:**
44
+
45
+
1.**Install Nix**: Follow the [official installation guide](https://docs.determinate.systems/).
46
+
2.**Install direnv**: This tool will automatically load the Nix environment when you enter the project directory. Follow the [direnv installation guide](https://direnv.net/docs/installation.html).
47
+
3.**Hook direnv into your shell**: Make sure to follow the instructions to hook direnv into your shell (e.g., add `eval "$(direnv hook zsh)"` to your `.zshrc`).
-**iOS (macOS only)**: Install [Xcode](https://developer.apple.com/xcode/) from the Mac App Store.
49
51
50
-
Follow these steps to get the project up and running on your local machine.
52
+
**Setup:**
51
53
52
54
1.**Clone the Repository**
55
+
53
56
```bash
54
57
git clone https://github.com/BlixtWallet/noah.git
55
58
cd noah
56
59
```
57
60
58
-
2. **Install JavaScript Dependencies**
59
-
This will install all the necessary packages defined in`package.json`.
61
+
2. **Allow direnv to load the environment**
62
+
This command will trigger Nix to build the development shell. It might take a while on the first run.
63
+
64
+
```bash
65
+
direnv allow
66
+
```
67
+
68
+
3. **Install JavaScript Dependencies**
69
+
Once the Nix shell is active, you can install the project's dependencies using Bun.
70
+
60
71
```bash
61
72
bun install
62
73
```
63
74
64
-
3. **Install iOS Dependencies**
65
-
This step links the native iOS libraries required by the project across all build targets.
75
+
4. **Install iOS Dependencies (for macOS users)**
76
+
This step links the native iOS libraries.
66
77
```bash
67
78
cd ios
68
-
pod install
79
+
bundle install
80
+
bundle exec pod install
69
81
cd ..
70
82
```
71
83
72
-
After these steps, the project is ready to run.
84
+
Now the project is ready to run.
73
85
74
-
---
86
+
### Bare Expo Setup
75
87
76
-
## 🏃 Running the Application
88
+
If you prefer not to use Nix, you can set up your environment manually. This project is a bare Expo project.
77
89
78
-
This project is configured with different build flavors for developmentand testing.
90
+
For a comprehensive guide on setting up your machine for bare Expo development, please refer to the **[Expo documentation](https://docs.expo.dev/get-started/set-up-your-environment/?mode=development-build&platform=android&device=simulated)**. This includes installing Node.js, Watchman, the Java Development Kit, Android Studio, and Xcode.
79
91
80
-
### 🤖 Android
92
+
Once your environment is set up, follow these steps:
81
93
82
-
Run one of the following commands to build and launch a specific Android flavor.
94
+
1. **Clone the Repository**
83
95
84
-
- **Mainnet:**
85
96
```bash
86
-
bun run android:mainnet
97
+
git clone https://github.com/BlixtWallet/noah.git
98
+
cd noah
87
99
```
88
-
- **Signet:**
100
+
101
+
2. **Install JavaScript Dependencies**
102
+
89
103
```bash
90
-
bun run android:signet
104
+
bun install
91
105
```
92
-
- **Regtest:**
106
+
107
+
3. **Install iOS Dependencies (for macOS users)**
93
108
```bash
94
-
bun run android:regtest
109
+
cd ios
110
+
pod install
111
+
cd ..
95
112
```
96
113
97
-
### 🍏 iOS
114
+
---
98
115
99
-
The iOS build system uses Xcode Schemes to differentiate between flavors. Each script specifies the correct scheme and build configuration (`Debug` or `Release`).
116
+
## ⚡️ Local Ark Regtest Environment
100
117
101
-
**Development (Debug) Builds:**
118
+
For development and testing, you can run a local Ark stack (bitcoind, aspd, bark) using Docker. The [`scripts/ark-dev.sh`](./scripts/ark-dev.sh) script helps manage this environment.
This clones the `bark` repository and prepares the Docker setup.
117
128
118
-
- **Mainnet:**
119
129
```bash
120
-
bun run ios:mainnet:release
130
+
./scripts/ark-dev.sh setup
121
131
```
122
-
- **Signet:**
132
+
133
+
2. **Start the services**
134
+
This will start `bitcoind`, `aspd`, and `bark` in the background.
135
+
123
136
```bash
124
-
bun run ios:signet:release
137
+
./scripts/ark-dev.sh up
125
138
```
126
-
- **Regtest:**
139
+
140
+
3. **Create and fund wallets**
141
+
- Create a Bitcoin Core wallet: `./scripts/ark-dev.sh create-wallet`
142
+
- Generate blocks to fund it: `./scripts/ark-dev.sh generate 101`
143
+
- Create a bark wallet: `./scripts/ark-dev.sh create-bark-wallet`
144
+
- Fund the ASPD: `./scripts/ark-dev.sh fund-aspd 1`
145
+
146
+
4. **Stop the services**
127
147
```bash
128
-
bun run ios:regtest:release
148
+
./scripts/ark-dev.sh down
129
149
```
130
150
151
+
For more commands and details, run `./scripts/ark-dev.sh` without arguments.
152
+
153
+
---
154
+
155
+
## 🏃 Running the Application
156
+
157
+
This project uses various scripts to run the application in different environments (Mainnet, Signet, Regtest).
158
+
159
+
Please see the `scripts` section in the [`package.json`](./package.json:5) file for a full list of available commands.
160
+
161
+
**Example (running on Android Regtest):**
162
+
163
+
```bash
164
+
bun run android:regtest:debug
165
+
```
166
+
167
+
**Example (running on iOS Regtest):**
168
+
169
+
```bash
170
+
bun run ios:regtest:debug
171
+
```
172
+
131
173
---
132
174
133
175
## 📦 Building for Production
134
176
135
-
The following scripts are configured to create standalone production-ready application binaries (`.apk` or `.aab`) for Android.
177
+
You can create production-ready application binaries using the build scripts.
136
178
137
-
**Note on Code Signing:** For production builds, you will need to configure your own signing keys. The Android build is currently configured to use the default debug keystore. Please refer to the [React Native documentation forsigning Android apps](https://reactnative.dev/docs/signed-apk-android).
179
+
Please see the `scripts` section in the [`package.json`](./package.json:5) file for commands starting with `build:`.
138
180
139
-
- **Build Mainnet Release:**
140
-
```bash
141
-
bun run build:android:mainnet:release
142
-
```
143
-
- **Build Signet Release:**
144
-
```bash
145
-
bun run build:android:signet:release
146
-
```
147
-
- **Build Regtest Release:**
148
-
```bash
149
-
bun run build:android:regtest:release
150
-
```
181
+
**Note on Code Signing:** For production builds, you will need to configure your own signing keys. Refer to the official React Native and Expo documentation for code signing on [Android](https://reactnative.dev/docs/signed-apk-android) and iOS.
0 commit comments