../
swrm development log: 01
Hello again,
The swrm project has been going good. I’m drowing in spec sheets and docs. But, I’ve made decent progress in the little time I got to work on this. I did the following:
- Torrent files can now be parsed - wrote a bencoding parser
- Can get peer list from tracker - can connect to the tracker and fetch peer list
- Can connect to a peer and perform a handshake - can track peers and establish a connection
This took a little while, and obviously the whole NO LLM rule, that I set for myself, didn’t make it any easier. But, it was so much fun building this out.
Now, I can easily connect to peers listed by tracker and fetch their peer id. Here is some output:
$ go run cmd/swrmd/main.go
Peer List: &{Interval:900 Peers:[{IP:178.67.144.47 Port:51414} {IP:5.187.85.143 Port:15842} {IP:47.5.136.82 Port:34936} {IP:217.119.76.38 Port:51413} {IP:77.33.175.70 Port:51413} {IP:185.53.155.155 Port:22946} {IP:216.197.207.49 Port:51413} {IP:152.173.76.249 Port:65411} {IP:188.40.110.30 Port:51774} {IP:193.32.249.132 Port:45333} {IP:65.175.200.69 Port:51413} {IP:65.94.251.36 Port:51413} {IP:82.124.84.162 Port:6881} {IP:78.126.224.94 Port:51413} {IP:76.141.82.71 Port:6881} {IP:82.66.74.86 Port:9999} {IP:104.234.212.137 Port:34216} {IP:71.150.226.54 Port:51414} {IP:74.215.102.86 Port:34343} {IP:84.159.108.56 Port:12001} {IP:77.248.219.164 Port:6881} {IP:116.202.135.149 Port:60653} {IP:82.64.151.15 Port:42102} {IP:95.52.231.132 Port:51413} {IP:89.149.226.87 Port:6848} {IP:67.83.206.60 Port:8999} {IP:107.183.79.180 Port:51413} {IP:172.11.12.93 Port:49467} {IP:89.98.162.17 Port:6996} {IP:85.215.176.70 Port:4240} {IP:31.18.147.94 Port:51413} {IP:109.76.206.130 Port:51413} {IP:188.137.46.184 Port:6677} {IP:94.111.2.116 Port:51413} {IP:108.28.225.113 Port:51413} {IP:92.116.100.112 Port:51413} {IP:31.208.29.84 Port:55191} {IP:107.200.112.221 Port:31000} {IP:98.117.166.65 Port:52238} {IP:15.218.70.48 Port:51413} {IP:76.167.216.130 Port:51413} {IP:178.254.33.75 Port:51413} {IP:91.184.170.207 Port:33665} {IP:213.139.9.170 Port:16881} {IP:85.156.77.175 Port:62717} {IP:46.253.249.134 Port:16881} {IP:51.159.104.35 Port:51413} {IP:77.166.159.138 Port:51413} {IP:188.68.53.4 Port:48768} {IP:86.254.50.207 Port:28552}]}
Successfully connected to: -TR4050-55m32n7wddf4 (178.67.144.47:51414)
Next up, Actually requesting and fetching the required pieces from peers.
That’s it, Bye!