Closed lxiaodao closed 6 years ago
You don't need any params. Just miner_start
.
Here's the way I start it from RPC:
curl -X POST --data '{"jsonrpc":"2.0","method":"miner_start","params":[],"id":67}'
zilm13,Thanks for your comment. I have started the miner.
But how to add parameter recieved Account to miner_start?
@lxiaodao you should do it from config or pass params via command line.
This is default options:
https://github.com/ethereum/ethereumj/blob/develop/ethereumj-core/src/main/resources/ethereumj.conf#L282-L320
Just override what you want in custom config or pass it via command line by adding something like this
-Dmine.coinbase=dd0f441d5262eae5af597bdcb3a40e50d4e1ed1c
@zilm13 Thanks again,it is clear.
Btw I was wrong, we had methods in rpc and terminal but they were not documented. I've added it to the help (develop only for now): https://github.com/ether-camp/ethereum-harmony/commit/8655efb1e1f472ed9f1f1adb7f4f38b0878e8df0
@zilm13 I see the document after you modify. I also find a issues maybe when run the command like this gradlew runClassic -Dserver.port=7000 -Dethereumj.conf.res=E:/business/classic.conf
.The parameter -Dethereumj.conf.res is not effected. Only after I modify the build.gradle like below:
def bootRunWithNetworkConfig(String name, boolean includePresets) {
def newArgs = []
if (includePresets) {
addJvmArgIfEmpty "database.dir", getDatabaseDir("database-" + name)
// change by lxiaodao 201803014
// "ethereumj.conf.res", "E:/business/classic.conf"
def conf_name=name;
if(name=='classic'){
conf_name='E:/business/classic';
}
newArgs.addAll([
'-Dethereumj.conf.res=' + conf_name + '.conf',
'-Ddatabase.name=database-' + name,
'-DnetworkProfile=' + name])
}
// set heap size configure in task
if (!project.hasProperty('jvmArgs') || project.jvmArgs.indexOf('-Xmx') == -1) {
println('Set default heap size for task ' + maxHeapSize)
newArgs.add(maxHeapSize)
} else {
println('Using heap size from user input ' + project.jvmArgs)
}
bootRun.jvmArgs.addAll(newArgs)
println 'Running Java with ' + bootRun.jvmArgs
tasks.compileJava.execute()
tasks.bootRun.execute()
}
gradlew runMain -Dserver.port=9000
3.See the Terminal in the left menu tree. 4.In the Terminal,try the command.could anybody give me some advice?