In this Guide, we contribute to Drosera testnet by:
- Installing the CLI
- Setting up a vulnerable contract
- Deploying a Trap on testnet
- Connecting an operator to the Trap
- 2 CPU Cores
- 4 GB RAM
- 20 GB Disk Space
- Get started with a low-budget
VPSfor as low as $5! Purchase here - Create your own
Ethereum Hoodi RPCin Alchemy or QuickNode.
If you already have deployed your trap and operator on Hoodi network, and only want to update it to new release version, follow Update node version
If you have deployed your trap and operator on Holesky network, move them to Hoodi network by following Update To Hoodi
sudo apt-get update && sudo apt-get upgrade -y
sudo apt install curl ufw iptables build-essential git wget lz4 jq make gcc nano automake autoconf tmux htop nvme-cli libgbm1 pkg-config libssl-dev libleveldb-dev tar clang bsdmainutils ncdu unzip libleveldb-dev -y
sudo apt update -y && sudo apt upgrade -y
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do sudo apt-get remove $pkg; done
sudo apt-get update
sudo apt-get install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update -y && sudo apt upgrade -y
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
# Test Docker
sudo docker run hello-worldDrosera CLI:
curl -L https://app.drosera.io/install | bashsource /root/.bashrc
droseraup
Foundry CLI:
curl -L https://foundry.paradigm.xyz | bash
source /root/.bashrc
foundryup
Bun:
curl -fsSL https://bun.sh/install | bash
source /root/.bashrc
mkdir my-drosera-trapcd my-drosera-trapReplace Github_Email & Github_Username:
git config --global user.email "Github_Email"
git config --global user.name "Github_Username"Initialize Trap:
forge init -t drosera-network/trap-foundry-template
Compile Trap:
curl -fsSL https://bun.sh/install | bash
source /root/.bashrc
bun installforge build- skip warnings!
Deploy Trap:
DROSERA_PRIVATE_KEY=xxx drosera apply- Replace
xxxwith your EVM walletprivatekey(Ensure it's funded withHoodi ETH) - Enter the command, when prompted, write
ofcand press Enter.
- Existing Users: If you've deployed a trap with your wallet previously, then you need to add your trap address to
drosera.tomlfile, by adding this line:address = "TRAP_ADDRESS"in the bottom.- Ensure you replace
TRAP_ADDRESSwith your own trap address. - If you don't know how to get your trap address, Follow this step.
- Finally, as an existing user, Ensure you filled out
drosera.tomlbottom lines like this:
whitelist = ["Operator1_Address","Operator2_Address"] address = "TRAP_ADDRESS"- After modifying your
drosera.toml, re-apply your trap configuration by executing this command:DROSERA_PRIVATE_KEY=xxx drosera apply
- Ensure you replace
🚨 Error: You may get several errors (.eg #429) due to rpc issues, to fix, you can enter bellow command by adding --eth-rpc-url
DROSERA_PRIVATE_KEY=xxx drosera apply --eth-rpc-url RPC- Replace
RPCwith your own Ethereum Hoodi rpc by registering and creating one in Alchemy or QuickNode.
1- Connect your Drosera EVM wallet: https://app.drosera.io/
2- Click on Traps Owned to see your deployed Traps OR search your Trap address.
Open your Trap on Dashboard and Click on Send Bloom Boost and deposit some Hoodi ETH on it.
drosera dryrun1- Edit Trap configuration:
cd my-drosera-trap
nano drosera.tomlAdd the following codes at the bottom of drosera.toml:
private_trap = true
whitelist = ["Operator_Address"]- Replace
Operator_Addresswith your EVM walletPublic Addressbetween " " symbols - Your
Public Addressis yourOperator_Address.
2- Update Trap Configuration:
DROSERA_PRIVATE_KEY=xxx drosera apply- Replace
xxxwith your EVM walletprivatekey - If RPC issue, use
DROSERA_PRIVATE_KEY=xxx drosera apply --eth-rpc-url RPCand replaceRPCwith your own.
Your Trap should be private now with your operator address whitelisted internally.
cd ~# Download
curl -LO https://github.com/drosera-network/releases/releases/download/v1.23.1/drosera-operator-v1.23.1-x86_64-unknown-linux-gnu.tar.gz
# Install
tar -xvf drosera-operator-v1.23.1-x86_64-unknown-linux-gnu.tar.gz- Currently the Operator CLI version is
v1.23.1. Verify the latest version here - You have to get the link of
drosera-operator-v1.x.x-x86_64-unknown-linux-gnu.tar.gz
Test the CLI with ./drosera-operator --version to verify it's working.
# Check version
./drosera-operator --version
# Move path to run it globally
sudo cp drosera-operator /usr/bin
# Check if it is working
drosera-operatordocker pull ghcr.io/drosera-network/drosera-operator:latest
drosera-operator register --eth-rpc-url https://rpc.hoodi.ethpandaops.io --eth-private-key PV_KEY- Replace
PV_KEYwith your Drosera EVMprivatekey. We use the same wallet as our trap wallet.
# Enable firewall
sudo ufw allow ssh
sudo ufw allow 22
sudo ufw enable
# Allow Drosera ports
sudo ufw allow 31313/tcp
sudo ufw allow 31314/tcpChoose one Installation Method:
- Method 1: Install using Docker
- Method 2: Install using SystemD
- Make sure you have installed
Dockerin Dependecies step.
If you are currently running via old systemd method, stop it:
sudo systemctl stop drosera
sudo systemctl disable drosera
git clone https://github.com/0xmoei/Drosera-Network
cd Drosera-Network
cp .env.example .env
Edit .env file:
nano .env
- Replace
your_evm_private_keyandyour_vps_public_ip - To save:
CTRL+X,Y&ENTER.
Edit docker-compose.yaml file:
nano docker-compose.yaml- Replace default
--eth-rpc-urlto your private Alchemy or QuickNode Ethereum Hoodi RPCs. - To save:
CTRL+X,Y&ENTER.
docker compose up -d
docker logs -f drosera-node
No problem if you are receiveing
WARN drosera_services::network::service: Failed to gossip message: InsufficientPeers. It's because you are running only one operator on your trap. In the next steps we deploy two operators.
# Stop node
cd Drosera-Network
docker compose down -v
# Restart node
cd Drosera-Network
docker compose up -dNow running your node using Docker, you can Jump to step 7.
Enter this command in the terminal, But first replace:
PV_KEYwith yourprivatekeyVPS_IPwith your solid vps IP (without anything else)- Replace default
https://rpc.hoodi.ethpandaops.ioto your private Alchemy or QuickNode Ethereum Hoodi RPCs.
sudo tee /etc/systemd/system/drosera.service > /dev/null <<EOF
[Unit]
Description=drosera node service
After=network-online.target
[Service]
User=$USER
Restart=always
RestartSec=15
LimitNOFILE=65535
ExecStart=$(which drosera-operator) node --db-file-path $HOME/.drosera.db --network-p2p-port 31313 --server-port 31314 \
--eth-rpc-url https://rpc.hoodi.ethpandaops.io \
--eth-backup-rpc-url https://rpc.hoodi.ethpandaops.io \
--drosera-address 0x91cB447BaFc6e0EA0F4Fe056F5a9b1F14bb06e5D \
--eth-private-key PV_KEY \
--listen-address 0.0.0.0 \
--network-external-p2p-address VPS_IP \
--disable-dnr-confirmation true
[Install]
WantedBy=multi-user.target
EOF# reload systemd
sudo systemctl daemon-reload
sudo systemctl enable drosera
# start systemd
sudo systemctl start droserajournalctl -u drosera.service -f!! No problem if you are receiveing
WARN drosera_services::network::service: Failed to gossip message: InsufficientPeers. It's because you are running only one operator on your trap. In the next steps we deploy two operators.
# Stop node
sudo systemctl stop drosera
# Restart node
sudo systemctl restart droseraIn the dashboard., Click on Opti in to connect your operator to the Trap
Your node will start producing greeen blocks in the dashboard
Let's run a 2nd operator on your Trap using Docker:
sudo systemctl stop drosera
sudo systemctl disable drosera1- Create a new EVM wallet, Fund it with Hoodi ETH and write down its Privatekey (2nd_Operator_Privatekey) & PublicAddress (2nd_Operator_Address).
2- Edit Trap Configuration:
cd ~/my-drosera-trap
nano drosera.toml
Edit the following codes at the bottom of drosera.toml:
private_trap = true
whitelist = ["1st_Operator_Address","2nd_Operator_Address"]- Replace
1st_Operator_Address&2nd_Operator_Addresswith your Operators EVM wallet Public Addresses between " " symbols.
3- Update Trap Configuration:
DROSERA_PRIVATE_KEY=xxx drosera apply- Replace
xxxwith yourTrapEVM walletprivatekey. - If RPC issue, use
DROSERA_PRIVATE_KEY=xxx drosera apply --eth-rpc-url RPCand replaceRPCwith your own.
Your 2nd_Operator_Address is now added to the whitelist in the dashboard of your Trap.
drosera-operator register --eth-rpc-url https://rpc.hoodi.ethpandaops.io --eth-private-key 2nd_Operator_Privatekey- Replace
2nd_Operator_Privatekeywith your 2nd Operator Privatekey.
sudo ufw allow 31315/tcp
sudo ufw allow 31316/tcpcd Drosera-Network
nano docker-compose.yaml
Replace the content of the file with the following codes:
version: '3'
services:
drosera1:
image: ghcr.io/drosera-network/drosera-operator:latest
container_name: drosera-node1
network_mode: host
volumes:
- drosera_data1:/data
command: node --db-file-path /data/drosera.db --network-p2p-port 31313 --server-port 31314 --eth-rpc-url RPC_URL_1 --eth-backup-rpc-url https://rpc.hoodi.ethpandaops.io --drosera-address 0x91cB447BaFc6e0EA0F4Fe056F5a9b1F14bb06e5D --eth-private-key ${ETH_PRIVATE_KEY} --listen-address 0.0.0.0 --network-external-p2p-address ${VPS_IP} --disable-dnr-confirmation true
restart: always
drosera2:
image: ghcr.io/drosera-network/drosera-operator:latest
container_name: drosera-node2
network_mode: host
volumes:
- drosera_data2:/data
command: node --db-file-path /data/drosera.db --network-p2p-port 31315 --server-port 31316 --eth-rpc-url RPC_URL_2 --eth-backup-rpc-url https://rpc.hoodi.ethpandaops.io --drosera-address 0x91cB447BaFc6e0EA0F4Fe056F5a9b1F14bb06e5D --eth-private-key ${ETH_PRIVATE_KEY2} --listen-address 0.0.0.0 --network-external-p2p-address ${VPS_IP} --disable-dnr-confirmation true
restart: always
volumes:
drosera_data1:
drosera_data2:- Replace
RPC_URL_1&RPC_URL_2with your own Ethereum Hoodi RPC, You can use Alchemy or QuickNode or even a reliable public rpc of hoodi network to create Ethereum Hoodi RPC. - You can use same RPCs for both
RPC_URL_1&RPC_URL_2. - To save:
CTRL+X,Y&ENTER
nano .envReplace the content of the file with the following codes:
ETH_PRIVATE_KEY=
ETH_PRIVATE_KEY2=
VPS_IP=- Enter a value for
ETH_PRIVATE_KEYÐ_PRIVATE_KEY2(Operators Private key) &VPS_IP. - To save:
CTRL+X,Y&ENTER
Stop old docker node:
docker compose down -v
docker stop drosera-node
docker rm drosera-nodeRun Operators:
docker compose up -dMethod 1: Login with your 2nd Operator wallet in Dashboard, and Opt-in to your Trap
Method 2: via CLI
drosera-operator optin --eth-rpc-url https://rpc.hoodi.ethpandaops.io --eth-private-key 2nd_Operator_Privatekey --trap-config-address Trap_Address- Replace
2nd_Operator_Privatekey&Trap_Address
cd ~/Droseta-Network
docker compose up -d- You will get Green Blocks after a while!
Make sure you are in Operators directory:
cd ~/Drosera-NetworkRestart Operators:
docker compose up -d
# OR
docker compose restartRestart Operators seprately:
docker compose up -d drosera1
docker compose up -d drosera2
# OR
docker compose restart drosera1
docker compose restart drosera2Kill Operators:
docker compose down -vAssuming your Trap is deployed and your operator is running, let's set up a new Trap to submit your Discord username on-chain and unlock an exclusive Cadet role
1- Move to your trap directory:
cd my-drosera-trap2- Create a new Trap.sol file:
nano src/Trap.sol3- Replase the following contract code in it:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {ITrap} from "drosera-contracts/interfaces/ITrap.sol";
interface IMockResponse {
function isActive() external view returns (bool);
}
contract Trap is ITrap {
// Updated response contract address
address public constant RESPONSE_CONTRACT = 0x25E2CeF36020A736CF8a4D2cAdD2EBE3940F4608;
string constant discordName = "DISCORD_USERNAME"; // Replace with your Discord username
function collect() external view returns (bytes memory) {
bool active = IMockResponse(RESPONSE_CONTRACT).isActive();
return abi.encode(active, discordName);
}
function shouldRespond(bytes[] calldata data) external pure returns (bool, bytes memory) {
(bool active, string memory name) = abi.decode(data[0], (bool, string));
if (!active || bytes(name).length == 0) {
return (false, bytes(""));
}
return (true, abi.encode(name));
}
}
- Replace
DISCORD_USERNAMEwith your discord username. - To save:
Ctrl+X,Y&Enter
nano drosera.toml
- Modify the values of the specified variables as follows:
path="out/Trap.sol/Trap.json"response_contract="0x25E2CeF36020A736CF8a4D2cAdD2EBE3940F4608"response_function="respondWithDiscordName(string)"eth_chain_id=560048drosera_address="0x91cB447BaFc6e0EA0F4Fe056F5a9b1F14bb06e5D"
Your final drosera.toml file should match the example shown below:
1- Compile your Trap's Contract:
forge build
- If you got errors like:
command not found, Entersource /root/.bashrcor reinstall dependecies from here
2- Test the trap before deploying:
drosera dryrun3- Apply and Deploy the Trap:
DROSERA_PRIVATE_KEY=xxx drosera apply- Replace
xxxwith your EVM wallet privatekey (Ensure it's funded with Hoodi ETH) - Enter the command, when prompted, write
ofcand pressEnter.
cd
cd Drosera-Network
docker compose up -d
Wait until you get green blocks in the explorer.
After the trap is deployed and you got green blocks in the dashboard, we can check if the user has responded by calling the isResponder function on the response contract.
source /root/.bashrc
cast call 0x25E2CeF36020A736CF8a4D2cAdD2EBE3940F4608 "isResponder(address)(bool)" OWNER_ADDRESS --rpc-url https://rpc.hoodi.ethpandaops.io- Replace
OWNER_ADDRESSwith your Trap's owner address. (Your main address that has deployed the Trap's contract) - If you receive
trueas a response, it means you have successfully completed all the steps.
- It may take a few minutes to successfully receive
trueas a response
source /root/.bashrc
cast call 0x25E2CeF36020A736CF8a4D2cAdD2EBE3940F4608 "getDiscordNamesBatch(uint256,uint256)(string[])" 0 2000 --rpc-url https://rpc.hoodi.ethpandaops.io- Use this
docker-compose.yamlfile instead.
version: '3'
services:
drosera1:
image: ghcr.io/drosera-network/drosera-operator:latest
container_name: drosera-node1
network_mode: host
volumes:
- drosera_data1:/data
command: node --db-file-path /data/drosera.db --network-p2p-port 31313 --server-port 31314 --eth-rpc-url RPC_URL_1 --eth-backup-rpc-url https://rpc.hoodi.ethpandaops.io --drosera-address 0x91cB447BaFc6e0EA0F4Fe056F5a9b1F14bb06e5D --eth-private-key ${ETH_PRIVATE_KEY} --listen-address 0.0.0.0 --network-external-p2p-address ${VPS_IP} --disable-dnr-confirmation true
restart: always
drosera2:
image: ghcr.io/drosera-network/drosera-operator:latest
container_name: drosera-node2
network_mode: host
volumes:
- drosera_data2:/data
command: node --db-file-path /data/drosera.db --network-p2p-port 31315 --server-port 31316 --eth-rpc-url RPC_URL_2 --eth-backup-rpc-url https://rpc.hoodi.ethpandaops.io --drosera-address 0x91cB447BaFc6e0EA0F4Fe056F5a9b1F14bb06e5D --eth-private-key ${ETH_PRIVATE_KEY2} --listen-address 0.0.0.0 --network-external-p2p-address ${VPS_IP} --disable-dnr-confirmation true
restart: always
volumes:
drosera_data1:
drosera_data2:- Replace
RPC_URL_1&RPC_URL_2with your own Ethereum Hoodie RPC, You can use Alchemy or QuickNode to create Ethereum Hoodi RPC. - You can use same RPCs for both
RPC_URL_1&RPC_URL_2. - To save:
CTRL+X,Y&ENTER
Re-run your Operators:
cd ~/Drosera-Networkdocker compose down -vdocker compose up -dNow Give it a few minutes. Boom!
-
You need to verify if you have deployed any trap before.
-
In your
drosera.tomlfile, Verify that you have a line showing your trap's address asaddress = "0x..."
If you don't see your trap's address as address = "0x..." line, Then follow the steps:
- Connect to the Dashboard using same account you used to deploy your trap:
- Select the “Traps Owned” button to display only traps that your account owns:
- Click on the trap to go to the trap’s page:
- On the trap’s page, click on the “Trap Config” address hyperlink. This will open a page to Hoodi etherscan.
- Click the button to copy the contract’s address:
- Paste that address as the value for the corresponding trap’s address field in your drosera.toml file:






















