github.com/jeffallen/go-ethereum@v1.1.4-0.20150910155051-571d3236c49c/rpc/api/miner_js.go (about) 1 // Copyright 2015 The go-ethereum Authors 2 // This file is part of the go-ethereum library. 3 // 4 // The go-ethereum library is free software: you can redistribute it and/or modify 5 // it under the terms of the GNU Lesser General Public License as published by 6 // the Free Software Foundation, either version 3 of the License, or 7 // (at your option) any later version. 8 // 9 // The go-ethereum library is distributed in the hope that it will be useful, 10 // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 // GNU Lesser General Public License for more details. 13 // 14 // You should have received a copy of the GNU Lesser General Public License 15 // along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>. 16 17 package api 18 19 const Miner_JS = ` 20 web3._extend({ 21 property: 'miner', 22 methods: 23 [ 24 new web3._extend.Method({ 25 name: 'start', 26 call: 'miner_start', 27 params: 1, 28 inputFormatter: [null] 29 }), 30 new web3._extend.Method({ 31 name: 'stop', 32 call: 'miner_stop', 33 params: 1, 34 inputFormatter: [null] 35 }), 36 new web3._extend.Method({ 37 name: 'setEtherbase', 38 call: 'miner_setEtherbase', 39 params: 1, 40 inputFormatter: [web3._extend.formatters.formatInputInt], 41 outputFormatter: web3._extend.formatters.formatOutputBool 42 }), 43 new web3._extend.Method({ 44 name: 'setExtra', 45 call: 'miner_setExtra', 46 params: 1, 47 inputFormatter: [null] 48 }), 49 new web3._extend.Method({ 50 name: 'setGasPrice', 51 call: 'miner_setGasPrice', 52 params: 1, 53 inputFormatter: [web3._extend.utils.fromDecial] 54 }), 55 new web3._extend.Method({ 56 name: 'startAutoDAG', 57 call: 'miner_startAutoDAG', 58 params: 0, 59 inputFormatter: [] 60 }), 61 new web3._extend.Method({ 62 name: 'stopAutoDAG', 63 call: 'miner_stopAutoDAG', 64 params: 0, 65 inputFormatter: [] 66 }), 67 new web3._extend.Method({ 68 name: 'makeDAG', 69 call: 'miner_makeDAG', 70 params: 1, 71 inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter] 72 }) 73 ], 74 properties: 75 [ 76 new web3._extend.Property({ 77 name: 'hashrate', 78 getter: 'miner_hashrate', 79 outputFormatter: web3._extend.utils.toDecimal 80 }) 81 ] 82 }); 83 `