mirror of
https://github.com/logos-messaging/logos-messaging-nim-compose.git
synced 2026-01-02 14:03:11 +00:00
fix: update readme.md and wizard (#171)
This commit is contained in:
parent
758a30a1d0
commit
1efe84e72b
@ -3,6 +3,7 @@
|
|||||||
# Enter your own RPC URL
|
# Enter your own RPC URL
|
||||||
RLN_RELAY_ETH_CLIENT_ADDRESS=https://linea-sepolia.infura.io/v3/<key>
|
RLN_RELAY_ETH_CLIENT_ADDRESS=https://linea-sepolia.infura.io/v3/<key>
|
||||||
|
|
||||||
|
|
||||||
# Address of the RLN contract on Linea Sepolia.
|
# Address of the RLN contract on Linea Sepolia.
|
||||||
# DO NOT TOUCH unless you know what you are doing
|
# DO NOT TOUCH unless you know what you are doing
|
||||||
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
|
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
|
||||||
|
|||||||
133
README.md
133
README.md
@ -1,97 +1,50 @@
|
|||||||
# nwaku-compose
|
# nwaku-compose
|
||||||
|
|
||||||
Ready‑to‑use **docker‑compose** stack for running your own [nwaku](https://github.com/waku-org/nwaku) node:
|
Ready‑to‑use **docker compose** stack for running your own [nwaku](https://github.com/waku-org/nwaku) node.
|
||||||
|
|
||||||
* RLN‑enabled nwaku node (relay + store protocols, excluding message publishing)
|
|
||||||
* Grafana dashboard for metrics
|
|
||||||
* Requires **Docker Compose** and **Git**
|
|
||||||
|
|
||||||
## 📝 Prerequisites
|
## 📝 Prerequisites
|
||||||
|
|
||||||
* **Linea Sepolia RPC endpoint** — grab one for free on [Infura](https://www.infura.io)
|
- **Docker** and **Git**
|
||||||
* **Linea Sepolia wallet** with at least **0.01 ETH** (Only Required For RLN Membership Registration which is WIP)
|
- **Linea Sepolia RPC endpoint** You can get a free endpoint from [Infura](https://www.infura.io) or any other Linea Sepolia RPC provider.
|
||||||
* Need test ETH? Use the [Linea Sepolia faucet](https://www.infura.io/faucet/sepolia)
|
|
||||||
* Already have ETH on Sepolia? Bridge it to Linea via the [official bridge](https://bridge.linea.build/native-bridge)
|
|
||||||
|
|
||||||
### 🚀 Starting your node
|
### 🚀 Starting your node
|
||||||
|
|
||||||
| # | Option | Quick-start command | What happens |
|
| # | Setup Type | Setup Style | What happens |
|
||||||
|-------|----------------------|-------------------------------|-----------------------------------------------------------------------------|
|
|-------|---------------------|----------------------|-----------------------------------------------------------------------------|
|
||||||
| **A** | **script** | Power user / CI | setup a .env file manually and then start the node. |
|
| **A** | **manual** | Power User | Setup a .env file manually and then start the node. |
|
||||||
| **B** | **WIP setup-wizard** | Fastest one-command bootstrap | Generates `.env`, registers RLN, and spins up the whole stack automatically |
|
| **B** | **setup-wizard** | Command-Line | Generates `.env`, starts the node. |
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>🧪 option A :- SCRIPT [ manual ] [ recommended ] </summary>
|
<summary>🧪 OPTION A :- manual [ recommended ] </summary>
|
||||||
|
|
||||||
|
### 1. Setup .env file
|
||||||
```
|
```
|
||||||
cp .env.example .env
|
cp .env.example .env
|
||||||
```
|
```
|
||||||
Edit the .env file and fill in all required parameters
|
Edit the .env file and fill in all required parameters
|
||||||
|
|
||||||
|
### 💽 2. Set Database Parameters
|
||||||
|
|
||||||
### 💽 2. Select DB Parameters
|
Waku uses PostgreSQL to store and serve messages.
|
||||||
|
Limit disk usage and (optionally) increase shared memory for better performance.
|
||||||
|
|
||||||
Waku runs a PostgreSQL Database to store messages from the network and serve them to other peers.
|
| Setting | Auto-set command | Manual example |
|
||||||
To prevent the database to grow indefinitely, you need to select how much disk space to allocate.
|
|----------------|---------------------------------|--------------------------------------|
|
||||||
You can either run a script that will estimate and set a good value:
|
| Storage size | `./set_storage_retention.sh` | `echo "STORAGE_SIZE=50GB" >> .env` |
|
||||||
|
| Shared memory | `./set_postgres_shm.sh` | `echo "POSTGRES_SHM=4g" >> .env` |
|
||||||
```
|
|
||||||
./set_storage_retention.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Or select your own value. For example, `50GB`:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
echo "STORAGE_SIZE=50GB" >> .env
|
|
||||||
```
|
|
||||||
|
|
||||||
Depending on your machine's memory, it may be worth allocating more memory to the Postgres container to ensure heavy queries are served:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
./set_postgres_shm.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
Or select your own value manually, for example, `4g`:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
echo "POSTGRES_SHM=4g" >> .env
|
|
||||||
```
|
|
||||||
|
|
||||||
### 🖥️ 3. Start your node
|
### 🖥️ 3. Start your node
|
||||||
|
|
||||||
Start all processes: nwaku node, database and grafana for metrics. Your [RLN](https://rate-limiting-nullifier.github.io/rln-docs/what_is_rln.html) membership is loaded into nwaku under the hood.
|
Start all processes: nwaku node, database and grafana for metrics.
|
||||||
```console
|
|
||||||
docker-compose up -d
|
|
||||||
```
|
|
||||||
⚠️ The node might take a few minutes the very first time it runs because it needs to build locally the RLN community membership tree.
|
|
||||||
|
|
||||||
###🏄🏼♂️ 4. Interact with your nwaku node
|
|
||||||
|
|
||||||
* See [localhost:3000](http://localhost:3000/d/yns_4vFVk/nwaku-monitoring) for node metrics.
|
|
||||||
|
|
||||||
**📬 4. Use the REST API**
|
|
||||||
|
|
||||||
Your nwaku node exposes a [REST API](https://waku-org.github.io/waku-rest-api/) to interact with it.
|
|
||||||
|
|
||||||
```
|
```
|
||||||
# get nwaku version
|
docker compose up -d
|
||||||
curl http://127.0.0.1:8645/debug/v1/version
|
|
||||||
# get nwaku info
|
|
||||||
curl http://127.0.0.1:8645/debug/v1/info
|
|
||||||
```
|
```
|
||||||
|
|
||||||
**Get messages sent to a `contentTopic`**. Note that any store node in the network is used to reply.
|
|
||||||
```
|
|
||||||
curl -X GET "http://127.0.0.1:8645/store/v1/messages?contentTopics=%2Fmy-app%2F2%2Fchatroom-1%2Fproto&pageSize=50&ascending=true" \
|
|
||||||
-H "accept: application/json"
|
|
||||||
```
|
|
||||||
|
|
||||||
For advanced documentation, refer to [ADVANCED.md](https://github.com/waku-org/nwaku-compose/blob/master/ADVANCED.md).
|
|
||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>⚙️ option B (not recommended at this time):- SETUP-WIZARD [ experimental ]</summary>
|
<summary>⚙️ OPTION B :- setup-wizard [ experimental ]</summary>
|
||||||
|
|
||||||
Run the wizard script.
|
Run the wizard script.
|
||||||
Once the script is done, the node will be started for you, so there is nothing else to do.
|
Once the script is done, the node will be started for you, so there is nothing else to do.
|
||||||
@ -104,20 +57,38 @@ The script is experimental, feedback and pull requests are welcome.
|
|||||||
|
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
|
|
||||||
### 🛑 Shutting down your node
|
|
||||||
|
|
||||||
To gracefully shut down your node:
|
|
||||||
```shell
|
|
||||||
docker compose down
|
|
||||||
```
|
|
||||||
|
|
||||||
### 📌 Note
|
### 📌 Note
|
||||||
RLN membership is your access key to The Waku Network. It is registered on-chain, enabling your nwaku node to send messages in a decentralized and privacy-preserving way while adhering to rate limits. Messages exceeding the rate limit will not be relayed by other peers.
|
RLN membership is your access key to The Waku Network. It is registered on-chain, enabling your nwaku node to send messages in a decentralized and privacy-preserving way while adhering to rate limits. Messages exceeding the rate limit will not be relayed by other peers.
|
||||||
|
|
||||||
If you just want to relay traffic (not publish), you don't need to perform the registration.
|
If you just want to relay traffic (not publish), you don't need to perform the registration.
|
||||||
|
|
||||||
-----
|
-----
|
||||||
|
<details>
|
||||||
|
<summary>Monitor your nwaku node </summary>
|
||||||
|
|
||||||
|
- **Metrics (Grafana):**
|
||||||
|
Open [localhost:3000](http://localhost:3000/d/yns_4vFVk/nwaku-monitoring) to view node metrics.
|
||||||
|
|
||||||
|
- **Live logs:**
|
||||||
|
See what’s happening inside your node in real time:
|
||||||
|
```bash
|
||||||
|
docker compose logs nwaku -f --tail 100
|
||||||
|
```
|
||||||
|
|
||||||
|
- **Use the REST API**
|
||||||
|
|
||||||
|
Your nwaku node exposes a [REST API](https://waku-org.github.io/waku-rest-api/) to interact with it.
|
||||||
|
```
|
||||||
|
# get nwaku version
|
||||||
|
curl http://127.0.0.1:8645/debug/v1/version
|
||||||
|
# get nwaku info
|
||||||
|
curl http://127.0.0.1:8645/debug/v1/info
|
||||||
|
```
|
||||||
|
|
||||||
|
For advanced documentation, refer to [ADVANCED.md](https://waku-org.github.io/waku-rest-api/).
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>How to update to latest version</summary>
|
<summary>How to update to latest version</summary>
|
||||||
|
|
||||||
@ -127,7 +98,6 @@ We regularly announce new available versions in our [Discord](https://discord.wa
|
|||||||
|
|
||||||
Please review the latest https://github.com/waku-org/nwaku-compose/blob/master/.env.example env var template file and update your .env accordingly.
|
Please review the latest https://github.com/waku-org/nwaku-compose/blob/master/.env.example env var template file and update your .env accordingly.
|
||||||
|
|
||||||
Make sure you have some ETH in your Linea Sepolia account.
|
|
||||||
Also, move your Sepolia RPC client (e.g., Infura) to a Linea Sepolia RPC client.
|
Also, move your Sepolia RPC client (e.g., Infura) to a Linea Sepolia RPC client.
|
||||||
|
|
||||||
You will need to delete both the `keystore` and `rln_tree` folders, and register your membership again before using the new version by running the following commands:
|
You will need to delete both the `keystore` and `rln_tree` folders, and register your membership again before using the new version by running the following commands:
|
||||||
@ -148,17 +118,6 @@ Updating the node is as simple as running the following:
|
|||||||
4. `docker-compose up -d`
|
4. `docker-compose up -d`
|
||||||
</details>
|
</details>
|
||||||
|
|
||||||
<details>
|
|
||||||
<summary>Set storage size (optional)</summary>
|
|
||||||
|
|
||||||
To improve storage on the network, you can increase the allocated space for the database.
|
|
||||||
To do so, you can simply run:
|
|
||||||
|
|
||||||
```
|
|
||||||
./set_storage_retention.sh
|
|
||||||
```
|
|
||||||
</details>
|
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Node's health check</summary>
|
<summary>Node's health check</summary>
|
||||||
|
|
||||||
|
|||||||
@ -9,14 +9,25 @@ RLN_RELAY_ETH_CLIENT_ADDRESS=https://linea-sepolia.infura.io/v3/<key>
|
|||||||
# e.g.: ETH_TESTNET_ACCOUNT=0xbecd1546a397a6bad875247d51c4c6da0e469021
|
# e.g.: ETH_TESTNET_ACCOUNT=0xbecd1546a397a6bad875247d51c4c6da0e469021
|
||||||
ETH_TESTNET_ACCOUNT=<YOUR_TESTNET_ACCOUNT_ADDRESS_HERE>
|
ETH_TESTNET_ACCOUNT=<YOUR_TESTNET_ACCOUNT_ADDRESS_HERE>
|
||||||
|
|
||||||
# Address of the RLN Membership Token contract on Linea Sepolia used to pay for membership.
|
# Private key of ETH_TESTNET_ACCOUNT.
|
||||||
TOKEN_CONTRACT_ADDRESS=0xd17e184e3c1941585a3edcb3a10367da6326d844
|
|
||||||
|
|
||||||
# Private key of testnet where you have Linea Sepolia ETH that would be staked into RLN contract.
|
|
||||||
# Note: make sure you don't use the '0x' prefix.
|
# Note: make sure you don't use the '0x' prefix.
|
||||||
# Use the following as a format example, but replace it with your own private key value
|
# Use the following as a format example, but replace it with your own private key value
|
||||||
# e.g. ETH_TESTNET_KEY=abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234
|
# e.g. ETH_TESTNET_KEY=abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234abcd1234
|
||||||
ETH_TESTNET_KEY=<YOUR_TESTNET_PRIVATE_KEY_HERE>
|
ETH_TESTNET_KEY=<YOUR_TESTNET_PRIVATE_KEY_HERE>
|
||||||
|
|
||||||
|
# Address of the RLN contract on Linea Sepolia.
|
||||||
|
# DO NOT TOUCH unless you know what you are doing
|
||||||
|
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
|
||||||
|
|
||||||
|
# Address of the RLN Membership Token contract on Linea Sepolia used to pay for membership.
|
||||||
|
TOKEN_CONTRACT_ADDRESS=0xd17e184e3c1941585a3edcb3a10367da6326d844
|
||||||
|
|
||||||
# Password you would like to use to protect your RLN membership.
|
# Password you would like to use to protect your RLN membership.
|
||||||
RLN_RELAY_CRED_PASSWORD="my_secure_keystore_password"
|
RLN_RELAY_CRED_PASSWORD="my_secure_keystore_password"
|
||||||
|
|
||||||
|
# Advanced. Can be left empty in normal use cases.
|
||||||
|
NWAKU_IMAGE=
|
||||||
|
NODEKEY=
|
||||||
|
DOMAIN=
|
||||||
|
EXTRA_ARGS=
|
||||||
|
STORAGE_SIZE=
|
||||||
23
dogfooding/dogfood_readme.md
Normal file
23
dogfooding/dogfood_readme.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# Dogfooding
|
||||||
|
|
||||||
|
## 📝 Prerequisites
|
||||||
|
|
||||||
|
- **Docker** and **Git**
|
||||||
|
|
||||||
|
1. Copy `.env.example.publisher` to `.env` and fill in all parameters.
|
||||||
|
|
||||||
|
```
|
||||||
|
cp dogfooding/.env.example.publisher .env
|
||||||
|
```
|
||||||
|
2. Obtain test tokens (if needed, request in Discord).
|
||||||
|
3. Run the RLN registration script:
|
||||||
|
|
||||||
|
```
|
||||||
|
./register_rln.sh
|
||||||
|
```
|
||||||
|
4. Start the node:
|
||||||
|
|
||||||
|
```
|
||||||
|
docker compose up -d
|
||||||
|
```
|
||||||
|
|
||||||
@ -8,20 +8,7 @@ echocol()
|
|||||||
}
|
}
|
||||||
|
|
||||||
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
|
RLN_CONTRACT_ADDRESS=0xB9cd878C90E49F797B4431fBF4fb333108CB90e6
|
||||||
TOKEN_CONTRACT_ADDRESS=0x185A0015aC462a0aECb81beCc0497b649a64B9ea
|
|
||||||
REQUIRED_AMOUNT=5
|
|
||||||
|
|
||||||
check_eth_balance() {
|
|
||||||
# 0.01 ETH in wei
|
|
||||||
local MIN=10000000000000000
|
|
||||||
local BAL
|
|
||||||
|
|
||||||
BAL=$(cast balance "$ETH_TESTNET_ACCOUNT" --rpc-url "$RLN_RELAY_ETH_CLIENT_ADDRESS" 2>/dev/null | tr -d '[:space:]')
|
|
||||||
[ -z "$BAL" ] && { echocol "Couldn’t fetch ETH balance."; exit 1; }
|
|
||||||
[ "$BAL" -lt "$MIN" ] && { echocol "Need ≥ 0.01 Linea Sepolia ETH. Top up at https://www.infura.io/faucet/sepolia"; exit 1; }
|
|
||||||
|
|
||||||
echocol "✅ You have enough Linea Sepolia ETH to register."
|
|
||||||
}
|
|
||||||
|
|
||||||
if [ -f ./.env ]; then
|
if [ -f ./.env ]; then
|
||||||
echocol ".env file already exists."
|
echocol ".env file already exists."
|
||||||
@ -35,16 +22,6 @@ if [ -f ./.env ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f keystore/keystore.json ]; then
|
|
||||||
echocol "'keystore/keystore.json' already exists."
|
|
||||||
read -p "Do you want to delete and regenerate it? (y/N): " RECREATE_KEYSTORE
|
|
||||||
if [ "$RECREATE_KEYSTORE" = "y" ] || [ "$RECREATE_KEYSTORE" = "Y" ]; then
|
|
||||||
rm -f keystore/keystore.json
|
|
||||||
echocol "Old keystore/keystore.json removed. Generating a new one..."
|
|
||||||
else
|
|
||||||
echocol "Keeping existing keystore/keystore.json. Exiting wizard."
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure Foundry (cast & foundryup) is available for token mint/approve calls
|
# Ensure Foundry (cast & foundryup) is available for token mint/approve calls
|
||||||
if ! command -v cast >/dev/null 2>&1; then
|
if ! command -v cast >/dev/null 2>&1; then
|
||||||
@ -83,33 +60,6 @@ if [ -z "$RLN_RELAY_ETH_CLIENT_ADDRESS" ] \
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echocol ""
|
|
||||||
echocol "Now enter your Linea Sepolia Testnet account address (should start with 0x and be 42 characters)"
|
|
||||||
read -p "ETH_TESTNET_ACCOUNT: " ETH_TESTNET_ACCOUNT
|
|
||||||
|
|
||||||
if ! [[ "$ETH_TESTNET_ACCOUNT" =~ ^0x[0-9a-fA-F]{40}$ ]]; then
|
|
||||||
echo "Invalid value, received '$ETH_TESTNET_ACCOUNT'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echocol ""
|
|
||||||
echocol "Checking your Linea Sepolia Testnet balance..."
|
|
||||||
check_eth_balance
|
|
||||||
echocol ""
|
|
||||||
|
|
||||||
echocol "Now enter your Linea Sepolia Testnet private key in hex format 0a...1f without 0x prefix"
|
|
||||||
read -p "ETH_TESTNET_KEY: " ETH_TESTNET_KEY
|
|
||||||
|
|
||||||
if ! [[ "$ETH_TESTNET_KEY" =~ ^[0-9a-fA-F]{64}$ ]]; then
|
|
||||||
echo "Invalid value, received '$ETH_TESTNET_KEY'"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echocol ""
|
|
||||||
echocol "Generating a password for the RLN membership keystore file..."
|
|
||||||
read -p "Press ENTER to continue..." foo
|
|
||||||
RLN_RELAY_CRED_PASSWORD=$(LC_ALL=C < /dev/urandom tr -dc ',/.;:<>?!@#$%^&*()+\-_A-Z-a-z-0-9' | head -c${1:-16}; echo)
|
|
||||||
|
|
||||||
echocol ""
|
echocol ""
|
||||||
echocol "Estimating storage size for DB..."
|
echocol "Estimating storage size for DB..."
|
||||||
read -p "Press ENTER to continue..." foo
|
read -p "Press ENTER to continue..." foo
|
||||||
@ -136,52 +86,17 @@ echocol "They will be saved to '.env'. Press ENTER to confirm or CONTROL-C to ca
|
|||||||
|
|
||||||
echocol ""
|
echocol ""
|
||||||
echocol "RLN_RELAY_ETH_CLIENT_ADDRESS: $RLN_RELAY_ETH_CLIENT_ADDRESS"
|
echocol "RLN_RELAY_ETH_CLIENT_ADDRESS: $RLN_RELAY_ETH_CLIENT_ADDRESS"
|
||||||
echocol "ETH_TESTNET_KEY: $ETH_TESTNET_KEY"
|
echocol "RLN_CONTRACT_ADDRESS: $RLN_CONTRACT_ADDRESS"
|
||||||
echocol "ETH_TESTNET_ACCOUNT: $ETH_TESTNET_ACCOUNT"
|
|
||||||
echocol "RLN_RELAY_CRED_PASSWORD: $RLN_RELAY_CRED_PASSWORD"
|
|
||||||
echocol "STORAGE_SIZE: $STORAGE_SIZE"
|
echocol "STORAGE_SIZE: $STORAGE_SIZE"
|
||||||
echocol "POSTGRES_SHM: $POSTGRES_SHM"
|
echocol "POSTGRES_SHM: $POSTGRES_SHM"
|
||||||
|
|
||||||
read -p "Press ENTER to continue..." foo
|
read -p "Press ENTER to continue..." foo
|
||||||
|
|
||||||
echo "RLN_RELAY_ETH_CLIENT_ADDRESS='$RLN_RELAY_ETH_CLIENT_ADDRESS'
|
echo "RLN_RELAY_ETH_CLIENT_ADDRESS='$RLN_RELAY_ETH_CLIENT_ADDRESS'
|
||||||
ETH_TESTNET_KEY=$ETH_TESTNET_KEY
|
RLN_CONTRACT_ADDRESS=$RLN_CONTRACT_ADDRESS
|
||||||
ETH_TESTNET_ACCOUNT=$ETH_TESTNET_ACCOUNT
|
|
||||||
RLN_RELAY_CRED_PASSWORD='$RLN_RELAY_CRED_PASSWORD'
|
|
||||||
STORAGE_SIZE=$STORAGE_SIZE
|
STORAGE_SIZE=$STORAGE_SIZE
|
||||||
POSTGRES_SHM=$POSTGRES_SHM" > ./.env
|
POSTGRES_SHM=$POSTGRES_SHM" > ./.env
|
||||||
|
|
||||||
echocol ""
|
|
||||||
echocol "Checking your TTT token balance..."
|
|
||||||
USER_BALANCE_RAW=$(cast call $TOKEN_CONTRACT_ADDRESS "balanceOf(address)(uint256)" $ETH_TESTNET_ACCOUNT --rpc-url $RLN_RELAY_ETH_CLIENT_ADDRESS 2>/dev/null)
|
|
||||||
USER_BALANCE=$(echo "$USER_BALANCE_RAW" | awk '{print $1}')
|
|
||||||
USER_BALANCE=$(echo "$USER_BALANCE / 10^18" | bc)
|
|
||||||
|
|
||||||
if [ -z "$USER_BALANCE" ]; then
|
|
||||||
echocol "Could not fetch balance. Please ensure your RPC endpoint and account are correct."
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echocol "Your current TTT token balance is: $USER_BALANCE"
|
|
||||||
echocol "Required amount: $REQUIRED_AMOUNT"
|
|
||||||
echocol ""
|
|
||||||
|
|
||||||
MINT_CHOICE="y"
|
|
||||||
if [ "$USER_BALANCE" -ge "$REQUIRED_AMOUNT" ]; then
|
|
||||||
echocol "You already have enough TTT tokens to register."
|
|
||||||
read -p "Do you want to mint more tokens? (y/N): " MINT_CHOICE
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$MINT_CHOICE" = "y" ] || [ "$MINT_CHOICE" = "Y" ]; then
|
|
||||||
./register_rln.sh --mint;
|
|
||||||
else
|
|
||||||
./register_rln.sh --no-mint;
|
|
||||||
fi
|
|
||||||
|
|
||||||
echocol ""
|
|
||||||
echocol "✅ RLN membership registered successfully!"
|
|
||||||
echocol ""
|
|
||||||
|
|
||||||
echocol "Your node is ready! enter the following command to start it:"
|
echocol "Your node is ready! enter the following command to start it:"
|
||||||
read -p "Press ENTER to continue..." foo
|
read -p "Press ENTER to continue..." foo
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user