You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

440 lines
16 KiB

limit number of /subscribe clients and queries per client (#3269) * limit number of /subscribe clients and queries per client Add the following config variables (under [rpc] section): * max_subscription_clients * max_subscriptions_per_client * timeout_broadcast_tx_commit Fixes #2826 new HTTPClient interface for subscriptions finalize HTTPClient events interface remove EventSubscriber fix data race ``` WARNING: DATA RACE Read at 0x00c000a36060 by goroutine 129: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe.func1() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:168 +0x1f0 Previous write at 0x00c000a36060 by goroutine 132: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:191 +0x4e0 github.com/tendermint/tendermint/rpc/client.WaitForOneEvent() /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 Goroutine 129 (running) created at: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:164 +0x4b7 github.com/tendermint/tendermint/rpc/client.WaitForOneEvent() /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 Goroutine 132 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:878 +0x659 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:119 +0x186 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 ================== ``` lite client works (tested manually) godoc comments httpclient: do not close the out channel use TimeoutBroadcastTxCommit no timeout for unsubscribe but 1s Local (5s HTTP) timeout for resubscribe format code change Subscribe#out cap to 1 and replace config vars with RPCConfig TimeoutBroadcastTxCommit can't be greater than rpcserver.WriteTimeout rpc: Context as first parameter to all functions reformat code fixes after my own review fixes after Ethan's review add test stubs fix config.toml * fixes after manual testing - rpc: do not recommend to use BroadcastTxCommit because it's slow and wastes Tendermint resources (pubsub) - rpc: better error in Subscribe and BroadcastTxCommit - HTTPClient: do not resubscribe if err = ErrAlreadySubscribed * fixes after Ismail's review * Update rpc/grpc/grpc_test.go Co-Authored-By: melekes <anton.kalyaev@gmail.com>
6 years ago
limit number of /subscribe clients and queries per client (#3269) * limit number of /subscribe clients and queries per client Add the following config variables (under [rpc] section): * max_subscription_clients * max_subscriptions_per_client * timeout_broadcast_tx_commit Fixes #2826 new HTTPClient interface for subscriptions finalize HTTPClient events interface remove EventSubscriber fix data race ``` WARNING: DATA RACE Read at 0x00c000a36060 by goroutine 129: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe.func1() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:168 +0x1f0 Previous write at 0x00c000a36060 by goroutine 132: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:191 +0x4e0 github.com/tendermint/tendermint/rpc/client.WaitForOneEvent() /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 Goroutine 129 (running) created at: github.com/tendermint/tendermint/rpc/client.(*Local).Subscribe() /go/src/github.com/tendermint/tendermint/rpc/client/localclient.go:164 +0x4b7 github.com/tendermint/tendermint/rpc/client.WaitForOneEvent() /go/src/github.com/tendermint/tendermint/rpc/client/helpers.go:64 +0x178 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync.func1() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:139 +0x298 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 Goroutine 132 (running) created at: testing.(*T).Run() /usr/local/go/src/testing/testing.go:878 +0x659 github.com/tendermint/tendermint/rpc/client_test.TestTxEventsSentWithBroadcastTxSync() /go/src/github.com/tendermint/tendermint/rpc/client/event_test.go:119 +0x186 testing.tRunner() /usr/local/go/src/testing/testing.go:827 +0x162 ================== ``` lite client works (tested manually) godoc comments httpclient: do not close the out channel use TimeoutBroadcastTxCommit no timeout for unsubscribe but 1s Local (5s HTTP) timeout for resubscribe format code change Subscribe#out cap to 1 and replace config vars with RPCConfig TimeoutBroadcastTxCommit can't be greater than rpcserver.WriteTimeout rpc: Context as first parameter to all functions reformat code fixes after my own review fixes after Ethan's review add test stubs fix config.toml * fixes after manual testing - rpc: do not recommend to use BroadcastTxCommit because it's slow and wastes Tendermint resources (pubsub) - rpc: better error in Subscribe and BroadcastTxCommit - HTTPClient: do not resubscribe if err = ErrAlreadySubscribed * fixes after Ismail's review * Update rpc/grpc/grpc_test.go Co-Authored-By: melekes <anton.kalyaev@gmail.com>
6 years ago
  1. package config
  2. import (
  3. "bytes"
  4. "fmt"
  5. "io/ioutil"
  6. "path/filepath"
  7. "text/template"
  8. cmn "github.com/tendermint/tendermint/libs/common"
  9. )
  10. // DefaultDirPerm is the default permissions used when creating directories.
  11. const DefaultDirPerm = 0700
  12. var configTemplate *template.Template
  13. func init() {
  14. var err error
  15. if configTemplate, err = template.New("configFileTemplate").Parse(defaultConfigTemplate); err != nil {
  16. panic(err)
  17. }
  18. }
  19. /****** these are for production settings ***********/
  20. // EnsureRoot creates the root, config, and data directories if they don't exist,
  21. // and panics if it fails.
  22. func EnsureRoot(rootDir string) {
  23. if err := cmn.EnsureDir(rootDir, DefaultDirPerm); err != nil {
  24. panic(err.Error())
  25. }
  26. if err := cmn.EnsureDir(filepath.Join(rootDir, defaultConfigDir), DefaultDirPerm); err != nil {
  27. panic(err.Error())
  28. }
  29. if err := cmn.EnsureDir(filepath.Join(rootDir, defaultDataDir), DefaultDirPerm); err != nil {
  30. panic(err.Error())
  31. }
  32. configFilePath := filepath.Join(rootDir, defaultConfigFilePath)
  33. // Write default config file if missing.
  34. if !cmn.FileExists(configFilePath) {
  35. writeDefaultConfigFile(configFilePath)
  36. }
  37. }
  38. // XXX: this func should probably be called by cmd/tendermint/commands/init.go
  39. // alongside the writing of the genesis.json and priv_validator.json
  40. func writeDefaultConfigFile(configFilePath string) {
  41. WriteConfigFile(configFilePath, DefaultConfig())
  42. }
  43. // WriteConfigFile renders config using the template and writes it to configFilePath.
  44. func WriteConfigFile(configFilePath string, config *Config) {
  45. var buffer bytes.Buffer
  46. if err := configTemplate.Execute(&buffer, config); err != nil {
  47. panic(err)
  48. }
  49. cmn.MustWriteFile(configFilePath, buffer.Bytes(), 0644)
  50. }
  51. // Note: any changes to the comments/variables/mapstructure
  52. // must be reflected in the appropriate struct in config/config.go
  53. const defaultConfigTemplate = `# This is a TOML config file.
  54. # For more information, see https://github.com/toml-lang/toml
  55. ##### main base config options #####
  56. # TCP or UNIX socket address of the ABCI application,
  57. # or the name of an ABCI application compiled in with the Tendermint binary
  58. proxy_app = "{{ .BaseConfig.ProxyApp }}"
  59. # A custom human readable name for this node
  60. moniker = "{{ .BaseConfig.Moniker }}"
  61. # If this node is many blocks behind the tip of the chain, FastSync
  62. # allows them to catchup quickly by downloading blocks in parallel
  63. # and verifying their commits
  64. fast_sync = {{ .BaseConfig.FastSync }}
  65. # Database backend: goleveldb | cleveldb | boltdb
  66. # * goleveldb (github.com/syndtr/goleveldb - most popular implementation)
  67. # - pure go
  68. # - stable
  69. # * cleveldb (uses levigo wrapper)
  70. # - fast
  71. # - requires gcc
  72. # - use cleveldb build tag (go build -tags cleveldb)
  73. # * boltdb (uses etcd's fork of bolt - github.com/etcd-io/bbolt)
  74. # - EXPERIMENTAL
  75. # - may be faster is some use-cases (random reads - indexer)
  76. # - use boltdb build tag (go build -tags boltdb)
  77. db_backend = "{{ .BaseConfig.DBBackend }}"
  78. # Database directory
  79. db_dir = "{{ js .BaseConfig.DBPath }}"
  80. # Output level for logging, including package level options
  81. log_level = "{{ .BaseConfig.LogLevel }}"
  82. # Output format: 'plain' (colored text) or 'json'
  83. log_format = "{{ .BaseConfig.LogFormat }}"
  84. ##### additional base config options #####
  85. # Path to the JSON file containing the initial validator set and other meta data
  86. genesis_file = "{{ js .BaseConfig.Genesis }}"
  87. # Path to the JSON file containing the private key to use as a validator in the consensus protocol
  88. priv_validator_key_file = "{{ js .BaseConfig.PrivValidatorKey }}"
  89. # Path to the JSON file containing the last sign state of a validator
  90. priv_validator_state_file = "{{ js .BaseConfig.PrivValidatorState }}"
  91. # TCP or UNIX socket address for Tendermint to listen on for
  92. # connections from an external PrivValidator process
  93. priv_validator_laddr = "{{ .BaseConfig.PrivValidatorListenAddr }}"
  94. # Path to the JSON file containing the private key to use for node authentication in the p2p protocol
  95. node_key_file = "{{ js .BaseConfig.NodeKey }}"
  96. # Mechanism to connect to the ABCI application: socket | grpc
  97. abci = "{{ .BaseConfig.ABCI }}"
  98. # TCP or UNIX socket address for the profiling server to listen on
  99. prof_laddr = "{{ .BaseConfig.ProfListenAddress }}"
  100. # If true, query the ABCI app on connecting to a new peer
  101. # so the app can decide if we should keep the connection or not
  102. filter_peers = {{ .BaseConfig.FilterPeers }}
  103. ##### advanced configuration options #####
  104. ##### rpc server configuration options #####
  105. [rpc]
  106. # TCP or UNIX socket address for the RPC server to listen on
  107. laddr = "{{ .RPC.ListenAddress }}"
  108. # A list of origins a cross-domain request can be executed from
  109. # Default value '[]' disables cors support
  110. # Use '["*"]' to allow any origin
  111. cors_allowed_origins = [{{ range .RPC.CORSAllowedOrigins }}{{ printf "%q, " . }}{{end}}]
  112. # A list of methods the client is allowed to use with cross-domain requests
  113. cors_allowed_methods = [{{ range .RPC.CORSAllowedMethods }}{{ printf "%q, " . }}{{end}}]
  114. # A list of non simple headers the client is allowed to use with cross-domain requests
  115. cors_allowed_headers = [{{ range .RPC.CORSAllowedHeaders }}{{ printf "%q, " . }}{{end}}]
  116. # TCP or UNIX socket address for the gRPC server to listen on
  117. # NOTE: This server only supports /broadcast_tx_commit
  118. grpc_laddr = "{{ .RPC.GRPCListenAddress }}"
  119. # Maximum number of simultaneous connections.
  120. # Does not include RPC (HTTP&WebSocket) connections. See max_open_connections
  121. # If you want to accept a larger number than the default, make sure
  122. # you increase your OS limits.
  123. # 0 - unlimited.
  124. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
  125. # 1024 - 40 - 10 - 50 = 924 = ~900
  126. grpc_max_open_connections = {{ .RPC.GRPCMaxOpenConnections }}
  127. # Activate unsafe RPC commands like /dial_seeds and /unsafe_flush_mempool
  128. unsafe = {{ .RPC.Unsafe }}
  129. # Maximum number of simultaneous connections (including WebSocket).
  130. # Does not include gRPC connections. See grpc_max_open_connections
  131. # If you want to accept a larger number than the default, make sure
  132. # you increase your OS limits.
  133. # 0 - unlimited.
  134. # Should be < {ulimit -Sn} - {MaxNumInboundPeers} - {MaxNumOutboundPeers} - {N of wal, db and other open files}
  135. # 1024 - 40 - 10 - 50 = 924 = ~900
  136. max_open_connections = {{ .RPC.MaxOpenConnections }}
  137. # Maximum number of unique clientIDs that can /subscribe
  138. # If you're using /broadcast_tx_commit, set to the estimated maximum number
  139. # of broadcast_tx_commit calls per block.
  140. max_subscription_clients = {{ .RPC.MaxSubscriptionClients }}
  141. # Maximum number of unique queries a given client can /subscribe to
  142. # If you're using GRPC (or Local RPC client) and /broadcast_tx_commit, set to
  143. # the estimated # maximum number of broadcast_tx_commit calls per block.
  144. max_subscriptions_per_client = {{ .RPC.MaxSubscriptionsPerClient }}
  145. # How long to wait for a tx to be committed during /broadcast_tx_commit.
  146. # WARNING: Using a value larger than 10s will result in increasing the
  147. # global HTTP write timeout, which applies to all connections and endpoints.
  148. # See https://github.com/tendermint/tendermint/issues/3435
  149. timeout_broadcast_tx_commit = "{{ .RPC.TimeoutBroadcastTxCommit }}"
  150. # The path to a file containing certificate that is used to create the HTTPS server.
  151. # Migth be either absolute path or path related to tendermint's config directory.
  152. # If the certificate is signed by a certificate authority,
  153. # the certFile should be the concatenation of the server's certificate, any intermediates,
  154. # and the CA's certificate.
  155. # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. Otherwise, HTTP server is run.
  156. tls_cert_file = "{{ .RPC.TLSCertFile }}"
  157. # The path to a file containing matching private key that is used to create the HTTPS server.
  158. # Migth be either absolute path or path related to tendermint's config directory.
  159. # NOTE: both tls_cert_file and tls_key_file must be present for Tendermint to create HTTPS server. Otherwise, HTTP server is run.
  160. tls_key_file = "{{ .RPC.TLSKeyFile }}"
  161. ##### peer to peer configuration options #####
  162. [p2p]
  163. # Address to listen for incoming connections
  164. laddr = "{{ .P2P.ListenAddress }}"
  165. # Address to advertise to peers for them to dial
  166. # If empty, will use the same port as the laddr,
  167. # and will introspect on the listener or use UPnP
  168. # to figure out the address.
  169. external_address = "{{ .P2P.ExternalAddress }}"
  170. # Comma separated list of seed nodes to connect to
  171. seeds = "{{ .P2P.Seeds }}"
  172. # Comma separated list of nodes to keep persistent connections to
  173. persistent_peers = "{{ .P2P.PersistentPeers }}"
  174. # UPNP port forwarding
  175. upnp = {{ .P2P.UPNP }}
  176. # Path to address book
  177. addr_book_file = "{{ js .P2P.AddrBook }}"
  178. # Set true for strict address routability rules
  179. # Set false for private or local networks
  180. addr_book_strict = {{ .P2P.AddrBookStrict }}
  181. # Maximum number of inbound peers
  182. max_num_inbound_peers = {{ .P2P.MaxNumInboundPeers }}
  183. # Maximum number of outbound peers to connect to, excluding persistent peers
  184. max_num_outbound_peers = {{ .P2P.MaxNumOutboundPeers }}
  185. # Time to wait before flushing messages out on the connection
  186. flush_throttle_timeout = "{{ .P2P.FlushThrottleTimeout }}"
  187. # Maximum size of a message packet payload, in bytes
  188. max_packet_msg_payload_size = {{ .P2P.MaxPacketMsgPayloadSize }}
  189. # Rate at which packets can be sent, in bytes/second
  190. send_rate = {{ .P2P.SendRate }}
  191. # Rate at which packets can be received, in bytes/second
  192. recv_rate = {{ .P2P.RecvRate }}
  193. # Set true to enable the peer-exchange reactor
  194. pex = {{ .P2P.PexReactor }}
  195. # Seed mode, in which node constantly crawls the network and looks for
  196. # peers. If another node asks it for addresses, it responds and disconnects.
  197. #
  198. # Does not work if the peer-exchange reactor is disabled.
  199. seed_mode = {{ .P2P.SeedMode }}
  200. # Comma separated list of peer IDs to keep private (will not be gossiped to other peers)
  201. private_peer_ids = "{{ .P2P.PrivatePeerIDs }}"
  202. # Toggle to disable guard against peers connecting from the same ip.
  203. allow_duplicate_ip = {{ .P2P.AllowDuplicateIP }}
  204. # Peer connection configuration.
  205. handshake_timeout = "{{ .P2P.HandshakeTimeout }}"
  206. dial_timeout = "{{ .P2P.DialTimeout }}"
  207. ##### mempool configuration options #####
  208. [mempool]
  209. recheck = {{ .Mempool.Recheck }}
  210. broadcast = {{ .Mempool.Broadcast }}
  211. wal_dir = "{{ js .Mempool.WalPath }}"
  212. # Maximum number of transactions in the mempool
  213. size = {{ .Mempool.Size }}
  214. # Limit the total size of all txs in the mempool.
  215. # This only accounts for raw transactions (e.g. given 1MB transactions and
  216. # max_txs_bytes=5MB, mempool will only accept 5 transactions).
  217. max_txs_bytes = {{ .Mempool.MaxTxsBytes }}
  218. # Size of the cache (used to filter transactions we saw earlier) in transactions
  219. cache_size = {{ .Mempool.CacheSize }}
  220. ##### consensus configuration options #####
  221. [consensus]
  222. wal_file = "{{ js .Consensus.WalPath }}"
  223. timeout_propose = "{{ .Consensus.TimeoutPropose }}"
  224. timeout_propose_delta = "{{ .Consensus.TimeoutProposeDelta }}"
  225. timeout_prevote = "{{ .Consensus.TimeoutPrevote }}"
  226. timeout_prevote_delta = "{{ .Consensus.TimeoutPrevoteDelta }}"
  227. timeout_precommit = "{{ .Consensus.TimeoutPrecommit }}"
  228. timeout_precommit_delta = "{{ .Consensus.TimeoutPrecommitDelta }}"
  229. timeout_commit = "{{ .Consensus.TimeoutCommit }}"
  230. # Make progress as soon as we have all the precommits (as if TimeoutCommit = 0)
  231. skip_timeout_commit = {{ .Consensus.SkipTimeoutCommit }}
  232. # EmptyBlocks mode and possible interval between empty blocks
  233. create_empty_blocks = {{ .Consensus.CreateEmptyBlocks }}
  234. create_empty_blocks_interval = "{{ .Consensus.CreateEmptyBlocksInterval }}"
  235. # Reactor sleep duration parameters
  236. peer_gossip_sleep_duration = "{{ .Consensus.PeerGossipSleepDuration }}"
  237. peer_query_maj23_sleep_duration = "{{ .Consensus.PeerQueryMaj23SleepDuration }}"
  238. ##### transactions indexer configuration options #####
  239. [tx_index]
  240. # What indexer to use for transactions
  241. #
  242. # Options:
  243. # 1) "null"
  244. # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend).
  245. indexer = "{{ .TxIndex.Indexer }}"
  246. # Comma-separated list of tags to index (by default the only tag is "tx.hash")
  247. #
  248. # You can also index transactions by height by adding "tx.height" tag here.
  249. #
  250. # It's recommended to index only a subset of tags due to possible memory
  251. # bloat. This is, of course, depends on the indexer's DB and the volume of
  252. # transactions.
  253. index_tags = "{{ .TxIndex.IndexTags }}"
  254. # When set to true, tells indexer to index all tags (predefined tags:
  255. # "tx.hash", "tx.height" and all tags from DeliverTx responses).
  256. #
  257. # Note this may be not desirable (see the comment above). IndexTags has a
  258. # precedence over IndexAllTags (i.e. when given both, IndexTags will be
  259. # indexed).
  260. index_all_tags = {{ .TxIndex.IndexAllTags }}
  261. ##### instrumentation configuration options #####
  262. [instrumentation]
  263. # When true, Prometheus metrics are served under /metrics on
  264. # PrometheusListenAddr.
  265. # Check out the documentation for the list of available metrics.
  266. prometheus = {{ .Instrumentation.Prometheus }}
  267. # Address to listen for Prometheus collector(s) connections
  268. prometheus_listen_addr = "{{ .Instrumentation.PrometheusListenAddr }}"
  269. # Maximum number of simultaneous connections.
  270. # If you want to accept a larger number than the default, make sure
  271. # you increase your OS limits.
  272. # 0 - unlimited.
  273. max_open_connections = {{ .Instrumentation.MaxOpenConnections }}
  274. # Instrumentation namespace
  275. namespace = "{{ .Instrumentation.Namespace }}"
  276. `
  277. /****** these are for test settings ***********/
  278. func ResetTestRoot(testName string) *Config {
  279. return ResetTestRootWithChainID(testName, "")
  280. }
  281. func ResetTestRootWithChainID(testName string, chainID string) *Config {
  282. // create a unique, concurrency-safe test directory under os.TempDir()
  283. rootDir, err := ioutil.TempDir("", fmt.Sprintf("%s-%s_", chainID, testName))
  284. if err != nil {
  285. panic(err)
  286. }
  287. // ensure config and data subdirs are created
  288. if err := cmn.EnsureDir(filepath.Join(rootDir, defaultConfigDir), DefaultDirPerm); err != nil {
  289. panic(err)
  290. }
  291. if err := cmn.EnsureDir(filepath.Join(rootDir, defaultDataDir), DefaultDirPerm); err != nil {
  292. panic(err)
  293. }
  294. baseConfig := DefaultBaseConfig()
  295. configFilePath := filepath.Join(rootDir, defaultConfigFilePath)
  296. genesisFilePath := filepath.Join(rootDir, baseConfig.Genesis)
  297. privKeyFilePath := filepath.Join(rootDir, baseConfig.PrivValidatorKey)
  298. privStateFilePath := filepath.Join(rootDir, baseConfig.PrivValidatorState)
  299. // Write default config file if missing.
  300. if !cmn.FileExists(configFilePath) {
  301. writeDefaultConfigFile(configFilePath)
  302. }
  303. if !cmn.FileExists(genesisFilePath) {
  304. if chainID == "" {
  305. chainID = "tendermint_test"
  306. }
  307. testGenesis := fmt.Sprintf(testGenesisFmt, chainID)
  308. cmn.MustWriteFile(genesisFilePath, []byte(testGenesis), 0644)
  309. }
  310. // we always overwrite the priv val
  311. cmn.MustWriteFile(privKeyFilePath, []byte(testPrivValidatorKey), 0644)
  312. cmn.MustWriteFile(privStateFilePath, []byte(testPrivValidatorState), 0644)
  313. config := TestConfig().SetRoot(rootDir)
  314. return config
  315. }
  316. var testGenesisFmt = `{
  317. "genesis_time": "2018-10-10T08:20:13.695936996Z",
  318. "chain_id": "%s",
  319. "validators": [
  320. {
  321. "pub_key": {
  322. "type": "tendermint/PubKeyEd25519",
  323. "value":"AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="
  324. },
  325. "power": "10",
  326. "name": ""
  327. }
  328. ],
  329. "app_hash": ""
  330. }`
  331. var testPrivValidatorKey = `{
  332. "address": "A3258DCBF45DCA0DF052981870F2D1441A36D145",
  333. "pub_key": {
  334. "type": "tendermint/PubKeyEd25519",
  335. "value": "AT/+aaL1eB0477Mud9JMm8Sh8BIvOYlPGC9KkIUmFaE="
  336. },
  337. "priv_key": {
  338. "type": "tendermint/PrivKeyEd25519",
  339. "value": "EVkqJO/jIXp3rkASXfh9YnyToYXRXhBr6g9cQVxPFnQBP/5povV4HTjvsy530kybxKHwEi85iU8YL0qQhSYVoQ=="
  340. }
  341. }`
  342. var testPrivValidatorState = `{
  343. "height": "0",
  344. "round": "0",
  345. "step": 0
  346. }`