@leofcoin/launch-chain 0.3.1 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.js +4 -7
- package/package.json +2 -2
- package/src/index.ts +4 -4
- package/test.js +1 -1
package/index.js
CHANGED
|
@@ -89,7 +89,7 @@ const launch = async (options, password) => {
|
|
|
89
89
|
endpoint.url = `http://localhost:${endpoint.port}`;
|
|
90
90
|
const client = await getHttp(endpoint.url, options.networkVersion);
|
|
91
91
|
if (client)
|
|
92
|
-
endpoints.http.push(endpoint.url) && clients.http.push(
|
|
92
|
+
endpoints.http.push(endpoint.url) && clients.http.push(client);
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
if (options.ws) {
|
|
@@ -97,8 +97,7 @@ const launch = async (options, password) => {
|
|
|
97
97
|
if (endpoint.port && !endpoint.url)
|
|
98
98
|
endpoint.url = `ws://localhost:${endpoint.port}`;
|
|
99
99
|
const client = await getWS(endpoint.url, options.networkVersion);
|
|
100
|
-
|
|
101
|
-
endpoints.ws.push(endpoint.url) && clients.ws.push({ url: endpoint.url, client });
|
|
100
|
+
client && endpoints.ws.push(endpoint.url) && clients.ws.push(client);
|
|
102
101
|
}
|
|
103
102
|
}
|
|
104
103
|
if (endpoints.http.length === 0 && endpoints.ws.length === 0)
|
|
@@ -117,8 +116,7 @@ const launch = async (options, password) => {
|
|
|
117
116
|
await wsServer(chain, endpoint.port, options.networkVersion);
|
|
118
117
|
endpoints.ws.push(endpoint.url);
|
|
119
118
|
const client = await getWS(endpoint.url, options.networkVersion);
|
|
120
|
-
|
|
121
|
-
endpoints.ws.push(endpoint.url) && clients.ws.push({ url: endpoint.url, client });
|
|
119
|
+
client && clients.ws.push(client);
|
|
122
120
|
}
|
|
123
121
|
}
|
|
124
122
|
if (options.http) {
|
|
@@ -130,8 +128,7 @@ const launch = async (options, password) => {
|
|
|
130
128
|
await httpServer(chain, endpoint.port, options.networkVersion);
|
|
131
129
|
endpoints.http.push(endpoint.url);
|
|
132
130
|
const client = await getHttp(endpoint.url, options.networkVersion);
|
|
133
|
-
|
|
134
|
-
endpoints.http.push(endpoint.url) && clients.http.push({ url: endpoint.url, client });
|
|
131
|
+
client && clients.http.push(client);
|
|
135
132
|
}
|
|
136
133
|
}
|
|
137
134
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@leofcoin/launch-chain",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js"
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"homepage": "https://github.com/leofcoin/launch-chain#readme",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@leofcoin/chain": "^1.4.8",
|
|
27
|
-
"@leofcoin/endpoint-clients": "^0.
|
|
27
|
+
"@leofcoin/endpoint-clients": "^0.3.5",
|
|
28
28
|
"@leofcoin/endpoints": "^0.2.10",
|
|
29
29
|
"@leofcoin/networks": "^1.0.0"
|
|
30
30
|
},
|
package/src/index.ts
CHANGED
|
@@ -137,7 +137,7 @@ const launch = async (options: launchOptions, password: string): Promise<launchR
|
|
|
137
137
|
for (const endpoint of options.http) {
|
|
138
138
|
if (endpoint.port && !endpoint.url) endpoint.url = `http://localhost:${endpoint.port}`
|
|
139
139
|
const client = await getHttp(endpoint.url, options.networkVersion)
|
|
140
|
-
if (client) endpoints.http.push(endpoint.url) && clients.http.push(
|
|
140
|
+
if (client) endpoints.http.push(endpoint.url) && clients.http.push(client)
|
|
141
141
|
}
|
|
142
142
|
}
|
|
143
143
|
|
|
@@ -145,7 +145,7 @@ const launch = async (options: launchOptions, password: string): Promise<launchR
|
|
|
145
145
|
for (const endpoint of options.ws) {
|
|
146
146
|
if (endpoint.port && !endpoint.url) endpoint.url = `ws://localhost:${endpoint.port}`
|
|
147
147
|
const client = await getWS(endpoint.url, options.networkVersion)
|
|
148
|
-
|
|
148
|
+
client && endpoints.ws.push(endpoint.url) && clients.ws.push(client)
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
151
|
if (endpoints.http.length === 0 && endpoints.ws.length === 0) throw new Error(`no remotes connected`)
|
|
@@ -166,7 +166,7 @@ const launch = async (options: launchOptions, password: string): Promise<launchR
|
|
|
166
166
|
endpoints.ws.push(endpoint.url)
|
|
167
167
|
|
|
168
168
|
const client = await getWS(endpoint.url, options.networkVersion)
|
|
169
|
-
|
|
169
|
+
client && clients.ws.push(client)
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|
|
@@ -181,7 +181,7 @@ const launch = async (options: launchOptions, password: string): Promise<launchR
|
|
|
181
181
|
endpoints.http.push(endpoint.url)
|
|
182
182
|
|
|
183
183
|
const client = await getHttp(endpoint.url, options.networkVersion)
|
|
184
|
-
|
|
184
|
+
client && clients.http.push(client)
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
} else {
|
package/test.js
CHANGED