Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
baas-ide
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
guxukai
baas-ide
Commits
4a1c86fe
Commit
4a1c86fe
authored
Jun 08, 2021
by
aniket-engg
Committed by
Aniket
Jul 20, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
slither websocket listener
parent
b35ab8eb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
13 additions
and
3 deletions
+13
-3
remixd.ts
libs/remixd/src/bin/remixd.ts
+7
-1
index.ts
libs/remixd/src/index.ts
+3
-1
serviceList.ts
libs/remixd/src/serviceList.ts
+1
-0
websocket.ts
libs/remixd/src/websocket.ts
+2
-1
No files found.
libs/remixd/src/bin/remixd.ts
View file @
4a1c86fe
...
@@ -25,6 +25,7 @@ async function warnLatestVersion () {
...
@@ -25,6 +25,7 @@ async function warnLatestVersion () {
const
services
=
{
const
services
=
{
git
:
(
readOnly
:
boolean
)
=>
new
servicesList
.
GitClient
(
readOnly
),
git
:
(
readOnly
:
boolean
)
=>
new
servicesList
.
GitClient
(
readOnly
),
hardhat
:
(
readOnly
:
boolean
)
=>
new
servicesList
.
HardhatClient
(
readOnly
),
hardhat
:
(
readOnly
:
boolean
)
=>
new
servicesList
.
HardhatClient
(
readOnly
),
slither
:
(
readOnly
:
boolean
)
=>
new
servicesList
.
SlitherClient
(
readOnly
),
folder
:
(
readOnly
:
boolean
)
=>
new
servicesList
.
Sharedfolder
(
readOnly
)
folder
:
(
readOnly
:
boolean
)
=>
new
servicesList
.
Sharedfolder
(
readOnly
)
}
}
...
@@ -32,11 +33,12 @@ const services = {
...
@@ -32,11 +33,12 @@ const services = {
const
ports
=
{
const
ports
=
{
git
:
65521
,
git
:
65521
,
hardhat
:
65522
,
hardhat
:
65522
,
slither
:
65523
,
folder
:
65520
folder
:
65520
}
}
const
killCallBack
:
Array
<
Function
>
=
[]
const
killCallBack
:
Array
<
Function
>
=
[]
function
startService
<
S
extends
'git'
|
'hardhat'
|
'folder'
>
(
service
:
S
,
callback
:
(
ws
:
WS
,
sharedFolderClient
:
servicesList
.
Sharedfolder
,
error
?:
Error
)
=>
void
)
{
function
startService
<
S
extends
'git'
|
'hardhat'
|
'
slither'
|
'
folder'
>
(
service
:
S
,
callback
:
(
ws
:
WS
,
sharedFolderClient
:
servicesList
.
Sharedfolder
,
error
?:
Error
)
=>
void
)
{
const
socket
=
new
WebSocket
(
ports
[
service
],
{
remixIdeUrl
:
program
.
remixIde
},
()
=>
services
[
service
](
program
.
readOnly
||
false
))
const
socket
=
new
WebSocket
(
ports
[
service
],
{
remixIdeUrl
:
program
.
remixIde
},
()
=>
services
[
service
](
program
.
readOnly
||
false
))
socket
.
start
(
callback
)
socket
.
start
(
callback
)
killCallBack
.
push
(
socket
.
close
.
bind
(
socket
))
killCallBack
.
push
(
socket
.
close
.
bind
(
socket
))
...
@@ -94,6 +96,10 @@ function errorHandler (error: any, service: string) {
...
@@ -94,6 +96,10 @@ function errorHandler (error: any, service: string) {
sharedFolderClient
.
setupNotifications
(
program
.
sharedFolder
)
sharedFolderClient
.
setupNotifications
(
program
.
sharedFolder
)
sharedFolderClient
.
sharedFolder
(
program
.
sharedFolder
)
sharedFolderClient
.
sharedFolder
(
program
.
sharedFolder
)
})
})
startService
(
'slither'
,
(
ws
:
WS
,
sharedFolderClient
:
servicesList
.
Sharedfolder
)
=>
{
sharedFolderClient
.
setWebSocket
(
ws
)
sharedFolderClient
.
sharedFolder
(
program
.
sharedFolder
)
})
// Run hardhat service if a hardhat project is shared as folder
// Run hardhat service if a hardhat project is shared as folder
const
hardhatConfigFilePath
=
absolutePath
(
'./'
,
program
.
sharedFolder
)
+
'/hardhat.config.js'
const
hardhatConfigFilePath
=
absolutePath
(
'./'
,
program
.
sharedFolder
)
+
'/hardhat.config.js'
const
isHardhatProject
=
fs
.
existsSync
(
hardhatConfigFilePath
)
const
isHardhatProject
=
fs
.
existsSync
(
hardhatConfigFilePath
)
...
...
libs/remixd/src/index.ts
View file @
4a1c86fe
...
@@ -2,6 +2,7 @@
...
@@ -2,6 +2,7 @@
import
{
RemixdClient
as
sharedFolder
}
from
'./services/remixdClient'
import
{
RemixdClient
as
sharedFolder
}
from
'./services/remixdClient'
import
{
GitClient
}
from
'./services/gitClient'
import
{
GitClient
}
from
'./services/gitClient'
import
{
HardhatClient
}
from
'./services/hardhatClient'
import
{
HardhatClient
}
from
'./services/hardhatClient'
import
{
SlitherClient
}
from
'./services/slitherClient'
import
Websocket
from
'./websocket'
import
Websocket
from
'./websocket'
import
*
as
utils
from
'./utils'
import
*
as
utils
from
'./utils'
...
@@ -11,6 +12,7 @@ module.exports = {
...
@@ -11,6 +12,7 @@ module.exports = {
services
:
{
services
:
{
sharedFolder
,
sharedFolder
,
GitClient
,
GitClient
,
HardhatClient
HardhatClient
,
SlitherClient
}
}
}
}
libs/remixd/src/serviceList.ts
View file @
4a1c86fe
export
{
RemixdClient
as
Sharedfolder
}
from
'./services/remixdClient'
export
{
RemixdClient
as
Sharedfolder
}
from
'./services/remixdClient'
export
{
GitClient
}
from
'./services/gitClient'
export
{
GitClient
}
from
'./services/gitClient'
export
{
HardhatClient
}
from
'./services/hardhatClient'
export
{
HardhatClient
}
from
'./services/hardhatClient'
export
{
SlitherClient
}
from
'./services/slitherClient'
libs/remixd/src/websocket.ts
View file @
4a1c86fe
...
@@ -19,7 +19,8 @@ export default class WebSocket {
...
@@ -19,7 +19,8 @@ export default class WebSocket {
const
listeners
=
{
const
listeners
=
{
65520
:
'remixd'
,
65520
:
'remixd'
,
65521
:
'git'
,
65521
:
'git'
,
65522
:
'hardhat'
65522
:
'hardhat'
,
65523
:
'slither'
}
}
this
.
server
.
on
(
'error'
,
(
error
:
Error
)
=>
{
this
.
server
.
on
(
'error'
,
(
error
:
Error
)
=>
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment