miner_js.go 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. package api
  2. const Miner_JS = `
  3. web3._extend({
  4. property: 'miner',
  5. methods:
  6. [
  7. new web3._extend.Method({
  8. name: 'start',
  9. call: 'miner_start',
  10. params: 1,
  11. inputFormatter: [web3._extend.formatters.formatInputInt],
  12. outputFormatter: web3._extend.formatters.formatOutputBool
  13. }),
  14. new web3._extend.Method({
  15. name: 'stop',
  16. call: 'miner_stop',
  17. params: 1,
  18. inputFormatter: [web3._extend.formatters.formatInputInt],
  19. outputFormatter: web3._extend.formatters.formatOutputBool
  20. }),
  21. new web3._extend.Method({
  22. name: 'setExtra',
  23. call: 'miner_setExtra',
  24. params: 1,
  25. inputFormatter: [web3._extend.utils.formatInputString],
  26. outputFormatter: web3._extend.formatters.formatOutputBool
  27. }),
  28. new web3._extend.Method({
  29. name: 'setGasPrice',
  30. call: 'miner_setGasPrice',
  31. params: 1,
  32. inputFormatter: [web3._extend.utils.formatInputString],
  33. outputFormatter: web3._extend.formatters.formatOutputBool
  34. }),
  35. new web3._extend.Method({
  36. name: 'startAutoDAG',
  37. call: 'miner_startAutoDAG',
  38. params: 0,
  39. inputFormatter: [],
  40. outputFormatter: web3._extend.formatters.formatOutputBool
  41. }),
  42. new web3._extend.Method({
  43. name: 'stopAutoDAG',
  44. call: 'miner_stopAutoDAG',
  45. params: 0,
  46. inputFormatter: [],
  47. outputFormatter: web3._extend.formatters.formatOutputBool
  48. }),
  49. new web3._extend.Method({
  50. name: 'makeDAG',
  51. call: 'miner_makeDAG',
  52. params: 1,
  53. inputFormatter: [web3._extend.formatters.inputDefaultBlockNumberFormatter],
  54. outputFormatter: web3._extend.formatters.formatOutputBool
  55. })
  56. ],
  57. properties:
  58. [
  59. new web3._extend.Property({
  60. name: 'hashrate',
  61. getter: 'miner_hashrate',
  62. outputFormatter: web3._extend.utils.toDecimal
  63. })
  64. ]
  65. });
  66. `