admin_js.go 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. // Copyright 2015 The go-ethereum Authors
  2. // This file is part of go-ethereum.
  3. //
  4. // go-ethereum 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. // go-ethereum 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 go-ethereum. If not, see <http://www.gnu.org/licenses/>.
  16. package api
  17. const Admin_JS = `
  18. web3._extend({
  19. property: 'admin',
  20. methods:
  21. [
  22. new web3._extend.Method({
  23. name: 'addPeer',
  24. call: 'admin_addPeer',
  25. params: 1,
  26. inputFormatter: [null]
  27. }),
  28. new web3._extend.Method({
  29. name: 'exportChain',
  30. call: 'admin_exportChain',
  31. params: 1,
  32. inputFormatter: [null]
  33. }),
  34. new web3._extend.Method({
  35. name: 'importChain',
  36. call: 'admin_importChain',
  37. params: 1,
  38. inputFormatter: [null]
  39. }),
  40. new web3._extend.Method({
  41. name: 'sleepBlocks',
  42. call: 'admin_sleepBlocks',
  43. params: 2,
  44. inputFormatter: [null, null]
  45. }),
  46. new web3._extend.Method({
  47. name: 'verbosity',
  48. call: 'admin_verbosity',
  49. params: 1,
  50. inputFormatter: [web3._extend.utils.fromDecimal]
  51. }),
  52. new web3._extend.Method({
  53. name: 'setSolc',
  54. call: 'admin_setSolc',
  55. params: 1,
  56. inputFormatter: [null]
  57. }),
  58. new web3._extend.Method({
  59. name: 'startRPC',
  60. call: 'admin_startRPC',
  61. params: 4,
  62. inputFormatter: [null, null, null, null]
  63. }),
  64. new web3._extend.Method({
  65. name: 'stopRPC',
  66. call: 'admin_stopRPC',
  67. params: 0,
  68. inputFormatter: []
  69. }),
  70. new web3._extend.Method({
  71. name: 'setGlobalRegistrar',
  72. call: 'admin_setGlobalRegistrar',
  73. params: 2,
  74. inputFormatter: [null,null]
  75. }),
  76. new web3._extend.Method({
  77. name: 'setHashReg',
  78. call: 'admin_setHashReg',
  79. params: 2,
  80. inputFormatter: [null,null]
  81. }),
  82. new web3._extend.Method({
  83. name: 'setUrlHint',
  84. call: 'admin_setUrlHint',
  85. params: 2,
  86. inputFormatter: [null,null]
  87. }),
  88. new web3._extend.Method({
  89. name: 'saveInfo',
  90. call: 'admin_saveInfo',
  91. params: 2,
  92. inputFormatter: [null,null]
  93. }),
  94. new web3._extend.Method({
  95. name: 'register',
  96. call: 'admin_register',
  97. params: 3,
  98. inputFormatter: [null,null,null]
  99. }),
  100. new web3._extend.Method({
  101. name: 'registerUrl',
  102. call: 'admin_registerUrl',
  103. params: 3,
  104. inputFormatter: [null,null,null]
  105. }),
  106. new web3._extend.Method({
  107. name: 'startNatSpec',
  108. call: 'admin_startNatSpec',
  109. params: 0,
  110. inputFormatter: []
  111. }),
  112. new web3._extend.Method({
  113. name: 'stopNatSpec',
  114. call: 'admin_stopNatSpec',
  115. params: 0,
  116. inputFormatter: []
  117. }),
  118. new web3._extend.Method({
  119. name: 'getContractInfo',
  120. call: 'admin_getContractInfo',
  121. params: 1,
  122. inputFormatter: [null],
  123. }),
  124. new web3._extend.Method({
  125. name: 'httpGet',
  126. call: 'admin_httpGet',
  127. params: 2,
  128. inputFormatter: [null, null]
  129. })
  130. ],
  131. properties:
  132. [
  133. new web3._extend.Property({
  134. name: 'nodeInfo',
  135. getter: 'admin_nodeInfo'
  136. }),
  137. new web3._extend.Property({
  138. name: 'peers',
  139. getter: 'admin_peers'
  140. }),
  141. new web3._extend.Property({
  142. name: 'datadir',
  143. getter: 'admin_datadir'
  144. }),
  145. new web3._extend.Property({
  146. name: 'chainSyncStatus',
  147. getter: 'admin_chainSyncStatus'
  148. })
  149. ]
  150. });
  151. `