2 releases
new 0.1.1 | Feb 7, 2025 |
---|---|
0.1.0 | Feb 7, 2025 |
#424 in Magic Beans
167 downloads per month
8KB
106 lines
Solana Airdrop Service
Linux/macOS Setup
Create a Systemd Service
-
Open a terminal and create a systemd service file:
sudo nano /etc/systemd/system/solana-airdrop.service
-
Add the following configuration:
[Unit] Description=Solana Airdrop Service After=network.target [Service] ExecStart=/usr/bin/env cargo run --release WorkingDirectory=/path/to/solana-airdrop-service Restart=always User=your-username [Install] WantedBy=multi-user.target
-
Reload the systemd daemon:
sudo systemctl daemon-reload
-
Enable and start the service:
sudo systemctl enable solana-airdrop sudo systemctl start solana-airdrop
-
Check logs:
journalctl -u solana-airdrop -f
-
Stop the service if needed:
sudo systemctl stop solana-airdrop
Windows Setup
Build the Executable
cargo build --release
Add Service Using Windows Task Scheduler
- Press
Windows + R
, typetaskschd.msc
, and press Enter. - Click "Create Basic Task".
- Set the name as "Solana Airdrop Service".
- In the "Trigger" section, choose "Daily".
- In the "Action" section, select "Start a program".
- Under "Program/script", browse and select the built
solana-airdrop-service.exe
file. - Click "Finish".
Configure Automatic Execution Every 8 Hours
- Open Task Scheduler.
- Double-click the created task.
- Go to the "Triggers" tab and click "Edit".
- Check "Repeat task every 8 hours".
Logging
Linux/macOS
To monitor logs:
tail -f /tmp/solana_airdrop.log
If using systemd:
journalctl -u solana-airdrop -f
Windows
To view logs in Windows, open the log file:
notepad C:\tmp\solana_airdrop.log
If the C:\tmp
folder does not exist, create it:
mkdir C:\tmp
Dependencies
~5–15MB
~208K SLoC