Commit Graph

19 Commits

Author SHA1 Message Date
Max
38d5be9aaf
Make packet streams bidirectional (#121) 2026-06-18 22:11:32 +00:00
Roland Urbano
3f573ef293
fix(config): error on ambiguous peer ID prefix (#113)
FindPeerByIDPrefix previously returned the first peer whose ID started
with the given prefix, silently ignoring further matches. With Ed25519
peer IDs all sharing the leading "12D3KooW" (8 chars), short prefixes
can match multiple peers; the chosen peer then depends on slice order,
which is effectively undefined from the user's perspective.

Change FindPeerByIDPrefix and its wrapper FindPeerByCLIRef to return
(*Peer, error):

  - 0 matches -> (nil, nil)
  - 1 match   -> (&peer, nil)
  - 2+ match  -> (nil, error) describing the ambiguity

Call sites in config.Read and rpc/server.go updated accordingly:
ambiguity surfaces as a config-load / CLI error instead of a silent
wrong-peer resolution.

Not a wire-protocol or config-format change. Only behavior visible at
CLI invocation and config load. Users relying on short prefixes that
happened to match multiple peers will now see a clear error and must
lengthen the prefix.
2026-05-23 22:26:05 +02:00
Roland Urbano
2e36bcdce6
Enhanced Logging with ipfs/go-log (#90)
* Added ipfs/go-log and updated up.go

Use ipfs/go-log over fmt.Println

Fixed more log usages with go-log

Signed-off-by: Roland Urbano <urbano.roland@gmail.com>

log: refactor log usage to provide module global logger with configurable log level

Signed-off-by: Roland Urbano <urbano.roland@gmail.com>

Refactored logger initialization for modules

Signed-off-by: Roland Urbano <urbano.roland@gmail.com>

Removed object member loggers

Signed-off-by: Roland Urbano <urbano.roland@gmail.com>

* Implemented logging with ipfs/go-log

logging: fix logger level config

Co-authored-by: Max <max@privatevoid.net>

Update svc/network.go

Co-authored-by: Max <max@privatevoid.net>

removed static info log level constant

Co-authored-by: Max <max@privatevoid.net>

Update dns/server.go

Co-authored-by: Max <max@privatevoid.net>

Update dns/server.go

Co-authored-by: Max <max@privatevoid.net>

Update rpc/server.go

Co-authored-by: Max <max@privatevoid.net>

Applied MR suggestions

Signed-off-by: Roland Urbano <urbano.roland@gmail.com>

Enhanced logging

Signed-off-by: Roland Urbano <urbano.roland@gmail.com>

* update vendorHash

* go fmt

---------

Signed-off-by: Roland Urbano <urbano.roland@gmail.com>
Co-authored-by: Max <max@privatevoid.net>
2025-12-07 19:31:49 +00:00
Max
df929520a9
rpc: try to remove socket if already exists (#89) 2025-12-05 15:14:40 +00:00
Max
e994260bdb
Node refactor (#88)
* node: extract most of the logic from cli/up.go

* node: close interface after bringing it down

* synchronize shutdowns with a WaitGroup

* p2p: use Connect instead of DialPeer

* rpc: defer Close
2025-11-30 14:28:51 +01:00
Jörg Thalheim
fc42d2eec0
Fix various linting issues. (#68)
* remove unused vars/functions

* all constants need explicit types

See https://staticcheck.dev/docs/checks/#SA9004

* cli/up: add missing error checks

* server: fix potential race condition of chown when binding listening socket

a process waiting for the socket appear may bind before we can apply
filesystem permissions.
2024-11-17 17:20:01 +00:00
Max
88705394c0
IPv6 (dual stack) (#14)
* assign and route ipv6 addresses

* dns: support A and AAAA records

* rpc: include v6 routes in route show
2024-05-11 23:04:52 +02:00
Max
0fe98f90ab select peers by name or ID prefix 2024-04-28 00:21:23 +02:00
Max
0e857a45a0 print node names in route show 2024-04-28 00:21:23 +02:00
Max
1422c1fafd print node names in status 2024-04-28 00:21:23 +02:00
Max
4a3de64fd3 implement route add, route del 2024-04-28 00:20:30 +02:00
Max
7c780d9d6b a bunch of stuff at once
- dynamic addressing
- DNS
- switch to cidranger for routing
- auto add routes to tun device
- pex: shut up
2024-04-28 00:19:31 +02:00
Max
3cc3516d83 remove manual routing support 2024-04-28 00:19:31 +02:00
Max
3fdc8106de HyprspaceRPC.Route: validate argument count 2024-04-28 00:18:25 +02:00
Max
91445e8578 support manually configuring relays 2024-04-28 00:18:25 +02:00
Max
a1d0027f78 show latency in status 2024-04-28 00:18:25 +02:00
Max
1b9bc3be8d update config file format 2024-04-28 00:17:29 +02:00
Max
9c08fdf29b implement RPC client and new CLI commands 2024-04-28 00:17:29 +02:00
Max
ae84f2d076 implement RPC server 2024-04-28 00:17:29 +02:00