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
2bb8af15
Commit
2bb8af15
authored
Nov 03, 2017
by
yann300
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
options to open rpc server
parent
8c8f8e36
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
5 deletions
+18
-5
main.js
src/main.js
+3
-1
startMistGeth.js
src/services/startMistGeth.js
+15
-4
No files found.
src/main.js
View file @
2bb8af15
...
@@ -15,6 +15,8 @@ program
...
@@ -15,6 +15,8 @@ program
.
option
(
'-f, --frontend <front-end>'
,
'Folder that should be served by remixd'
)
.
option
(
'-f, --frontend <front-end>'
,
'Folder that should be served by remixd'
)
.
option
(
'-p, --frontend-port <front-end-port>'
,
'Http port used by the frontend (default 8082)'
)
.
option
(
'-p, --frontend-port <front-end-port>'
,
'Http port used by the frontend (default 8082)'
)
.
option
(
'-a, --auto-mine'
,
'mine pending transactions'
)
.
option
(
'-a, --auto-mine'
,
'mine pending transactions'
)
.
option
(
'-r, --rpc <cors-domains>'
,
'start rpc server. Values are CORS domain'
)
.
option
(
'-rp, --rpc-port'
,
'rpc server port (default 8545)'
)
.
parse
(
process
.
argv
)
.
parse
(
process
.
argv
)
console
.
log
(
'example: --dev-path /home/devchains/chain1 --mist --geth --frontend /home/frontend --frontend-port 8084 --auto-mine'
)
console
.
log
(
'example: --dev-path /home/devchains/chain1 --mist --geth --frontend /home/frontend --frontend-port 8084 --auto-mine'
)
program
.
outputHelp
()
program
.
outputHelp
()
...
@@ -23,7 +25,7 @@ var killCallBack = []
...
@@ -23,7 +25,7 @@ var killCallBack = []
if
(
program
.
devPath
)
{
if
(
program
.
devPath
)
{
if
(
fs
.
existsSync
(
program
.
devPath
))
{
if
(
fs
.
existsSync
(
program
.
devPath
))
{
killCallBack
.
push
(
startmistGeth
(
program
.
devPath
,
program
.
mist
,
program
.
geth
,
program
.
autoMine
))
killCallBack
.
push
(
startmistGeth
(
program
.
devPath
,
program
.
mist
,
program
.
geth
,
program
.
autoMine
,
program
.
rpc
,
program
.
rpcPort
))
}
else
{
}
else
{
console
.
log
(
'
\
x1b[31m%s
\
x1b[0m'
,
'[ERR] can
\'
t start mist/geth. '
+
program
.
devPath
+
' does not exist'
)
console
.
log
(
'
\
x1b[31m%s
\
x1b[0m'
,
'[ERR] can
\'
t start mist/geth. '
+
program
.
devPath
+
' does not exist'
)
}
}
...
...
src/services/startMistGeth.js
View file @
2bb8af15
...
@@ -5,9 +5,7 @@ var Web3 = require('web3')
...
@@ -5,9 +5,7 @@ var Web3 = require('web3')
var
net
=
require
(
'net'
)
var
net
=
require
(
'net'
)
var
connectTimeout
var
connectTimeout
module
.
exports
=
function
(
dataDir
,
mist
,
geth
,
mine
)
{
module
.
exports
=
function
(
dataDir
,
mist
,
geth
,
mine
,
rpc
,
rpcPort
)
{
console
.
log
(
mist
)
console
.
log
(
geth
)
console
.
log
(
'opening dev env at '
+
dataDir
)
console
.
log
(
'opening dev env at '
+
dataDir
)
// geth --vmdebug --dev --ipcpath /home/yann/Ethereum/testchains/test2/geth.ipc --datadir /home/yann/Ethereum/testchains/test2
// geth --vmdebug --dev --ipcpath /home/yann/Ethereum/testchains/test2/geth.ipc --datadir /home/yann/Ethereum/testchains/test2
var
gethprocess
var
gethprocess
...
@@ -19,7 +17,20 @@ module.exports = function (dataDir, mist, geth, mine) {
...
@@ -19,7 +17,20 @@ module.exports = function (dataDir, mist, geth, mine) {
'--ipcpath'
,
ipcPath
,
'--ipcpath'
,
ipcPath
,
'--datadir'
,
dataDir
'--datadir'
,
dataDir
]
]
console
.
log
(
'starting geth ... '
+
ipcPath
)
if
(
rpc
)
{
gethArgs
.
push
(
'--rpc'
)
gethArgs
.
push
(
'--rpccorsdomain'
)
gethArgs
.
push
(
rpc
)
gethArgs
.
push
(
'--rpcapi'
)
gethArgs
.
push
(
'web3,eth,debug,net'
)
if
(
!
rpcPort
)
{
rpcPort
=
8545
}
gethArgs
.
push
(
'--rpcport'
)
gethArgs
.
push
(
rpcPort
)
}
console
.
log
(
gethArgs
)
console
.
log
(
'starting geth ... '
)
gethprocess
=
run
(
'geth'
,
gethArgs
)
gethprocess
=
run
(
'geth'
,
gethArgs
)
connectTimeout
=
setInterval
(()
=>
{
connectTimeout
=
setInterval
(()
=>
{
...
...
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