Skip to content

Commit

Permalink
Add KadPrefix() for discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
IronGauntlets committed Jul 25, 2024
1 parent 5dfb06e commit afa52dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion p2p/p2p.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func NewWithHost(p2phost host.Host, peers string, feederNode bool, bc *blockchai

func makeDHT(p2phost host.Host, addrInfos []peer.AddrInfo) (*dht.IpfsDHT, error) {
return dht.New(context.Background(), p2phost,
dht.ProtocolPrefix(starknet.Prefix),
dht.ProtocolPrefix(starknet.KadPrefix()),
dht.BootstrapPeers(addrInfos...),
dht.RoutingTableRefreshPeriod(routingTableRefreshPeriod),
dht.Mode(dht.ModeServer),
Expand Down
4 changes: 4 additions & 0 deletions p2p/starknet/ids.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ import (

const Prefix = "/starknet"

func KadPrefix() protocol.ID {
return Prefix + "/kad"
}

func HeadersPID() protocol.ID {
return Prefix + "/headers/0.1.0-rc.0"
}
Expand Down

0 comments on commit afa52dd

Please sign in to comment.