Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I2P support #2530

Closed
ghost opened this issue Nov 15, 2017 · 75 comments
Closed

I2P support #2530

ghost opened this issue Nov 15, 2017 · 75 comments
Labels
Milestone

Comments

@ghost
Copy link

ghost commented Nov 15, 2017

libtorrent version: 1.1.1.0
platform/architecture: Ubuntu 17.10

Hey, i am just curious what is the status of the I2P support. The documentation about this feature is a little bit light right now. In particular i am not sure where i do mistake in the following python code:

import libtorrent as lt
session = lt.session(flags=0)
h = session.add_torrent({'ti': lt.torrent_info('/tmp/Downloads/test.torrent'), 'save_path': '/tmp/Downloads'})
#session.listen_on(6881, 6881)
proxy_settings = lt.proxy_settings()
proxy_settings.hostname = '127.0.0.1'
proxy_settings.port = 7656
session.set_i2p_proxy(proxy_settings)

The program doesnot download anything and cannot find peers(the i2pshark do it very fast). Please help me to figure out what is going on. Am i right that libtorrent use SAM interface, so i should use port 7656?

@arvidn
Copy link
Owner

arvidn commented Nov 15, 2017

Yes, libtorrent use the SAM protocol. The main problem with libtorrent's i2p support is that it does not have any regression tests, so it's possible that it has broken at some point.

Do you have a log of the alerts you get? please enable all alerts in the alert_mask in the settings_pack.

@ghost
Copy link
Author

ghost commented Nov 15, 2017

As you suggested i added to the code

session.set_alert_mask(lt.alert.category_t.all_categories)
and

in the end
time.sleep(4)
alerts = session.pop_alerts()
for alert in alerts:
print(type(alert).name, alert.message())

And get the following:

add_torrent_alert added torrent: test
listen_succeeded_alert successfully listening on [TCP] [::]:6861
listen_succeeded_alert successfully listening on [TCP] 0.0.0.0:6861
listen_succeeded_alert successfully listening on [UDP] 0.0.0.0:6861
state_changed_alert : state changed to: downloading
torrent_checked_alert checked

Everything looks fine for me.

The torrent is from tracker2.postman.i2p. I read that previously the tracker was not supported by the libtorrent, because the program did not support base32 names. Am i correct that now base32 names are supproted?

@arvidn
Copy link
Owner

arvidn commented Nov 15, 2017

there must be more alerts than that, right? things like announces to the trackers for instance.

@ghost
Copy link
Author

ghost commented Nov 15, 2017

Indeed, it is strange. i do not see any other alerts

@arvidn
Copy link
Owner

arvidn commented Nov 15, 2017

oh, you're probably setting the mask after everything already happened. set the mask as part of the settings_pack and pass that into the session constructor

@ghost
Copy link
Author

ghost commented Nov 15, 2017

Ok, i put session = lt.session(alert_mask=lt.alert.category_t.all_categories,flags=0)
and get that the host not found. The full alert is

listen_succeeded_alert successfully listening on [TCP] [::]:6881
listen_succeeded_alert successfully listening on [TCP] 0.0.0.0:6881
listen_succeeded_alert successfully listening on [UDP] 0.0.0.0:6881
add_torrent_alert added torrent: test
torrent_added_alert added
state_changed_alert : state changed to: downloading
torrent_checked_alert checked
torrent_resumed_alert resumed
tracker_announce_alert (http://tracker2.postman.i2p/announce.php) sending announce (started)
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
tracker_error_alert (http://tracker2.postman.i2p/announce.php) (-1) Host not found (authoritative) "" (1)
tracker_announce_alert (http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) sending announce (started)
tracker_error_alert (http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) (-1) Host not found (authoritative) "" (1)
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
listen_succeeded_alert successfully listening on [TCP] [::]:6861
listen_succeeded_alert successfully listening on [TCP] 0.0.0.0:6861
listen_succeeded_alert successfully listening on [UDP] 0.0.0.0:6861
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0
stats_alert : [1000] 0 0 0 0 0 0 0 0 0 0

after few seconds in the end i get Segmentation fault (core dumped)

@ghost
Copy link
Author

ghost commented Nov 15, 2017

The program looks like this:

import libtorrent as lt
import time

session = lt.session(alert_mask=lt.alert.category_t.all_categories,flags=0)
print('Session started: ', lt.version)

h = session.add_torrent({'ti': lt.torrent_info('/tmp/Downloads/test.torrent'), 'save_path': '/tmp/Downloads/'})
#h.auto_managed(False)

session.listen_on(6861, 6861)
proxy_settings = lt.proxy_settings()
proxy_settings.type=lt.proxy_type.i2p_proxy
proxy_settings.hostname = '127.0.0.1'
proxy_settings.port = 7656
session.set_i2p_proxy(proxy_settings)
s = h.status()
s.num_peers
time.sleep(4)
alerts = session.pop_alerts()
for alert in alerts:
print(type(alert).name, alert.message())

Without h.auto_managed(False) i get the alerts above but the program crashes.

With h.auto_managed(False) the program doesnot crash and i get only this:

listen_succeeded_alert successfully listening on [TCP] [::]:6881
listen_succeeded_alert successfully listening on [TCP] 0.0.0.0:6881
listen_succeeded_alert successfully listening on [UDP] 0.0.0.0:6881
add_torrent_alert added torrent: test
torrent_added_alert added
listen_succeeded_alert successfully listening on [TCP] [::]:6861
listen_succeeded_alert successfully listening on [TCP] 0.0.0.0:6861
listen_succeeded_alert successfully listening on [UDP] 0.0.0.0:6861
state_changed_alert : state changed to: downloading
torrent_checked_alert checked

@ghost
Copy link
Author

ghost commented Nov 16, 2017

I am still trying to find my mistake. I rewrote c++

{
  using namespace libtorrent;
  namespace lt = libtorrent;

  settings_pack sett;
  sett.set_str(settings_pack::listen_interfaces, "0.0.0.0:6881");
  sett.set_int(settings_pack::proxy_type, settings_pack::i2p_proxy);
  sett.set_int(settings_pack::i2p_port, 7656);
  sett.set_str(settings_pack::i2p_hostname, "0.0.0.0");
  sett.set_bool(settings_pack::force_proxy, true);
  sett.set_bool(settings_pack::enable_upnp, false);
  sett.set_bool(settings_pack::enable_natpmp, false);
  sett.set_bool(settings_pack::enable_dht, false);
  
  lt::session s(sett);
  s.set_alert_mask(lt::alert::all_categories);
  std::vector<libtorrent::alert*> alerts;
  add_torrent_params p;
  p.save_path = "./";
  error_code ec;
  p.ti = boost::make_shared<torrent_info>(std::string(argv[1]), boost::ref(ec), 0);
  if (ec)
  {
    fprintf(stderr, "%s\n", ec.message().c_str());
    return 1;
  }
  s.add_torrent(p, ec);
 if (ec)
  {
    fprintf(stderr, "%s\n", ec.message().c_str());
    return 1;
  }

usleep(60000000);
 s.pop_alerts(&alerts);
 for(libtorrent::alert const *a : alerts) {
            std::cout << a->message();
	    printf("\n");
 }

In the result i get

successfully listening on [TCP] [::]:6881
successfully listening on [TCP] 0.0.0.0:6881
successfully listening on [UDP] 0.0.0.0:6881
added torrent: test
added
: state changed to: downloading
checked
resumed
(http://tracker2.postman.i2p/announce.php) sending announce (started)
: [1400] 0 0 0 0 0 0 0 0 0 0
(http://tracker2.postman.i2p/announce.php) (-1) "Waiting for i2p acceptor from SAM bridge" (1)
(http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) sending announce (started)
(http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) (-1) "Waiting for i2p acceptor from SAM bridge" (1)
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
incoming connection from SOME IP (TCP)
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
(http://tracker2.postman.i2p/announce.php) sending announce (started)
(http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) sending announce (started)
(http://tracker2.postman.i2p/announce.php) (-1) "Waiting for i2p acceptor from SAM bridge" (2)
(http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) (-1) "Waiting for i2p acceptor from SAM bridge" (2)
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
incoming connection from SOME IP (TCP)
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
: [1000] 0 0 0 0 0 0 0 0 0 0
Segmentation fault (core dumped)

@ghost
Copy link
Author

ghost commented Nov 17, 2017

Ok, i build libtorrent with the debug option. It seems it is some kind of bug in the libtorrent. gdb shows the following

Starting program: /home/reich/TEMP/torrents/i2p_torrents /tmp/Downloads/test.torrent
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
[New Thread 0x7ffff5d6f700 (LWP 21680)]
[New Thread 0x7ffff556e700 (LWP 21681)]
[New Thread 0x7ffff4d6d700 (LWP 21682)]
[New Thread 0x7fffeffff700 (LWP 21683)]
[New Thread 0x7fffef7fe700 (LWP 21684)]
[New Thread 0x7fffeeffd700 (LWP 21685)]
start session
config: ipv6_deprecated_ version: 1.1.5.0 revision: 37ffe99a1
max connections: 200
max files: 1024
generated peer ID:
*** session thread init
session stats header: peer.error_peers, peer.disconnected_peers, peer.eof_peers, peer.connreset_peers, peer.connrefused_peers, peer.connaborted_peers, peer.notconnected_peers, peer.perm_peers, peer.buffer_peers, peer.unreachable_peers, peer.broken_pipe_peers, peer.addrinuse_peers, peer.no_access_peers, peer.invalid_arg_peers, peer.aborted_peers, peer.piece_requests, peer.max_piece_requests, peer.invalid_piece_requests, peer.choked_piece_requests, peer.cancelled_piece_requests, peer.piece_rejects, peer.error_incoming_peers, peer.error_outgoing_peers, peer.error_rc4_peers, peer.error_encrypted_peers, peer.error_tcp_peers, peer.error_utp_peers, picker.reject_piece_picks, picker.unchoke_piece_picks, picker.incoming_redundant_piece_picks, picker.incoming_piece_picks, picker.end_game_piece_picks, picker.snubbed_piece_picks, picker.interesting_piece_picks, picker.hash_fail_piece_picks, picker.piece_picker_partial_loops, picker.piece_picker_suggest_loops, picker.piece_picker_sequential_loops, picker.piece_picker_reverse_rare_loops, picker.piece_picker_rare_loops, picker.piece_picker_rand_start_loops, picker.piece_picker_rand_loops, picker.piece_picker_busy_loops, peer.connect_timeouts, peer.uninteresting_peers, peer.timeout_peers, peer.no_memory_peers, peer.too_many_peers, peer.transport_timeout_peers, peer.num_banned_peers, peer.banned_for_hash_failure, peer.connection_attempts, peer.connection_attempt_loops, peer.incoming_connections, net.on_read_counter, net.on_write_counter, net.on_tick_counter, net.on_lsd_counter, net.on_lsd_peer_counter, net.on_udp_counter, net.on_accept_counter, net.on_disk_queue_counter, net.on_disk_counter, ses.torrent_evicted_counter, ses.num_incoming_choke, ses.num_incoming_unchoke, ses.num_incoming_interested, ses.num_incoming_not_interested, ses.num_incoming_have, ses.num_incoming_bitfield, ses.num_incoming_request, ses.num_incoming_piece, ses.num_incoming_cancel, ses.num_incoming_dht_port, ses.num_incoming_suggest, ses.num_incoming_have_all, ses.num_incoming_have_none, ses.num_incoming_reject, ses.num_incoming_allowed_fast, ses.num_incoming_ext_handshake, ses.num_incoming_pex, ses.num_incoming_metadata, ses.num_incoming_extended, ses.num_outgoing_choke, ses.num_outgoing_unchoke, ses.num_outgoing_interested, ses.num_outgoing_not_interested, ses.num_outgoing_have, ses.num_outgoing_bitfield, ses.num_outgoing_request, ses.num_outgoing_piece, ses.num_outgoing_cancel, ses.num_outgoing_dht_port, ses.num_outgoing_suggest, ses.num_outgoing_have_all, ses.num_outgoing_have_none, ses.num_outgoing_reject, ses.num_outgoing_allowed_fast, ses.num_outgoing_ext_handshake, ses.num_outgoing_pex, ses.num_outgoing_metadata, ses.num_outgoing_extended, ses.num_piece_passed, ses.num_piece_failed, ses.num_have_pieces, ses.num_total_pieces_added, disk.num_blocks_written, disk.num_blocks_read, disk.num_blocks_hashed, disk.num_blocks_cache_hits, disk.num_write_ops, disk.num_read_ops, disk.num_read_back, disk.disk_read_time, disk.disk_write_time, disk.disk_hash_time, disk.disk_job_time, ses.waste_piece_timed_out, ses.waste_piece_cancelled, ses.waste_piece_unknown, ses.waste_piece_seed, ses.waste_piece_end_game, ses.waste_piece_closing, net.sent_payload_bytes, net.sent_bytes, net.sent_ip_overhead_bytes, net.sent_tracker_bytes, net.recv_payload_bytes, net.recv_bytes, net.recv_ip_overhead_bytes, net.recv_tracker_bytes, net.recv_failed_bytes, net.recv_redundant_bytes, dht.dht_messages_in, dht.dht_messages_out, dht.dht_messages_out_dropped, dht.dht_bytes_in, dht.dht_bytes_out, dht.dht_ping_in, dht.dht_ping_out, dht.dht_find_node_in, dht.dht_find_node_out, dht.dht_get_peers_in, dht.dht_get_peers_out, dht.dht_announce_peer_in, dht.dht_announce_peer_out, dht.dht_get_in, dht.dht_get_out, dht.dht_put_in, dht.dht_put_out, dht.dht_invalid_announce, dht.dht_invalid_get_peers, dht.dht_invalid_put, dht.dht_invalid_get, utp.utp_packet_loss, utp.utp_timeout, utp.utp_packets_in, utp.utp_packets_out, utp.utp_fast_retransmit, utp.utp_packet_resend, utp.utp_samples_above_target, utp.utp_samples_below_target, utp.utp_payload_pkts_in, utp.utp_payload_pkts_out, utp.utp_invalid_pkts_in, utp.utp_redundant_pkts_in, sock_bufs.socket_send_size3, sock_bufs.socket_send_size4, sock_bufs.socket_send_size5, sock_bufs.socket_send_size6, sock_bufs.socket_send_size7, sock_bufs.socket_send_size8, sock_bufs.socket_send_size9, sock_bufs.socket_send_size10, sock_bufs.socket_send_size11, sock_bufs.socket_send_size12, sock_bufs.socket_send_size13, sock_bufs.socket_send_size14, sock_bufs.socket_send_size15, sock_bufs.socket_send_size16, sock_bufs.socket_send_size17, sock_bufs.socket_send_size18, sock_bufs.socket_send_size19, sock_bufs.socket_send_size20, sock_bufs.socket_recv_size3, sock_bufs.socket_recv_size4, sock_bufs.socket_recv_size5, sock_bufs.socket_recv_size6, sock_bufs.socket_recv_size7, sock_bufs.socket_recv_size8, sock_bufs.socket_recv_size9, sock_bufs.socket_recv_size10, sock_bufs.socket_recv_size11, sock_bufs.socket_recv_size12, sock_bufs.socket_recv_size13, sock_bufs.socket_recv_size14, sock_bufs.socket_recv_size15, sock_bufs.socket_recv_size16, sock_bufs.socket_recv_size17, sock_bufs.socket_recv_size18, sock_bufs.socket_recv_size19, sock_bufs.socket_recv_size20, ses.num_checking_torrents, ses.num_stopped_torrents, ses.num_upload_only_torrents, ses.num_downloading_torrents, ses.num_seeding_torrents, ses.num_queued_seeding_torrents, ses.num_queued_download_torrents, ses.num_error_torrents, ses.non_filter_torrents, ses.num_loaded_torrents, ses.num_pinned_torrents, peer.num_tcp_peers, peer.num_socks5_peers, peer.num_http_proxy_peers, peer.num_utp_peers, peer.num_i2p_peers, peer.num_ssl_peers, peer.num_ssl_socks5_peers, peer.num_ssl_http_proxy_peers, peer.num_ssl_utp_peers, peer.num_peers_half_open, peer.num_peers_connected, peer.num_peers_up_interested, peer.num_peers_down_interested, peer.num_peers_up_unchoked_all, peer.num_peers_up_unchoked_optimistic, peer.num_peers_up_unchoked, peer.num_peers_down_unchoked, peer.num_peers_up_requests, peer.num_peers_down_requests, peer.num_peers_up_disk, peer.num_peers_down_disk, peer.num_peers_end_game, disk.write_cache_blocks, disk.read_cache_blocks, disk.request_latency, disk.pinned_blocks, disk.disk_blocks_in_use, disk.queued_disk_jobs, disk.num_running_disk_jobs, disk.num_read_jobs, disk.num_write_jobs, disk.num_jobs, disk.num_writing_threads, disk.num_running_threads, disk.blocked_disk_jobs, disk.queued_write_bytes, ses.num_unchoke_slots, disk.num_fenced_read, disk.num_fenced_write, disk.num_fenced_hash, disk.num_fenced_move_storage, disk.num_fenced_release_files, disk.num_fenced_delete_files, disk.num_fenced_check_fastresume, disk.num_fenced_save_resume_data, disk.num_fenced_rename_file, disk.num_fenced_stop_torrent, disk.num_fenced_cache_piece, disk.num_fenced_flush_piece, disk.num_fenced_flush_hashed, disk.num_fenced_flush_storage, disk.num_fenced_trim_cache, disk.num_fenced_file_priority, disk.num_fenced_load_torrent, disk.num_fenced_clear_piece, disk.num_fenced_tick_storage, disk.arc_mru_size, disk.arc_mru_ghost_size, disk.arc_mfu_size, disk.arc_mfu_ghost_size, disk.arc_write_size, disk.arc_volatile_size, dht.dht_nodes, dht.dht_node_cache, dht.dht_torrents, dht.dht_peers, dht.dht_immutable_data, dht.dht_mutable_data, dht.dht_allocated_observers, net.has_incoming_connections, net.limiter_up_queue, net.limiter_down_queue, net.limiter_up_bytes, net.limiter_down_bytes, utp.num_utp_idle, utp.num_utp_syn_sent, utp.num_utp_connected, utp.num_utp_fin_sent, utp.num_utp_close_wait, utp.num_utp_deleted
not starting DHT announce timer: m_dht == NULL
done starting session
update listen interfaces: 0.0.0.0:6881
open listen port
listening on: [::]:6881 external port: 6881
listening on: 0.0.0.0:6881 external port: 6881
successfully listening on [TCP] [::]:6881
successfully listening on [TCP] 0.0.0.0:6881
successfully listening on [UDP] 0.0.0.0:6881
>>> SET_TOS [ udp_socket tos: 20 e: Bad file descriptor ]
added torrent: Test.Torrent
Test.Torrent added
Test.Torrent: creating torrent: Test.Torrent max-uploads: -1 max-connections: -1 upload-limit: -1 download-limit: -1 flags: apply-ip-filter paused auto-managed update-subscribe save-path: /tmp/Downloads/
Test.Torrent: *** set-max-uploads: 16777215
Test.Torrent: *** set-max-connections: 16777215
Test.Torrent: *** UPDATE LIST [ torrent_want_scrape : 1 ]
Test.Torrent: init torrent: Test.Torrent
Test.Torrent: init, async_check_fastresume
Test.Torrent: fastresume data accepted
Test.Torrent: state changed to: downloading
Test.Torrent: set_state() 3
Test.Torrent: *** UPDATE LIST [ torrent_downloading_auto_managed : 1 ]
Test.Torrent checked
Test.Torrent: start_announcing(), paused
Test.Torrent: auto manager starting torrent
Test.Torrent: *** UPDATE LIST [ torrent_want_scrape : 0 ]
Test.Torrent resumed
Test.Torrent: *** UPDATE LIST [ torrent_want_tick : 1 ]
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 i->tier: 0 tier: 2147483647 working: 1 fails: 0 limit: 0 upd: 0 can: 1 sent: 0 ]
Test.Torrent: ==> TRACKER REQUEST "http://tracker2.postman.i2p/announce.php" event: started abort: 0 
Test.Torrent (http://tracker2.postman.i2p/announce.php) sending announce (started)
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 1 fails: 0 limit: 0 upd: 1 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 0 next_announce_in: 877468233
Test.Torrent: [1402] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: *** tracker error: (161)  Waiting for i2p acceptor from SAM bridge
Test.Torrent: *** increment tracker fail count [1]
Test.Torrent (http://tracker2.postman.i2p/announce.php) (-1)  "Waiting for i2p acceptor from SAM bridge" (1)
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 can: 0 sent: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 i->tier: 1 tier: 2147483647 working: 1 fails: 0 limit: 0 upd: 0 can: 1 sent: 0 ]
Test.Torrent: ==> TRACKER REQUEST "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" event: started abort: 0
Test.Torrent (http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) sending announce (started)
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 1 fails: 0 limit: 0 upd: 1 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -16
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" 
[ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 1 fails: 0 limit: 0 upd: 1 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -16
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 1 fails: 0 limit: 0 upd: 1 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -17
Test.Torrent: *** tracker error: (161)  Waiting for i2p acceptor from SAM bridge
Test.Torrent: *** increment tracker fail count [1]
Test.Torrent (http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) (-1)  "Waiting for i2p acceptor from SAM bridge" (1)
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 can: 0 sent: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 can: 0 sent: 0 ]
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -16
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -17
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 can: 1 sent: 0 ]
Test.Torrent: ==> TRACKER REQUEST "http://tracker2.postman.i2p/announce.php" event: started abort: 0
Test.Torrent (http://tracker2.postman.i2p/announce.php) sending announce (started)
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 can: 1 sent: 1 ]
Test.Torrent: ==> TRACKER REQUEST "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" event: started abort: 0
Test.Torrent (http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) sending announce (started)
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 1 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 0 next_announce_in: 877468250
Test.Torrent: *** tracker error: (161)  Waiting for i2p acceptor from SAM bridge
Test.Torrent: *** increment tracker fail count [2]
Test.Torrent (http://tracker2.postman.i2p/announce.php) (-1)  "Waiting for i2p acceptor from SAM bridge" (2)
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 can: 0 sent: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 1 can: 0 sent: 0 ]
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 1 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -54
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" 
[ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 1 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -55
Test.Torrent: *** tracker error: (161)  Waiting for i2p acceptor from SAM bridge
Test.Torrent: *** increment tracker fail count [2]
Test.Torrent (http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a) (-1)  "Waiting for i2p acceptor from SAM bridge" (2)
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 can: 0 sent: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 can: 0 sent: 0 ]
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -54
Test.Torrent: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 ]
Test.Torrent: *** tracker: "http://s5ikrdyjwbcgxmqetxb3nyheizftms7euacuub2hic7defkh3xhq.b32.i2p/a" [ tiers: 0 trackers: 0 found: 0 i->tier: 1 tier: 2147483647 working: 0 fails: 2 limit: 0 upd: 0 ]
Test.Torrent: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -55
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
assertion failed. Please file a bugreport at https://github.com/arvidn/libtorrent/issues
Please include the following information:

version: 1.1.5.0-37ffe99a1

file: 'http_connection.cpp'
line: 498
function: void libtorrent::http_connection::connect_i2p_tracker(const char*)
expression: m_sock.get<socket_type>()

stack:
1: assert_fail(char const*, int, char const*, char const*, char const*, int)
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13: clone


Thread 2 "i2p_torrents" received signal SIGABRT, Aborted.
[Switching to Thread 0x7ffff5d6f700 (LWP 21680)]
__GI_raise (sig=<optimized out>) at ../sysdeps/unix/sysv/linux/raise.c:51
51      ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb)
(gdb)
(gdb)
(gdb) quit

@ghost
Copy link
Author

ghost commented Nov 17, 2017

Also, i turned off the openssl. I get the error in the different place

Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
Test.Torrent: [1000] 0 0 0 0 0 0 0 0 0 0
assertion failed. Please file a bugreport at https://github.com/arvidn/libtorrent/issues
Please include the following information:

version: 1.1.5.0-37ffe99a1

file: 'http_connection.cpp'
line: 631
function: void libtorrent::http_connection::on_connect(const boost::system::error_code&)
expression: m_connecting

stack:
1: assert_fail(char const*, int, char const*, char const*, char const*, int)
2:
3:
4:
5:
6:
7:
8:
9:
10:
11: clone

@arvidn arvidn added the bug label Nov 17, 2017
@arvidn arvidn added this to the 1.1.6 milestone Nov 17, 2017
@arvidn
Copy link
Owner

arvidn commented Nov 25, 2017

yeah, it seems like there's an issue with the i2p support in the http_connection or http_tracker_connection. The proper fix for this includes implementing a simple mock SAM server in the simulator, to be able to have tests. The reason I haven't done that yet is that I haven't really considered i2p support a critical (or particularly popular) feature.

@arvidn
Copy link
Owner

arvidn commented Nov 25, 2017

this error message: "*** tracker error: (161) Waiting for i2p acceptor from SAM bridge"
suggests that the SAM connection isn't being established correctly. That's no excuse to assert or crash obviously, but it might be worth looking at what might be going on with the bridge if you want to get it to work.

specifically, it means the local i2p endpoint has not been looked up yet (which is done by the SAM name lookup of "ME"). It either means we haven't even connected yet, or the name lookup hasn't returned (which presumably means something is wrong)

@arvidn
Copy link
Owner

arvidn commented Nov 27, 2017

does this help any? #2564

@arvidn
Copy link
Owner

arvidn commented Dec 3, 2017

@reichKV do you think you will have a chance to try that patch?

@ghost
Copy link
Author

ghost commented Dec 3, 2017

Sure i will try to do it

@ghost
Copy link
Author

ghost commented Dec 3, 2017

Sorry for the delay. I understand that i am probably the only one in the world who uses libtorrent in i2p. I need this for educational purposes. And I appreciate your help.

i used your pathes and with the test program, which i described above, i get the following

  1. No crashes.
  2. However the program starts and almost immediately stops. The alerts are:

added torrent: test.mkv
test.mkv added
test.mkv: creating torrent: test.mkv max-uploads: -1 max-connections: -1 upload-limit: -1 download-limit: -1 flags: apply-ip-filter paused auto-managed update-subscribe save-path: /tmp/
test.mkv: *** set-max-uploads: 16777215
test.mkv: *** set-max-connections: 16777215
test.mkv: *** UPDATE LIST [ torrent_want_scrape : 1 ]
test.mkv: init torrent: test.mkv
test.mkv: init, async_check_fastresume
test.mkv: fastresume data accepted
test.mkv: state changed to: downloading
test.mkv: set_state() 3
test.mkv: *** UPDATE LIST [ torrent_downloading_auto_managed : 1 ]
test.mkv checked
test.mkv: start_announcing(), paused
test.mkv: auto manager starting torrent
test.mkv: *** UPDATE LIST [ torrent_want_scrape : 0 ]
test.mkv resumed
test.mkv: *** UPDATE LIST [ torrent_want_tick : 1 ]
test.mkv: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 i->tier: 0 tier: 2147483647 working: 1 fails: 0 limit: 0 upd: 0 can: 1 sent: 0 ]
test.mkv: ==> TRACKER REQUEST "http://tracker2.postman.i2p/announce.php" event: started abort: 0
test.mkv: *** QUEUE_TRACKER_REQUEST [ listen_port: 0 ]
test.mkv (http://tracker2.postman.i2p/announce.php) sending announce (started)
test.mkv: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 1 fails: 0 limit: 0 upd: 1 ]
test.mkv: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 0 next_announce_in: 878891115
test.mkv: [1402] 0 0 0 0 0 0 0 0 0 0
test.mkv: *** tracker error: (161) Waiting for i2p acceptor from SAM bridge
test.mkv: *** increment tracker fail count [1]
test.mkv (http://tracker2.postman.i2p/announce.php) (-1) "Waiting for i2p acceptor from SAM bridge" (1)
test.mkv: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 can: 0 sent: 0 ]
test.mkv: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
test.mkv: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -17
test.mkv: *** tracker: "http://tracker2.postman.i2p/announce.php" [ tiers: 0 trackers: 0 found: 0 i->tier: 0 tier: 2147483647 working: 0 fails: 1 limit: 0 upd: 0 ]
test.mkv: *** update tracker timer: next_announce < now 0 m_waiting_tracker: 1 next_announce_in: -17
test.mkv: [1000] 0 0 0 0 0 0 0 0 0 0
test.mkv: [1000] 0 0 0 0 0 0 0 0 0 0

In the i2pd console i see the following:

22:12:22@698/info - Clients: starting SAM bridge at 127.0.0.1:7656
22:13:04@115/debug - SAM: new connection from 127.0.0.1:53036
22:13:04@115/error - SAM: handshake read error: End of file
22:13:04@115/debug - SAMSocket::CloseStream, reason: SAM: handshake read error
22:13:04@115/debug - SAMSocket::CloseStream, reason: ~SAMSocket()
22:15:47@115/debug - SAM: new connection from 127.0.0.1:53206
22:15:47@115/debug - SAM: handshake HELLO VERSION MIN=3.0 MAX=3.0
22:15:47@115/error - SAM: read error: End of file
22:15:47@115/debug - SAMSocket::CloseStream, reason: SAM: read error
22:15:47@115/debug - SAMSocket::CloseStream, reason: ~SAMSocket()
22:15:58@115/debug - SAM: new connection from 127.0.0.1:53210
22:15:58@115/debug - SAM: handshake HELLO VERSION MIN=3.0 MAX=3.0
22:15:58@115/debug - SAM: session create: STYLE=STREAM ID=67c6697351ff4aec29cdbaabf2fbe3467cc254f8 DESTINATION=TRANSIENT
22:16:18@115/debug - SAMSocket::SendMessageReply, close=false reason: SESSION STATUS RESULT=OK DESTINATION=8CCWXo2kGoyBlNpzO-2ZE2worlht4qEkwhT-..................
22:16:18@115/error - SAM: read error: End of file
22:16:18@115/debug - SAMSocket::CloseStream, reason: SAM: read error
22:16:18@115/debug - SAMSocket::CloseStream, reason: ~SAMSocket()

@ghost
Copy link
Author

ghost commented Dec 3, 2017

Previously i got the errors with the standard java i2p and c++ i2p. Right now i used c++ i2p. I can do the same with java i2p if you think the problem can be with the router

@arvidn arvidn modified the milestones: 1.1.6, 1.1.7 Jan 28, 2018
@gitbugged
Copy link

@ReichKV you're certainly not the only one, I just encountered the same bug. This is also a blocker for qBittorrent implementing it. With the death of Net Neutrality and more ISPs throttling/blocking torrents, I think this issue will begin to see more popularity. Hopefully it will get resolved soon so that we can get libtorrent-based torrent clients back on the network.

@gitbugged
Copy link

gitbugged commented Feb 19, 2018

Possibly related:

I2P developers told me that the implementation of SAM control protocol in the official libtorrent is not complete. The b32 announce protocol was not implemented, and only b64 announce protocol was implemented, but it is not supported by postman.i2p tracker.

@arvidn arvidn modified the milestones: 1.1.7, 1.1.8 Apr 9, 2018
@arvidn arvidn modified the milestones: 1.1.8, 1.1.9 Jun 26, 2018
@arvidn arvidn modified the milestones: 1.1.9, 1.1.10 Aug 19, 2018
@proninyaroslav
Copy link

Is I2P ready for real use? I'm interested in the implementation of this functionality in my app, but as far as I understand this feature is still buggy.

@master255
Copy link

@TomasGlgg
Copy link

TomasGlgg commented Mar 25, 2022

@master255

https://xakep.ru/2014/09/04/i2p-secrets/

Lol, this article was written by the developer of I2Pd, all the problems mentioned in it have been fixed for a long time.

@TomasGlgg
Copy link

@master255
I advise you to read more relevant information: https://habr.com/ru/post/554062/
And as a bonus: https://habr.com/ru/post/570128/

@master255
Copy link

@TomasGlgg @cathalgarvey Torrents are decentralized. If everyone distributes content and it cannot be traced and blocked (as in Url-seeds), that would mean complete anonymity for the source?
Otherwise, if you want to distribute content anonymously alone, there are many more ways to do it without torrents.
The main question is, if you are alone, why do you need torrents? After all, torrents are needed to distribute the load when downloading data.

@TomasGlgg
Copy link

TomasGlgg commented Mar 26, 2022

@master255

The main question is, if you are alone, why do you need torrents?

Are we alone? Have you seen the statistics of the local tracker in I2P?

@arvidn
Copy link
Owner

arvidn commented Mar 26, 2022

it seems this thread is drifting a bit off-topic.

libtorrent (used to) support i2p via its SAM bridge (which on the libtorrent side is configured as a kind of proxy). There are no tests for this unfortunately, so it's possible it has bit rotted a bit.

If the SAM protocol has changed in the last 10 years, that would also explain it.

@absolutep
Copy link

If the SAM protocol has changed in the last 10 years, that would also explain it.

Yes, It has changed. https://geti2p.net/en/docs/api/samv3

Also, I2P is updated to newer version - https://geti2p.net/en/blog/post/2022/2/21/1.7.0-Release

Update - https://geti2p.net/en/docs/applications/bittorrent

Here's the reason, with screenshots, why I am asking for this specific request - qbittorrent/qBittorrent#16257

@Superfly-Johnson
Copy link

It may be possible to design unit tests using libi2pd. Unfortunately the process is totally undocumented...

@absolutep
Copy link

UPDATE AS OF JUNE 2022

SAM version 3 = https://geti2p.net/en/docs/api/samv3

Also, I2P is updated to newer version - https://geti2p.net/en/blog/post/2022/5/23/1.8.0-Release

Update - https://geti2p.net/en/docs/applications/bittorrent

New UDP protocol introduced in i2p 1.8.0 called SSU = https://geti2p.net/en/docs/transport/ssu

Specs of the proposal = https://geti2p.net/spec/proposals/159-ssu2

more information on this is present in release data of 1.8.0 (provided above)

Here's the reason, with screenshots, why I am asking for this specific request - qbittorrent/qBittorrent#16257

@cathalgarvey
Copy link

cathalgarvey commented Oct 11, 2022 via email

@master255
Copy link

master255 commented Oct 11, 2022

@cathalgarvey I was recently in USA. They sell any sim cards without a passport. Torrents work great in them. So which countries have problems?

Mexico sells any sim cards without a passport too. Directly from official stores.

@ri-gilfanov
Copy link

ri-gilfanov commented Oct 11, 2022

@master255, buying a SIM card without person identification is already difficult in China, Germany, Poland, Russia, Spain and other countries. This can create problems with the law for the seller.

Besides. Mobile devices usually transfer their serial number to mobile operators. Therefore the simple replacement of the SIM card does not give anonymity.

You might think that there is a workaround. For example, you buy a new device, and then persuade a homeless person to buy you a SIM card in his name. Homeless people usually do not refuse money and alcohol. But there is another problem.

The location of the mobile device can be found using triangulation. This is usually enough to find a pirate or a dissident. If the city recognition system has been introduced in the city, then calculating the senders and recipients of Internet traffic is even easier.

Sorry for my google translate.

@master255
Copy link

@ri-gilfanov There's a firewall in China. In Russia, anonymous SIM cards are sold and torrents are not banned by ISPs. That only leaves some European countries.

It is possible, at best, to calculate the location of base stations with the accuracy of the house. But not to the apartment where you live.

Imei can be changed with full rights on the device (super user).

That is why torrents are still anonymous everywhere except in some European countries and China.

@ivan1986
Copy link

Guys, just add support with the option to turn it on and off, you don’t need to decide legal and other issues for the user, who needs to turn it on, who doesn’t need to turn it off

@ri-gilfanov
Copy link

ri-gilfanov commented Oct 12, 2022

I have to agree with @ivan1986. Talking about the legal risks of users is beyond the scope of the topic.

@master255, I will point out one thing. The Bittorrent protocol works best with a static IP address.

The anonymous I2P network provide an anonymous alternative to the static IP address in the clearnet.

@jiigen
Copy link
Contributor

jiigen commented Nov 23, 2022

any progress on this topic? I2P has gained more attention lately and would be great to be able to use libtorrent with it.
Libtorrent would be the perfect companion for i2pd ( the c++ i2p router implementation) since so far the only way for torrenting on i2p for i2pd users is using a java client like Vuze, BiglyBT or the standalone i2psnark. There's a golang client too but doesn't seem to be in active development.
Fixing libtorrent i2p support would let very popular clients like qbittorrent and deluge to use i2p.

@absolutep
Copy link

Update on I2P side as of December 2022.

SAM has been upgraded.

SSU2 has been launched.

I2P itself upgraded to 2.0

I2P router upgraded to 0.9.56

only way for torrenting on i2p for i2pd users is using a java client like Vuze, BiglyBT

Very soon Vuze won't work cause approximately 50% of all I2P network is upgrading to 2.0 & 0.9.56. I suggest BiglyBT because it is regularly maintained.

Fixing libtorrent i2p support would let very popular clients like qbittorrent and deluge to use i2p.

100%. I want qBittorrent to work flawlessly with I2P or atleast have an inbuilt router just like BiglyBT has.

@Vort
Copy link
Contributor

Vort commented Jan 6, 2023

I tested I2P support today.

Versions:

  • Deluge 2.1.1 win64 lt2.0
  • i2pd 2.45.0
  • i2p 2.0.0-0

Settings: Proxy type I2P, address 127.0.0.1, port 7656

Result:
Torrent client establishes connection to 127.0.0.1:7656, then following conversation happens:

HELLO VERSION MIN=3.0 MAX=3.0
HELLO REPLY RESULT=OK VERSION=3.0

Then torrent client closes connection and writes
i2p_alert: i2p_error: [i2p error] parse failed
error into log file.

I don't know how it is possible to fail parsing of such simple message, but library fails to do this.

@Vort
Copy link
Contributor

Vort commented Jan 6, 2023

I decided to test with libtorrent directly and to use latest version.

Build command is something like that:
g++ -I../libtorrent/include libtorrent_test.cpp -L../libtorrent/build -ltorrent-rasterbar -lws2_32 -static-libgcc -static-libstdc++ -Wl,-Bstatic -lpthread -Wl,-Bdynamic -o libtorrent_test.exe
Execute command is like that:
./libtorrent_test.exe
Source code is combination of

#include <iostream>
#include <thread>
#include <chrono>

#include <libtorrent/session.hpp>
#include <libtorrent/session_params.hpp>
#include <libtorrent/add_torrent_params.hpp>
#include <libtorrent/torrent_handle.hpp>
#include <libtorrent/alert_types.hpp>
#include <libtorrent/magnet_uri.hpp>

int main(int argc, char const* argv[]) try
{
  const char* magnet =
    "magnet:?xt=urn:btih:cb18974db461c640c0d938710203bb263a746694"
    "&dn=I2P%2B+Universal+Installer+2.0.0%2B"
    "&tr=http://tracker2.postman.i2p/announce.php";
  lt::settings_pack p;

  p.set_str(lt::settings_pack::listen_interfaces, "0.0.0.0:6881");
  p.set_int(lt::settings_pack::proxy_type, lt::settings_pack::i2p_proxy);
  p.set_int(lt::settings_pack::i2p_port, 7656);
  p.set_str(lt::settings_pack::i2p_hostname, "127.0.0.1");
  p.set_bool(lt::settings_pack::enable_upnp, false);
  p.set_bool(lt::settings_pack::enable_natpmp, false);
  p.set_bool(lt::settings_pack::enable_dht, false);

  p.set_int(lt::settings_pack::alert_mask,
    lt::alert_category::status | lt::alert_category::error);
  lt::session ses(p);

  lt::add_torrent_params atp = lt::parse_magnet_uri(magnet);
  atp.save_path = "."; // save in current dir
  lt::torrent_handle h = ses.add_torrent(std::move(atp));

  for (;;) {
    std::vector<lt::alert*> alerts;
    ses.pop_alerts(&alerts);

    for (lt::alert const* a : alerts) {
      std::cout << a->message() << std::endl;
      // if we receive the finished alert or an error, we're done
      if (lt::alert_cast<lt::torrent_finished_alert>(a)) {
        goto done;
      }
      if (lt::alert_cast<lt::torrent_error_alert>(a)) {
        goto done;
      }
    }
    std::this_thread::sleep_for(std::chrono::milliseconds(200));
  }
  done:
  std::cout << "done, shutting down" << std::endl;
}
catch (std::exception& e)
{
  std::cerr << "Error: " << e.what() << std::endl;
}

Result is the same [I2P] parse failed error along with many others:

successfully listening on [uTP] 0.0.0.0:6881
I2P+ Universal Installer 2.0.0+ added
I2P+ Universal Installer 2.0.0+: state changed to: dl metadata
added torrent: I2P+ Universal Installer 2.0.0+
i2p_error: [i2p error] parse failed
i2p_error: [system] Подключение к сети было разорвано локальной системой
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
i2p_error: [system] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] parse failed
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Подключение к сети было разорвано локальной системой
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] Предоставленный дескриптор файла неверен
I2P+ Universal Installer 2.0.0+ resumed
I2P+ Universal Installer 2.0.0+ (http://tracker2.postman.i2p/announce.php)[0.0.0.0:6881] v1  "Waiting for i2p acceptor from SAM bridge" (1)
I2P+ Universal Installer 2.0.0+ (http://tracker2.postman.i2p/announce.php)[0.0.0.0:6881] v1  "Waiting for i2p acceptor from SAM bridge" (2)
I2P+ Universal Installer 2.0.0+ (http://tracker2.postman.i2p/announce.php)[0.0.0.0:6881] v1  "Waiting for i2p acceptor from SAM bridge" (3)

@Vort
Copy link
Contributor

Vort commented Jan 7, 2023

Looks like something wrong happened in 2019.
In commit 2373077 i2p_stream::read_line function was moved from i2p_stream.cpp to i2p_stream.hpp and during that process extra block of code was added.
When I removed it:

async_read(m_sock, boost::asio::buffer(&m_buffer[read_pos], 1), wrap_allocator(
[this](error_code const& ec, std::size_t, Handler hn) {
start_read_line(ec, std::move(hn));
}, std::move(h)));

SAM connection process went further and SAM session was created.
It still failed at the end (when tested with i2pd 2.45.0):

$ ./libtorrent_test.exe
successfully listening on [uTP] 0.0.0.0:6881
I2P+ Universal Installer 2.0.0+ added
I2P+ Universal Installer 2.0.0+: state changed to: dl metadata
added torrent: I2P+ Universal Installer 2.0.0+
I2P+ Universal Installer 2.0.0+ resumed
I2P+ Universal Installer 2.0.0+ (http://tracker2.postman.i2p/announce.php)[0.0.0.0:6881] v1  "Waiting for i2p acceptor from SAM bridge" (1)
I2P+ Universal Installer 2.0.0+ (http://tracker2.postman.i2p/announce.php)[0.0.0.0:6881] v1  "Waiting for i2p acceptor from SAM bridge" (2)
listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] unknown error
I2P+ Universal Installer 2.0.0+ (http://tracker2.postman.i2p/announce.php)[0.0.0.0:6881] v1 Этот хост неизвестен "" (3)
I2P+ Universal Installer 2.0.0+ (http://tracker2.postman.i2p/announce.php)[0.0.0.0:6881] v1 Этот хост неизвестен "" (4)
I2P+ Universal Installer 2.0.0+ (http://tracker2.postman.i2p/announce.php)[0.0.0.0:6881] v1 Этот хост неизвестен "" (5)

But I think it is still important to fix support at least partially.
@arvidn please check mentioned commit and look if that code block is really needed there.


upd. listening on 0.0.0.0:0 (device: i2p) failed: [sock_accept] [I2P] unknown error happens because remaining variable includes null character here:

string_view remaining(m_buffer.data(), m_buffer.size());

And sometimes this check fails because "OK" != "OK\0" here:
if ("OK"_sv == value)

So that line, probably, should look like:
string_view remaining(m_buffer.data(), m_buffer.size() - 1);

@Vort
Copy link
Contributor

Vort commented Jan 22, 2023

Most likely, #7272 solved problems described in this bugreport.
I think that now it is better to create new reports with freshly found problems than putting all information in single issue.

@arvidn
Copy link
Owner

arvidn commented Apr 10, 2023

addressed here: #7356

@arvidn arvidn closed this as completed Apr 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests