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
Copy file name to clipboardExpand all lines: README.md
+75-22Lines changed: 75 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,71 @@ This node is used by Rootstock PowPeg signatories to interact with the Bridge co
21
21
## Software installation help
22
22
Disclaimer: this documentation will be specific for macOS operating system.
23
23
24
-
### **Java JDK 1.8**
24
+
### Quick Setup
25
+
26
+
1. Install Java OpenJDK 1.8 from the binaries (if it is not installed yet)
27
+
1. You can download it from here: `https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2021-05-08-08-14/OpenJDK8U-jdk_x64_mac_hotspot_2021-05-08-08-14.tar.gz`
28
+
1.`cd` to the directory where you want to download it. It could be like `cd /Library/Java/JavaVirtualMachines/`
29
+
2. Download it like this: `sudo curl -o adoptopenjdk-8.tar.gz -L https://github.com/AdoptOpenJDK/openjdk8-binaries/releases/download/jdk8u-2021-05-08-08-14/OpenJDK8U-jdk_x64_mac_hotspot_2021-05-08-08-14.tar.gz`
30
+
3. Unzip it like this: `sudo tar -zxvf adoptopenjdk-8.tar.gz`
31
+
4. The unzipped directory could be named like this `jdk8u302-b01`. Run an `ls` command to see it.
32
+
2. Add it to the `.bash_profile`.
33
+
1. Open the `.bash_profile` file with `nano` like this `nano ~/.bash_profile` and add the following 2 `export` lines:
4. Save it and run the command: `source ~/.bash_profile` and restart the terminal. After this, the `java -version` command should return info.
37
+
2. Install bitcoind
38
+
1.`cd` to the directory where you want to download it. It could be `/Library/Bitcoin` (if it doesn't exit, you can create it running the command `sudo mkdir /Library/Bitcoin`)
39
+
2. You can download version 0.18.1 (ideal for regtest) from here: `https://bitcoincore.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-osx64.tar.gz`
40
+
3. You can download version 24.0.1 `https://bitcoincore.org/bin/bitcoin-core-24.0.1/bitcoin-24.0.1-x86_64-apple-darwin.tar.gz`
41
+
4. Download it like this: `sudo curl -o bitcoind18.tar.gz -L https://bitcoincore.org/bin/bitcoin-core-0.18.1/bitcoin-0.18.1-osx64.tar.gz`
42
+
5. Unzip it like this: `sudo tar -zxvf bitcoind18.tar.gz`
43
+
6. Run the `ls` command to see the actual name of the unzipped directory. It should be like `bitcoin-0.18.1`
44
+
7. Add the path `export PATH="$PATH:/Library/Bitcoin/bitcoin-0.18.1/bin"` to the `/.zshrc` file
45
+
1. Open the `.zshrc` file with nano like this: `nano ~/.zshrc` and add the following line in it and save it: `export PATH="$PATH:/Library/Bitcoin/bitcoin-0.18.1/bin"`
46
+
8. Run `source ~/.zshrc` command, close and reopen the terminal.
47
+
9. Running an instance of bitcoind
48
+
1. To run it in regtest mode, run this command: `bitcoind -deprecatedrpc=generate -addresstype=legacy -regtest -printtoconsole -server -rpcuser=rsk -rpcpassword=rsk -rpcport=18332 -txindex -datadir=/Library/Bitcoin/data`
49
+
2. You can also put this command into an `bitcoin-regtest.sh` file, make it executable with `sudo chmod +x bitcoin-regtest.sh` and run it like `./bitcoin-regtest.sh`
50
+
3. To run it in regular mode, simply run the command: `bitcoind`
51
+
10. Generate some blocks
52
+
1. To generate, for example, 200 regtest bitcoin blocks, run: `./btc-regtest.sh generate 200`
53
+
3. Create a `powpeg-project` folder anywhere you like
54
+
1. For example: `mkdir /Library/powpeg-project`
55
+
4. Setup the rskj project
56
+
1.`cd` to the `powpeg-project` directory: `cd /Library/powpeg-project`
57
+
2. Clone it from here: `https://github.com/rsksmart/rskj`
3.`cd` to the cloned `powpeg-node` directory: `cd powpeg-node`
67
+
4. Run the `configure.sh` file present in the root directory
68
+
1. You will probably have to make it executable with: `sudo chmod +x configure.sh`
69
+
2. And run it from a terminal like this: `./configure.sh`
70
+
5. Make a copy of the `development-settings.gradle.sample` file and rename it to `DONT-COMMIT-settings.gradle`
71
+
1. Remove the line `# Sample configuration to build rskj from the directory /home/user/another/dir/rskj`
72
+
2. Remove the line `# Rename it to DONT-COMMIT-settings.gradle for use in your local environment`
73
+
3. Replace the `'/home/user/another/dir/rskj/'` with the relative or absolute path where the `rskj` project is, for example: `/Library/powpeg-project/rskj`
74
+
6. Create a `fed.conf` file and set it up
75
+
1. Check the config file sample in `src/main/resources/config/fed-sample.conf`, copy it, rename it to `fed.conf` and update it as you need.
76
+
7. Optionally create a `logback.xml` file for the logging
77
+
1. Check the config file sample in `src/main/resources/config/logback-sample.xml`, copy it, rename it to `logback.xml` and update it as you need, adding or removing classes and their log level.
78
+
8. Build the powpeg project
79
+
1. Run: `./gradlew clean build`
80
+
2. To build it without running the tests, run: `./gradlew clean build -x test`
81
+
3.`cd` into `/Library/powpeg-project/powpeg-node/build/libs/` directory to see the version of the `federate-node-SNAPSHOT-<version>-all.jar` file, so you can run it in the following step.
82
+
9. Run the project
83
+
1. Resetting the rsk db (replace `<version>` with the actual version of the `.jar`): `java -cp /Library/powpeg-project/powpeg-node/build/libs/federate-node-SNAPSHOT-<version>-all.jar -Drsk.conf.file=/Library/powpeg-project/powpeg-node/src/main/resources/config/fed-sample.conf -Dlogback.configurationFile=/Library/powpeg-project/powpeg-node/logback.xml co.rsk.federate.FederateRunner --regtest --reset`
84
+
2. Without resetting the rsk db (replace `<version>` with the actual version of the `.jar`): `java -cp /Library/powpeg-project/powpeg-node/build/libs/federate-node-SNAPSHOT-<version>-all.jar -Drsk.conf.file=/Library/powpeg-project/powpeg-node/src/main/resources/config/fed-sample.conf -Dlogback.configurationFile=/Library/powpeg-project/powpeg-node/logback.xml co.rsk.federate.FederateRunner --regtest`
85
+
86
+
### Setup Details
87
+
88
+
#### **Java JDK 1.8**
25
89
26
90
Although optional we recommend to install jenv to manage different Java versions, to do that run: `brew install jenv`
27
91
@@ -49,7 +113,7 @@ Java HotSpot(TM) 64-Bit Server VM (build 25.351-b10, mixed mode)
49
113
50
114
*If not, try closing the terminal and open a new one cause sometimes it stays cached.*
51
115
52
-
### Bitcoind
116
+
####Bitcoind
53
117
54
118
To install version `24.0.1` follow instructions listed [here](https://bitcoincore.org/en/releases/24.0.1/)
55
119
@@ -59,12 +123,10 @@ It should output ```Bitcoin server starting```
59
123
60
124
Run `bitcoin-cli stop` afterwards.
61
125
62
-
63
-
64
-
## Setting up the project
126
+
#### Setting up the project
65
127
Create a directory (for example, “powpeg-project”) to hold the rskj node, the powpeg node and further configurations.
66
128
67
-
### Fetch the code
129
+
#####Fetch the code
68
130
69
131
Inside the `powpeg-project` directory clone the powpeg-node repository.
Before anything, you must ensure the security chain of the source code. For that, you must go through the following steps. For Linux based OS (Ubuntu for example) it’s recommended to install `gnupg-curl` to download the key through HTTPS.
82
144
@@ -141,18 +203,15 @@ configure.sh: OK
141
203
sha256sum: WARNING: 19 lines are improperly formatted
142
204
```
143
205
144
-
### Configure
206
+
#####Configure
145
207
146
208
Run configure script to configure secure environment.
147
209
148
210
```bash
149
211
./configure.sh
150
212
```
151
213
152
-
153
-
154
-
### Required configurations
155
-
214
+
##### Required configurations
156
215
157
216
**1. Pegnatory private key**
158
217
@@ -164,7 +223,6 @@ Set the desired value to it. (For example, `String generator = “federator1”;
164
223
165
224
- Run the class to generate a privateKey, publicKey, publicKeyCompressed, address and nodeId
To import the project to IntelliJ IDEA go to `File > New > Project from existing sources...` Select `powpeg-node/build.gradle` and import.
263
319
264
-
265
-
266
-
267
-
### Build
320
+
##### Build
268
321
269
322
Then clean and build project using:
270
323
271
324
```bash
272
325
./gradlew clean build
273
326
```
274
327
275
-
### Run bitcoind
328
+
#####Run bitcoind
276
329
277
330
Create a new directory called datadir inside powpeg-project. In the next step you need to replace `<PATH_TO_DATA_DIR>` with this directory absolute path.
278
331
@@ -320,7 +373,7 @@ This should return an integer.
320
373
321
374
- For more references, check **[https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line](https://github.com/BlockchainCommons/Learning-Bitcoin-from-the-Command-Line)**
322
375
323
-
### Run PowPeg node!
376
+
#####Run PowPeg node!
324
377
325
378
You can run it either with the FedRunner configuration from IntelliJ or manually from the command line.
0 commit comments