oc-discovery + auto create peer
This commit is contained in:
@@ -68,7 +68,7 @@ func (ix *LongLivedStreamRecordedService[T]) gc() {
|
|||||||
}
|
}
|
||||||
ix.PubsubMu.Lock()
|
ix.PubsubMu.Lock()
|
||||||
if ix.LongLivedPubSubs[TopicPubSubNodeActivity] != nil {
|
if ix.LongLivedPubSubs[TopicPubSubNodeActivity] != nil {
|
||||||
ad, err := pp.AddrInfoFromString("/ip4/" + conf.GetConfig().Hostname + " /tcp/" + fmt.Sprintf("%v", conf.GetConfig().NodeEndpointPort) + "/p2p/" + ix.Host.ID().String())
|
ad, err := pp.AddrInfoFromString("/ip4/" + conf.GetConfig().Hostname + "/tcp/" + fmt.Sprintf("%v", conf.GetConfig().NodeEndpointPort) + "/p2p/" + ix.Host.ID().String())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if b, err := json.Marshal(TopicNodeActivityPub{
|
if b, err := json.Marshal(TopicNodeActivityPub{
|
||||||
Disposer: *ad,
|
Disposer: *ad,
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ func (ix *IndexerService) handleNodePublish(s network.Stream) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ix.LongLivedPubSubs[common.TopicPubSubNodeActivity] != nil && !rec.NoPub {
|
if ix.LongLivedPubSubs[common.TopicPubSubNodeActivity] != nil && !rec.NoPub {
|
||||||
ad, err := peer.AddrInfoFromString("/ip4/" + conf.GetConfig().Hostname + " /tcp/" + fmt.Sprintf("%v", conf.GetConfig().NodeEndpointPort) + "/p2p/" + ix.Host.ID().String())
|
ad, err := peer.AddrInfoFromString("/ip4/" + conf.GetConfig().Hostname + "/tcp/" + fmt.Sprintf("%v", conf.GetConfig().NodeEndpointPort) + "/p2p/" + ix.Host.ID().String())
|
||||||
if err == nil {
|
if err == nil {
|
||||||
if b, err := json.Marshal(common.TopicNodeActivityPub{
|
if b, err := json.Marshal(common.TopicNodeActivityPub{
|
||||||
Disposer: *ad,
|
Disposer: *ad,
|
||||||
|
|||||||
@@ -237,7 +237,7 @@ func (d *Node) claimInfo(
|
|||||||
}
|
}
|
||||||
|
|
||||||
rec.APIUrl = endPoint
|
rec.APIUrl = endPoint
|
||||||
rec.StreamAddress = "/ip4/" + conf.GetConfig().Hostname + " /tcp/" + fmt.Sprintf("%v", conf.GetConfig().NodeEndpointPort) + "/p2p/" + rec.PeerID
|
rec.StreamAddress = "/ip4/" + conf.GetConfig().Hostname + "/tcp/" + fmt.Sprintf("%v", conf.GetConfig().NodeEndpointPort) + "/p2p/" + rec.PeerID
|
||||||
rec.NATSAddress = oclib.GetConfig().NATSUrl
|
rec.NATSAddress = oclib.GetConfig().NATSUrl
|
||||||
rec.WalletAddress = "my-wallet"
|
rec.WalletAddress = "my-wallet"
|
||||||
rec.ExpiryDate = expiry
|
rec.ExpiryDate = expiry
|
||||||
|
|||||||
Reference in New Issue
Block a user