I2P Transport for nim-libp2p
nimble install https://github.com/gabbhack/i2ptransport
This library implements I2P Transport for nim-libp2p via SAM Protocol.
-
Make sure your i2p router has sam proxy enabled.
-
You must have or generate a destination and a private key.
Keys?
Check documentation for DEST GENERATE
command in SAMv3 spec.
If you already have keys, pass them to the I2PKeyPair constructor:
let keys = I2PKeyPair.init(
destination="...",
privateKey="..."
)
Or generate them
let keys = await generateDestination()
- Init session settings
Every session in I2P is associated with some ID (or nickname).
let settings = I2PSessionSettings.init(
nickname = "nickname"
)
- Init transport
let transport = I2PTransport.init(
settings,
keys
)
- Or use
I2PSwitch
let switch = I2PSwitch.new(
settings,
keys,
newRng()
)
If you don't know what to do about it, check out the examples.
At the moment nim-libp2p does not have the garlic protocol, so dns is exploited.
I2PTransport
generate and accepts something like /dns/randomstring/...
.
- Is it safe? IDK
Licensed under MIT license.
- nim-libp2p, for Nim libp2p
- i2pd, for I2P client