Skip to content
This repository was archived by the owner on Oct 11, 2024. It is now read-only.

Commit cedb995

Browse files
authored
Merge pull request #272 from 0xProject/release/1.0.4-beta
Release version 1.0.4-beta
2 parents 3dc6764 + dc6f9c1 commit cedb995

File tree

7 files changed

+24
-12
lines changed

7 files changed

+24
-12
lines changed

DEPLOYMENT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Version](https://img.shields.io/badge/version-1.0.3--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
1+
[![Version](https://img.shields.io/badge/version-1.0.4--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
22

33
# 0x Mesh Deployment Guide
44

DEVELOPMENT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Version](https://img.shields.io/badge/version-1.0.3--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
1+
[![Version](https://img.shields.io/badge/version-1.0.4--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
22

33
# 0x Mesh Development Guide
44

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Version](https://img.shields.io/badge/version-1.0.3--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
1+
[![Version](https://img.shields.io/badge/version-1.0.4--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
22
[![Chat with us on Discord](https://img.shields.io/badge/chat-Discord-blueViolet.svg)](https://discord.gg/HF7fHwk)
33
[![GoDoc](https://godoc.org/github.com/0xProject/0x-mesh?status.svg)](https://godoc.org/github.com/0xProject/0x-mesh)
44
[![Circle CI](https://img.shields.io/circleci/project/0xProject/0x-mesh/master.svg)](https://circleci.com/gh/0xProject/0x-mesh/tree/master)
@@ -12,7 +12,7 @@
1212

1313
## Versions
1414

15-
You are looking at the documentation for version `1.0.3-beta`. To see the
15+
You are looking at the documentation for version `1.0.4-beta`. To see the
1616
documentation for a different version, visit the
1717
[Releases Page](https://github.com/0xProject/0x-mesh/releases).
1818

USAGE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Version](https://img.shields.io/badge/version-1.0.3--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
1+
[![Version](https://img.shields.io/badge/version-1.0.4--beta-orange.svg)](https://github.com/0xProject/0x-mesh/releases)
22

33
# 0x Mesh Usage Guide
44

core/core.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ func New(config Config) (*App, error) {
107107
log.SetLevel(log.Level(config.Verbosity))
108108
log.WithFields(map[string]interface{}{
109109
"config": config,
110-
"version": "1.0.3-beta",
110+
"version": "1.0.4-beta",
111111
}).Info("Initializing new core.App")
112112

113113
if config.EthereumRPCMaxContentLength < maxOrderSizeInBytes {

examples/beta_telemetry_node/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3'
22

33
services:
44
mesh:
5-
image: 0xorg/mesh:1.0.3-beta
5+
image: 0xorg/mesh:1.0.4-beta
66
restart: always
77
logging:
88
driver: fluentd

p2p/node.go

+17-5
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import (
2222
peer "github.com/libp2p/go-libp2p-peer"
2323
peerstore "github.com/libp2p/go-libp2p-peerstore"
2424
pubsub "github.com/libp2p/go-libp2p-pubsub"
25+
routing "github.com/libp2p/go-libp2p-routing"
2526
ma "github.com/multiformats/go-multiaddr"
2627
log "github.com/sirupsen/logrus"
2728
)
@@ -97,6 +98,7 @@ type Config struct {
9798

9899
// New creates a new Node with the given config.
99100
func New(config Config) (*Node, error) {
101+
100102
nodeCtx, cancel := context.WithCancel(context.Background())
101103

102104
if config.MessageHandler == nil {
@@ -107,6 +109,18 @@ func New(config Config) (*Node, error) {
107109
return nil, errors.New("config.RendezvousString is required")
108110
}
109111

112+
// We need to declare the newDHT function ahead of time so we can use it in
113+
// the libp2p.Routing option.
114+
var kadDHT *dht.IpfsDHT
115+
newDHT := func(h host.Host) (routing.PeerRouting, error) {
116+
var err error
117+
kadDHT, err = NewDHT(nodeCtx, h)
118+
if err != nil {
119+
log.WithField("error", err).Fatal("could not create DHT")
120+
}
121+
return kadDHT, err
122+
}
123+
110124
// Set up the transport and the host.
111125
// Note: 0.0.0.0 will use all available addresses.
112126
hostAddr, err := ma.NewMultiaddr(fmt.Sprintf("/ip4/0.0.0.0/tcp/%d", config.ListenPort))
@@ -119,6 +133,9 @@ func New(config Config) (*Node, error) {
119133
libp2p.ListenAddrs(hostAddr),
120134
libp2p.Identity(config.PrivateKey),
121135
libp2p.ConnectionManager(connManager),
136+
libp2p.EnableAutoRelay(),
137+
libp2p.EnableRelay(),
138+
libp2p.Routing(newDHT),
122139
}
123140
if config.Insecure {
124141
opts = append(opts, libp2p.NoSecurity)
@@ -130,11 +147,6 @@ func New(config Config) (*Node, error) {
130147
}
131148

132149
// Set up DHT for peer discovery.
133-
kadDHT, err := NewDHT(nodeCtx, basicHost)
134-
if err != nil {
135-
cancel()
136-
return nil, err
137-
}
138150
routingDiscovery := discovery.NewRoutingDiscovery(kadDHT)
139151

140152
// Set up pubsub.

0 commit comments

Comments
 (0)