Swan Miner tool
Project description
Miner Tool Guide
Getting Started
This miner tool listens to the tasks come from Swan platform. It provides the following functions:
- Start arial2 download service for downloading tasks.
- Import deals once download completed.
- Synchronize deal status with Swan platform, so client will know the realtime status changes
Prerequisites
sudo apt install python3-pip
pip3 install -r requirements.txt
sudo apt install aria2
Config
For aria2.conf
- rpc-secret: default: my_aria2_secret. It will be used in the config.toml for rpc.
For config.toml
[main]
- api_url: Swan API address. For Swan production, it is "https://api.filswan.com"
- miner_fid: Your filecoin Miner ID
- expected_sealing_time: The time expected for sealing deals. Deals starting too soon will be rejected.
- import_interval: Importing interval between each deal.
- scan_interval: Time interval to scan all the ongoing deals and update status on Swan platform.
- api_key & access_token: Acquire from Filswan -> "My Profile"->"Developer Settings". You can also check the Guide
[aria2]
- aria2_download_dir: Directory where offline deal files will be downloaded for importing
- aria2_conf: Aria2 configuration file location
- aria2_host: Aria2 server address
- aria2_port: Aria2 server port
- aria2_secret: Must be the same value as rpc-secre in aria2.conf
Run Aria2 as System Service
sudo mkdir /etc/aria2
sudo chown $USER:$USER /etc/aria2/
touch /etc/aria2/aria2.session
git clone https://github.com/nebulaai/swan-miner
cp swan-miner/filswan_miner/aria2.conf /etc/aria2/
sudo cp swan-miner/filswan_miner/aria2c.service /etc/systemd/system/
# Change User and Group in the [Service] section of the aria2c.service file
sudo systemctl enable aria2c.service
sudo systemctl start aria2c.service
Start swan_miner
import filswan_miner
from filswan_miner import swan_miner as miner
if __name__ == "__main__":
miner.start("/path/to/config.toml")
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
filswan_miner-0.3.tar.gz
(16.4 kB
view details)
Built Distribution
File details
Details for the file filswan_miner-0.3.tar.gz
.
File metadata
- Download URL: filswan_miner-0.3.tar.gz
- Upload date:
- Size: 16.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 81be3b8c29562ac82f221adff57d6ec31f75f4a55204f4d4ac4869aa6a8bebf1 |
|
MD5 | 9b1392a7f06baef4aade721e8dd9e059 |
|
BLAKE2b-256 | 7a2e2e759d90b295b3fb772eba6b82873e4822ebe1dd2dd0c85b5a753b8950fc |
File details
Details for the file filswan_miner-0.3-py3-none-any.whl
.
File metadata
- Download URL: filswan_miner-0.3-py3-none-any.whl
- Upload date:
- Size: 19.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.55.0 CPython/3.6.9
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93ad54de071efd616a60db67c277e045a3be15707b0cad5ab4fefc7629581d5a |
|
MD5 | 9b3b9efcfbe832d790558495a06f998e |
|
BLAKE2b-256 | 98f85f63383d09aa857414146ad338994acf341bdaa341bec8c2ff4c5c776968 |