admin_js.go 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. package api
  2. const Admin_JS = `
  3. web3._extend({
  4. property: 'admin',
  5. methods:
  6. [
  7. new web3._extend.Method({
  8. name: 'addPeer',
  9. call: 'admin_addPeer',
  10. params: 1,
  11. inputFormatter: [web3._extend.utils.formatInputString],
  12. outputFormatter: web3._extend.formatters.formatOutputBool
  13. }),
  14. new web3._extend.Method({
  15. name: 'exportChain',
  16. call: 'admin_exportChain',
  17. params: 1,
  18. inputFormatter: [web3._extend.utils.formatInputString],
  19. outputFormatter: function(obj) { return obj; }
  20. }),
  21. new web3._extend.Method({
  22. name: 'importChain',
  23. call: 'admin_importChain',
  24. params: 1,
  25. inputFormatter: [web3._extend.utils.formatInputString],
  26. outputFormatter: function(obj) { return obj; }
  27. }),
  28. new web3._extend.Method({
  29. name: 'verbosity',
  30. call: 'admin_verbosity',
  31. params: 1,
  32. inputFormatter: [web3._extend.utils.formatInputInt],
  33. outputFormatter: web3._extend.formatters.formatOutputBool
  34. }),
  35. new web3._extend.Method({
  36. name: 'setSolc',
  37. call: 'admin_setSolc',
  38. params: 1,
  39. inputFormatter: [web3._extend.utils.formatInputString],
  40. outputFormatter: web3._extend.formatters.formatOutputString
  41. }),
  42. new web3._extend.Method({
  43. name: 'startRPC',
  44. call: 'admin_startRPC',
  45. params: 4,
  46. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputInteger,web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  47. outputFormatter: web3._extend.formatters.formatOutputBool
  48. }),
  49. new web3._extend.Method({
  50. name: 'stopRPC',
  51. call: 'admin_stopRPC',
  52. params: 0,
  53. inputFormatter: [],
  54. outputFormatter: web3._extend.formatters.formatOutputBool
  55. }),
  56. new web3._extend.Method({
  57. name: 'setGlobalRegistrar',
  58. call: 'admin_setGlobalRegistrar',
  59. params: 2,
  60. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  61. outputFormatter: web3._extend.formatters.formatOutputString
  62. }),
  63. new web3._extend.Method({
  64. name: 'setHashReg',
  65. call: 'admin_setHashReg',
  66. params: 2,
  67. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  68. outputFormatter: web3._extend.formatters.formatOutputString
  69. }),
  70. new web3._extend.Method({
  71. name: 'saveInfo',
  72. call: 'admin_saveInfo',
  73. params: 2,
  74. inputFormatter: [function(obj) { return obj; },web3._extend.utils.formatInputString],
  75. outputFormatter: web3._extend.formatters.formatOutputString
  76. }),
  77. new web3._extend.Method({
  78. name: 'register',
  79. call: 'admin_register',
  80. params: 2,
  81. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  82. outputFormatter: web3._extend.formatters.formatOutputBool
  83. }),
  84. new web3._extend.Method({
  85. name: 'registerUrl',
  86. call: 'admin_registerUrl',
  87. params: 3,
  88. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  89. outputFormatter: web3._extend.formatters.formatOutputBool
  90. }),
  91. new web3._extend.Method({
  92. name: 'StartNatSpec',
  93. call: 'admin_startNatSpec',
  94. params: 0,
  95. inputFormatter: [],
  96. outputFormatter: web3._extend.formatters.formatOutputBool
  97. }),
  98. new web3._extend.Method({
  99. name: 'StopNatSpec',
  100. call: 'admin_stopNatSpec',
  101. params: 0,
  102. inputFormatter: [],
  103. outputFormatter: web3._extend.formatters.formatOutputBool
  104. }),
  105. new web3._extend.Method({
  106. name: 'getContractInfo',
  107. call: 'admin_getContractInfo',
  108. params: 1,
  109. inputFormatter: [web3._extend.utils.formatInputString],
  110. outputFormatter: function(obj) { return json.parse(obj); }
  111. }),
  112. new web3._extend.Method({
  113. name: 'httpGet',
  114. call: 'admin_httpGet',
  115. params: 2,
  116. inputFormatter: [web3._extend.utils.formatInputString,web3._extend.utils.formatInputString],
  117. outputFormatter: web3._extend.formatters.formatOutputString
  118. })
  119. ],
  120. properties:
  121. [
  122. new web3._extend.Property({
  123. name: 'nodeInfo',
  124. getter: 'admin_nodeInfo',
  125. outputFormatter: web3._extend.formatters.formatOutputString
  126. }),
  127. new web3._extend.Property({
  128. name: 'peers',
  129. getter: 'admin_peers',
  130. outputFormatter: function(obj) { return obj; }
  131. }),
  132. new web3._extend.Property({
  133. name: 'datadir',
  134. getter: 'admin_datadir',
  135. outputFormatter: web3._extend.formatters.formatOutputString
  136. }),
  137. new web3._extend.Property({
  138. name: 'chainSyncStatus',
  139. getter: 'admin_chainSyncStatus',
  140. outputFormatter: function(obj) { return obj; }
  141. })
  142. ]
  143. });
  144. `