Fruzhin is a Java Implementation of the Polkadot Host. The ultimate goal for Fruzhin is to be able to function as an authoring and relaying node, increasing security of the Polkadot Protocol. It's been funded by Polkadot Pioneers Prize.
Warning Fruzhin is in pre-production state
- Light Client
- Full Node
- Authoring Node
- Relaying Node
git clone https://github.com/LimeChain/Fruzhin.git
cd Fruzhin
Fruzhin only works with Java 21 Coretto. Using any other version may cause "cannot calculate secret" errors when running the node:
org.bouncycastle.tls.crypto.TlsCryptoException: cannot calculate secret
If you have multiple java version installed please make sure you're using 21:
export JAVA_HOME=`/usr/libexec/java_home -v 21`
Note: This step will be automated in the future
Apple silicon users can skip this step.
For now, you will have to manually grab the compiled wasmer-java
dynamic library
file from the subfolder under ./wasmer-setup
corresponding to your architecture type.
Copy the file to the Java Extensions
folder:
/Library/Java/Extensions
./gradlew build
java -jar build/libs/Fruzhin-0.1.0.jar -n polkadot --node-mode full --sync-mode full
-n
(network) could bewestend
,polkadot
orkusama
--node-mode
could befull
orlight
--sync-mode
could befull
orwarp
In order to use the Fruzhin node for local development you will first need to start another node that would serve as a peer.
For the sake of this example we will use Paritytech's implementation. If you are not familiar with how to run a node see this.
Once you have successfully built the Polkadot project run the node via polkadot --dev
.
(The node starts on port 9944 by default)
Now you have 2 options:
- Use the automated
local_dev.sh
script - Manual setup.
-
Install JQ.
sudo apt-get install jq
Ubuntubrew install jq
MacOS -
Head to the main directory of Fruzhin execute the script
./local_dev.sh
.
-
Fetch the chain spec
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "sync_state_genSyncSpec", "params": [true]}' http://localhost:9944
The
lightSyncState
field is important for the light client to work. Without it, the light client won't have a checkpoint to start from and could be long-range attacked -
Create a new
westend-local.json
inside of thegenesis
project directory. -
Copy the contents of the
result
field from the fetched chain spec into the newly createdwestend-local.json
. -
In order to comply with the project requirements change the json structured as follows:
Fetched chain spec
{
"genesis": {
"raw": {
"top": {},
"childrenDefault": {}
}
}
}
Desired chain spec
{
"genesis": {
"top": {},
"childrenDefault": {}
}
}
-
Fetch the local boot nodes.
curl -H "Content-Type: application/json" -d '{"id":1, "jsonrpc":"2.0", "method": "system_localListenAddresses"}' http://localhost:9944
Paste the response into the
bootNodes
field of thewestend-local.json
chain spec.
- Build project
./gradlew build
- Run Fruzhin
java -jar build/libs/Fruzhin-0.1.0.jar -n 'local' --node-mode 'full'/'light' --sync-mode 'full'/'warp' --db-recreate true/false