@instadapp/interop-x 0.0.0-dev.3e0fb42 → 0.0.0-dev.75809ae
Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.addresses = void 0;
|
4
4
|
exports.addresses = {
|
5
5
|
1: {
|
6
|
-
gnosisSafe: '
|
6
|
+
gnosisSafe: '0x811Bff6eF88dAAA0aD6438386B534A81cE3F160F',
|
7
7
|
multisend: "0xA238CBeb142c10Ef7Ad8442C6D1f9E89e07e7761",
|
8
8
|
},
|
9
9
|
137: {
|
package/dist/net/peer/index.js
CHANGED
@@ -22,6 +22,7 @@ const libp2p_kad_dht_1 = __importDefault(require("libp2p-kad-dht"));
|
|
22
22
|
//@ts-ignore
|
23
23
|
const libp2p_pubsub_peer_discovery_1 = __importDefault(require("libp2p-pubsub-peer-discovery"));
|
24
24
|
const protocol_1 = require("../protocol");
|
25
|
+
const config_1 = __importDefault(require("../../config"));
|
25
26
|
const logger = new logger_1.default("Peer");
|
26
27
|
let node;
|
27
28
|
// Known peers addresses
|
@@ -85,6 +86,9 @@ const startPeer = async ({}) => {
|
|
85
86
|
node.connectionManager.on("peer:connect", (connection) => logger.log(`Connected to ${connection.remotePeer.toB58String()}`));
|
86
87
|
logger.log("Peer discovery started");
|
87
88
|
await (0, waait_1.default)(1000);
|
89
|
+
setInterval(() => protocol_1.protocol.sendPeerInfo({
|
90
|
+
publicAddress: config_1.default.wallet.address,
|
91
|
+
}), 5000);
|
88
92
|
};
|
89
93
|
exports.startPeer = startPeer;
|
90
94
|
const stopPeer = async () => {
|
package/package.json
CHANGED
package/src/net/peer/index.ts
CHANGED
@@ -16,6 +16,7 @@ import KadDHT from "libp2p-kad-dht";
|
|
16
16
|
//@ts-ignore
|
17
17
|
import PubsubPeerDiscovery from "libp2p-pubsub-peer-discovery";
|
18
18
|
import { protocol } from "../protocol";
|
19
|
+
import config from "../../config";
|
19
20
|
|
20
21
|
const logger = new Logger("Peer");
|
21
22
|
|
@@ -97,6 +98,11 @@ export const startPeer = async ({ }: IPeerOptions) => {
|
|
97
98
|
logger.log("Peer discovery started");
|
98
99
|
|
99
100
|
await wait(1000);
|
101
|
+
|
102
|
+
|
103
|
+
setInterval(() => protocol.sendPeerInfo({
|
104
|
+
publicAddress: config.wallet.address,
|
105
|
+
}), 5000)
|
100
106
|
};
|
101
107
|
|
102
108
|
export const stopPeer = async () => {
|
@@ -113,7 +113,7 @@ class Protocol extends EventEmitter {
|
|
113
113
|
}
|
114
114
|
|
115
115
|
|
116
|
-
public sendPeerInfo(data:
|
116
|
+
public sendPeerInfo(data: Pick<IPeerInfo, 'publicAddress'>) {
|
117
117
|
const message = this.protocolMessages.find((m) => m.name === 'PeerInfo')!
|
118
118
|
|
119
119
|
const encoded = rlp.encode([message.code, message.encode(data)]);
|