mirror of https://github.com/zlatinb/muwire
Created Tracker Daemon (markdown)
parent
8f549b48f6
commit
1a7bcb9a9f
|
@ -0,0 +1,45 @@
|
||||||
|
The MuWire Tracker Daemon or **mwtrackerd** for short is a project to enable anyone to create a website indexing MuWire hashes similar to how torrent sites work. The daemon will track the availability of a file on the MuWire network, enabling the site operator to remove any entries that are no longer available.
|
||||||
|
|
||||||
|
The daemon does not have a GUI, but exposes a JSON-RPC interface. The methods to the interface are documented below.
|
||||||
|
|
||||||
|
### Building and running
|
||||||
|
|
||||||
|
Checkout the `tracking-server-side` branch and type `./gradlew clean tracker:bootRun`
|
||||||
|
|
||||||
|
The first time the daemon runs it will launch a setup wizard which will ask you about the ports of your i2p router, what port and network interface you want to use for the JSON-RPC endpoint.
|
||||||
|
|
||||||
|
Let's say you have selected port 12345 on localhost. To verify your daemon is up and running, you can issue the following command:
|
||||||
|
```
|
||||||
|
curl -d '{"id":0,"method":"status"}' http://localhost:12345/tracker
|
||||||
|
```
|
||||||
|
|
||||||
|
If everything is fine, you should see a response like
|
||||||
|
```
|
||||||
|
{"jsonrpc":"2.0","id":0,"result":{"status":"Running","connections":20,"swarms":0}}
|
||||||
|
```
|
||||||
|
|
||||||
|
### JSON-RPC API
|
||||||
|
|
||||||
|
#### "status"
|
||||||
|
This method returns an object that contains the current status of the daemon, the number of connections to the MuWire network and how many swarms it is tracking.
|
||||||
|
|
||||||
|
#### "track"
|
||||||
|
This method takes as a parameter the string representation of the hash of the file to be tracked and starts tracking it. It returns null. Example use:
|
||||||
|
|
||||||
|
```
|
||||||
|
curl -d '{"id":0,"method":"track", "params":["hnInliLVsFQNR26fr~pvs7qnmT~~l787nCK9dQshkpg="]}' http://localhost:12345/tracker
|
||||||
|
{"jsonrpc":"2.0","id":0,"result":null}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### "forget"
|
||||||
|
This method is the opposite of the track method. It takes as a parameter the hash of the file and forgets all about it. It returns true if any swarms were forgotten and false if the file wasn't tracked to begin with. Example use:
|
||||||
|
```
|
||||||
|
curl -d '{"id":0,"method":"forget", "params":["RZnnD8-r1MBWlAKePRYYyudvHSI6naHuNR2gZ5sHIJQ="]}' http://localhost:12345/tracker
|
||||||
|
{"jsonrpc":"2.0","id":0,"result":true}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### "info" (not implemented yet)
|
||||||
|
This method will return information about a file that is being tracked, like who are the seeders and who are the leechers.
|
||||||
|
|
||||||
|
### Spring Boot Attenuator
|
||||||
|
mwtrackerd uses Spring Boot and exposes an Attenuator endpoint that shows information such as memory usage, cpu usage and so on. To find out more google for "Spring Boot Attenuator"
|
Loading…
Reference in New Issue