mirror of
https://github.com/tendermint/tendermint.git
synced 2026-10-01 04:05:45 +00:00
docs: Update all docs to prepare for v0.37 (#9243)
* Update docs references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update DOCS_README to reflect current reality Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update vuepress config with current versions and updated discussions link Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update generated docs versions Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update docs build to use temp folder instead of home Signed-off-by: Thane Thomson <connect@thanethomson.com> * Document build-docs Makefile target Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add serve-docs Makefile target to serve local build of docs Signed-off-by: Thane Thomson <connect@thanethomson.com> * Ensure 404 page is copied during docs build Signed-off-by: Thane Thomson <connect@thanethomson.com> * Redirect /master/ to /main/ Signed-off-by: Thane Thomson <connect@thanethomson.com> * Attempt to resolve #7908 Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update OpenAPI references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update CHANGELOG references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update Docker readme references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update UPGRADING references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update package-specific documentation references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update spec references from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update all code comment references to docs site from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Build v0.34.x as "latest" Signed-off-by: Thane Thomson <connect@thanethomson.com> * Explicitly mark v0.34 docs as latest in version selector Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update all links from docs.tendermint.com/main to docs.tendermint.com/latest Signed-off-by: Thane Thomson <connect@thanethomson.com> * ci: Redeploy docs on pushes to v0.34.x Signed-off-by: Thane Thomson <connect@thanethomson.com> * Temporarily copy spec directory into docs while building Signed-off-by: Thane Thomson <connect@thanethomson.com> * Add nav link to main and clearly mark as unstable Signed-off-by: Thane Thomson <connect@thanethomson.com> * Revert to only publishing docs in nav for v0.34 and v0.33 with no latest Signed-off-by: Thane Thomson <connect@thanethomson.com> * Link to docs.tendermint.com/v0.34 from RFCs Signed-off-by: Thane Thomson <connect@thanethomson.com> * Rather just use main for all docs.tendermint.com references on main branch Signed-off-by: Thane Thomson <connect@thanethomson.com> * Rename GitHub tree links from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update link for ABCI Rust client Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update github links from master to main Signed-off-by: Thane Thomson <connect@thanethomson.com> * Update badges in root readme Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove codecov badge since we do not use it any more Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove Java and Kotlin tutorials Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove specs from docs build Signed-off-by: Thane Thomson <connect@thanethomson.com> * Migrate spec links to GitHub repo from docs site Signed-off-by: Thane Thomson <connect@thanethomson.com> * Remove references to non-existent PEX reactor spec Signed-off-by: Thane Thomson <connect@thanethomson.com> * Fix linting badge in README Signed-off-by: Thane Thomson <connect@thanethomson.com> Signed-off-by: Thane Thomson <connect@thanethomson.com>
This commit is contained in:
+2
-2
@@ -9,7 +9,7 @@ import (
|
||||
)
|
||||
|
||||
// ABCIQuery queries the application for some information.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/ABCI/abci_query
|
||||
// More: https://docs.tendermint.com/main/rpc/#/ABCI/abci_query
|
||||
func ABCIQuery(
|
||||
ctx *rpctypes.Context,
|
||||
path string,
|
||||
@@ -31,7 +31,7 @@ func ABCIQuery(
|
||||
}
|
||||
|
||||
// ABCIInfo gets some info about the application.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/ABCI/abci_info
|
||||
// More: https://docs.tendermint.com/main/rpc/#/ABCI/abci_info
|
||||
func ABCIInfo(ctx *rpctypes.Context) (*ctypes.ResultABCIInfo, error) {
|
||||
resInfo, err := env.ProxyAppQuery.InfoSync(proxy.RequestInfo)
|
||||
if err != nil {
|
||||
|
||||
+5
-5
@@ -15,7 +15,7 @@ import (
|
||||
|
||||
// BlockchainInfo gets block headers for minHeight <= height <= maxHeight.
|
||||
// Block headers are returned in descending order (highest first).
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/blockchain
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/blockchain
|
||||
func BlockchainInfo(ctx *rpctypes.Context, minHeight, maxHeight int64) (*ctypes.ResultBlockchainInfo, error) {
|
||||
// maximum 20 block metas
|
||||
const limit int64 = 20
|
||||
@@ -77,7 +77,7 @@ func filterMinMax(base, height, min, max, limit int64) (int64, int64, error) {
|
||||
|
||||
// Block gets block at a given height.
|
||||
// If no height is provided, it will fetch the latest block.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/block
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/block
|
||||
func Block(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlock, error) {
|
||||
height, err := getHeight(env.BlockStore.Height(), heightPtr)
|
||||
if err != nil {
|
||||
@@ -93,7 +93,7 @@ func Block(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlock, error)
|
||||
}
|
||||
|
||||
// BlockByHash gets block by hash.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/block_by_hash
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/block_by_hash
|
||||
func BlockByHash(ctx *rpctypes.Context, hash []byte) (*ctypes.ResultBlock, error) {
|
||||
block := env.BlockStore.LoadBlockByHash(hash)
|
||||
if block == nil {
|
||||
@@ -106,7 +106,7 @@ func BlockByHash(ctx *rpctypes.Context, hash []byte) (*ctypes.ResultBlock, error
|
||||
|
||||
// Commit gets block commit at a given height.
|
||||
// If no height is provided, it will fetch the commit for the latest block.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/commit
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/commit
|
||||
func Commit(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultCommit, error) {
|
||||
height, err := getHeight(env.BlockStore.Height(), heightPtr)
|
||||
if err != nil {
|
||||
@@ -137,7 +137,7 @@ func Commit(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultCommit, erro
|
||||
// Results are for the height of the block containing the txs.
|
||||
// Thus response.results.deliver_tx[5] is the results of executing
|
||||
// getBlock(h).Txs[5]
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/block_results
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/block_results
|
||||
func BlockResults(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultBlockResults, error) {
|
||||
height, err := getHeight(env.BlockStore.Height(), heightPtr)
|
||||
if err != nil {
|
||||
|
||||
@@ -14,7 +14,7 @@ import (
|
||||
// validators are sorted by their voting power - this is the canonical order
|
||||
// for the validators in the set as used in computing their Merkle root.
|
||||
//
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/validators
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/validators
|
||||
func Validators(ctx *rpctypes.Context, heightPtr *int64, pagePtr, perPagePtr *int) (*ctypes.ResultValidators, error) {
|
||||
// The latest validator that we know is the NextValidator of the last block.
|
||||
height, err := getHeight(latestUncommittedHeight(), heightPtr)
|
||||
@@ -47,7 +47,7 @@ func Validators(ctx *rpctypes.Context, heightPtr *int64, pagePtr, perPagePtr *in
|
||||
|
||||
// DumpConsensusState dumps consensus state.
|
||||
// UNSTABLE
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/dump_consensus_state
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/dump_consensus_state
|
||||
func DumpConsensusState(ctx *rpctypes.Context) (*ctypes.ResultDumpConsensusState, error) {
|
||||
// Get Peer consensus states.
|
||||
peers := env.P2PPeers.Peers().List()
|
||||
@@ -80,7 +80,7 @@ func DumpConsensusState(ctx *rpctypes.Context) (*ctypes.ResultDumpConsensusState
|
||||
|
||||
// ConsensusState returns a concise summary of the consensus state.
|
||||
// UNSTABLE
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/consensus_state
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/consensus_state
|
||||
func ConsensusState(ctx *rpctypes.Context) (*ctypes.ResultConsensusState, error) {
|
||||
// Get self round state.
|
||||
bz, err := env.ConsensusState.GetRoundStateSimpleJSON()
|
||||
@@ -89,7 +89,7 @@ func ConsensusState(ctx *rpctypes.Context) (*ctypes.ResultConsensusState, error)
|
||||
|
||||
// ConsensusParams gets the consensus parameters at the given block height.
|
||||
// If no height is provided, it will fetch the latest consensus params.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/consensus_params
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/consensus_params
|
||||
func ConsensusParams(ctx *rpctypes.Context, heightPtr *int64) (*ctypes.ResultConsensusParams, error) {
|
||||
// The latest consensus params that we know is the consensus params after the
|
||||
// last block.
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
Package core defines the Tendermint RPC endpoints.
|
||||
|
||||
Tendermint ships with its own JSONRPC library -
|
||||
https://github.com/tendermint/tendermint/tree/master/rpc/jsonrpc.
|
||||
https://github.com/tendermint/tendermint/tree/main/rpc/jsonrpc.
|
||||
|
||||
## Get the list
|
||||
|
||||
|
||||
+3
-3
@@ -19,7 +19,7 @@ const (
|
||||
)
|
||||
|
||||
// Subscribe for events via WebSocket.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Websocket/subscribe
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Websocket/subscribe
|
||||
func Subscribe(ctx *rpctypes.Context, query string) (*ctypes.ResultSubscribe, error) {
|
||||
addr := ctx.RemoteAddr()
|
||||
|
||||
@@ -102,7 +102,7 @@ func Subscribe(ctx *rpctypes.Context, query string) (*ctypes.ResultSubscribe, er
|
||||
}
|
||||
|
||||
// Unsubscribe from events via WebSocket.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Websocket/unsubscribe
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Websocket/unsubscribe
|
||||
func Unsubscribe(ctx *rpctypes.Context, query string) (*ctypes.ResultUnsubscribe, error) {
|
||||
addr := ctx.RemoteAddr()
|
||||
env.Logger.Info("Unsubscribe from query", "remote", addr, "query", query)
|
||||
@@ -118,7 +118,7 @@ func Unsubscribe(ctx *rpctypes.Context, query string) (*ctypes.ResultUnsubscribe
|
||||
}
|
||||
|
||||
// UnsubscribeAll from all events via WebSocket.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Websocket/unsubscribe_all
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Websocket/unsubscribe_all
|
||||
func UnsubscribeAll(ctx *rpctypes.Context) (*ctypes.ResultUnsubscribe, error) {
|
||||
addr := ctx.RemoteAddr()
|
||||
env.Logger.Info("Unsubscribe from all", "remote", addr)
|
||||
|
||||
@@ -10,7 +10,7 @@ import (
|
||||
)
|
||||
|
||||
// BroadcastEvidence broadcasts evidence of the misbehavior.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/broadcast_evidence
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/broadcast_evidence
|
||||
func BroadcastEvidence(ctx *rpctypes.Context, ev types.Evidence) (*ctypes.ResultBroadcastEvidence, error) {
|
||||
if ev == nil {
|
||||
return nil, errors.New("no evidence was provided")
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ import (
|
||||
|
||||
// Health gets node health. Returns empty result (200 OK) on success, no
|
||||
// response - in case of an error.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/health
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/health
|
||||
func Health(ctx *rpctypes.Context) (*ctypes.ResultHealth, error) {
|
||||
return &ctypes.ResultHealth{}, nil
|
||||
}
|
||||
|
||||
+6
-6
@@ -18,7 +18,7 @@ import (
|
||||
|
||||
// BroadcastTxAsync returns right away, with no response. Does not wait for
|
||||
// CheckTx nor DeliverTx results.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_async
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Tx/broadcast_tx_async
|
||||
func BroadcastTxAsync(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) {
|
||||
err := env.Mempool.CheckTx(tx, nil, mempl.TxInfo{})
|
||||
|
||||
@@ -30,7 +30,7 @@ func BroadcastTxAsync(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadca
|
||||
|
||||
// BroadcastTxSync returns with the response from CheckTx. Does not wait for
|
||||
// DeliverTx result.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_sync
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Tx/broadcast_tx_sync
|
||||
func BroadcastTxSync(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadcastTx, error) {
|
||||
resCh := make(chan *abci.Response, 1)
|
||||
err := env.Mempool.CheckTx(tx, func(res *abci.Response) {
|
||||
@@ -60,7 +60,7 @@ func BroadcastTxSync(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadcas
|
||||
}
|
||||
|
||||
// BroadcastTxCommit returns with the responses from CheckTx and DeliverTx.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Tx/broadcast_tx_commit
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Tx/broadcast_tx_commit
|
||||
func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadcastTxCommit, error) {
|
||||
subscriber := ctx.RemoteAddr()
|
||||
|
||||
@@ -149,7 +149,7 @@ func BroadcastTxCommit(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultBroadc
|
||||
|
||||
// UnconfirmedTxs gets unconfirmed transactions (maximum ?limit entries)
|
||||
// including their number.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/unconfirmed_txs
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/unconfirmed_txs
|
||||
func UnconfirmedTxs(ctx *rpctypes.Context, limitPtr *int) (*ctypes.ResultUnconfirmedTxs, error) {
|
||||
// reuse per_page validator
|
||||
limit := validatePerPage(limitPtr)
|
||||
@@ -163,7 +163,7 @@ func UnconfirmedTxs(ctx *rpctypes.Context, limitPtr *int) (*ctypes.ResultUnconfi
|
||||
}
|
||||
|
||||
// NumUnconfirmedTxs gets number of unconfirmed transactions.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/num_unconfirmed_txs
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/num_unconfirmed_txs
|
||||
func NumUnconfirmedTxs(ctx *rpctypes.Context) (*ctypes.ResultUnconfirmedTxs, error) {
|
||||
return &ctypes.ResultUnconfirmedTxs{
|
||||
Count: env.Mempool.Size(),
|
||||
@@ -173,7 +173,7 @@ func NumUnconfirmedTxs(ctx *rpctypes.Context) (*ctypes.ResultUnconfirmedTxs, err
|
||||
|
||||
// CheckTx checks the transaction without executing it. The transaction won't
|
||||
// be added to the mempool either.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Tx/check_tx
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Tx/check_tx
|
||||
func CheckTx(ctx *rpctypes.Context, tx types.Tx) (*ctypes.ResultCheckTx, error) {
|
||||
res, err := env.ProxyAppMempool.CheckTxSync(abci.RequestCheckTx{Tx: tx})
|
||||
if err != nil {
|
||||
|
||||
+2
-2
@@ -11,7 +11,7 @@ import (
|
||||
)
|
||||
|
||||
// NetInfo returns network info.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/net_info
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/net_info
|
||||
func NetInfo(ctx *rpctypes.Context) (*ctypes.ResultNetInfo, error) {
|
||||
peersList := env.P2PPeers.Peers().List()
|
||||
peers := make([]ctypes.Peer, 0, len(peersList))
|
||||
@@ -92,7 +92,7 @@ func UnsafeDialPeers(ctx *rpctypes.Context, peers []string, persistent, uncondit
|
||||
}
|
||||
|
||||
// Genesis returns genesis file.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/genesis
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/genesis
|
||||
func Genesis(ctx *rpctypes.Context) (*ctypes.ResultGenesis, error) {
|
||||
if len(env.genChunks) > 1 {
|
||||
return nil, errors.New("genesis response is large, please use the genesis_chunked API instead")
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ import (
|
||||
|
||||
// Status returns Tendermint status including node info, pubkey, latest block
|
||||
// hash, app hash, block height and time.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/status
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/status
|
||||
func Status(ctx *rpctypes.Context) (*ctypes.ResultStatus, error) {
|
||||
var (
|
||||
earliestBlockHeight int64
|
||||
|
||||
+2
-2
@@ -16,7 +16,7 @@ import (
|
||||
// Tx allows you to query the transaction results. `nil` could mean the
|
||||
// transaction is in the mempool, invalidated, or was not sent in the first
|
||||
// place.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/tx
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/tx
|
||||
func Tx(ctx *rpctypes.Context, hash []byte, prove bool) (*ctypes.ResultTx, error) {
|
||||
// if index is disabled, return error
|
||||
if _, ok := env.TxIndexer.(*null.TxIndex); ok {
|
||||
@@ -53,7 +53,7 @@ func Tx(ctx *rpctypes.Context, hash []byte, prove bool) (*ctypes.ResultTx, error
|
||||
|
||||
// TxSearch allows you to query for multiple transactions results. It returns a
|
||||
// list of transactions (maximum ?per_page entries) and the total count.
|
||||
// More: https://docs.tendermint.com/master/rpc/#/Info/tx_search
|
||||
// More: https://docs.tendermint.com/main/rpc/#/Info/tx_search
|
||||
func TxSearch(
|
||||
ctx *rpctypes.Context,
|
||||
query string,
|
||||
|
||||
+33
-34
@@ -1,7 +1,7 @@
|
||||
// HTTP RPC server supporting calls via uri params, jsonrpc over HTTP, and jsonrpc over
|
||||
// websockets
|
||||
//
|
||||
// Client Requests
|
||||
// # Client Requests
|
||||
//
|
||||
// Suppose we want to expose the rpc function `HelloWorld(name string, num int)`.
|
||||
//
|
||||
@@ -9,12 +9,12 @@
|
||||
//
|
||||
// As a GET request, it would have URI encoded parameters, and look like:
|
||||
//
|
||||
// curl 'http://localhost:8008/hello_world?name="my_world"&num=5'
|
||||
// curl 'http://localhost:8008/hello_world?name="my_world"&num=5'
|
||||
//
|
||||
// Note the `'` around the url, which is just so bash doesn't ignore the quotes in `"my_world"`.
|
||||
// This should also work:
|
||||
//
|
||||
// curl http://localhost:8008/hello_world?name=\"my_world\"&num=5
|
||||
// curl http://localhost:8008/hello_world?name=\"my_world\"&num=5
|
||||
//
|
||||
// A GET request to `/` returns a list of available endpoints.
|
||||
// For those which take arguments, the arguments will be listed in order, with `_` where the actual value should be.
|
||||
@@ -23,20 +23,19 @@
|
||||
//
|
||||
// As a POST request, we use JSONRPC. For instance, the same request would have this as the body:
|
||||
//
|
||||
// {
|
||||
// "jsonrpc": "2.0",
|
||||
// "id": "anything",
|
||||
// "method": "hello_world",
|
||||
// "params": {
|
||||
// "name": "my_world",
|
||||
// "num": 5
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// "jsonrpc": "2.0",
|
||||
// "id": "anything",
|
||||
// "method": "hello_world",
|
||||
// "params": {
|
||||
// "name": "my_world",
|
||||
// "num": 5
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// With the above saved in file `data.json`, we can make the request with
|
||||
//
|
||||
// curl --data @data.json http://localhost:8008
|
||||
//
|
||||
// curl --data @data.json http://localhost:8008
|
||||
//
|
||||
// WebSocket (JSONRPC)
|
||||
//
|
||||
@@ -44,42 +43,42 @@
|
||||
// Websocket connections are available at their own endpoint, typically `/websocket`,
|
||||
// though this is configurable when starting the server.
|
||||
//
|
||||
// Server Definition
|
||||
// # Server Definition
|
||||
//
|
||||
// Define some types and routes:
|
||||
//
|
||||
// type ResultStatus struct {
|
||||
// Value string
|
||||
// }
|
||||
// type ResultStatus struct {
|
||||
// Value string
|
||||
// }
|
||||
//
|
||||
// Define some routes
|
||||
//
|
||||
// var Routes = map[string]*rpcserver.RPCFunc{
|
||||
// "status": rpcserver.NewRPCFunc(Status, "arg"),
|
||||
// }
|
||||
// var Routes = map[string]*rpcserver.RPCFunc{
|
||||
// "status": rpcserver.NewRPCFunc(Status, "arg"),
|
||||
// }
|
||||
//
|
||||
// An rpc function:
|
||||
//
|
||||
// func Status(v string) (*ResultStatus, error) {
|
||||
// return &ResultStatus{v}, nil
|
||||
// }
|
||||
// func Status(v string) (*ResultStatus, error) {
|
||||
// return &ResultStatus{v}, nil
|
||||
// }
|
||||
//
|
||||
// Now start the server:
|
||||
//
|
||||
// mux := http.NewServeMux()
|
||||
// rpcserver.RegisterRPCFuncs(mux, Routes)
|
||||
// wm := rpcserver.NewWebsocketManager(Routes)
|
||||
// mux.HandleFunc("/websocket", wm.WebsocketHandler)
|
||||
// logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
|
||||
// listener, err := rpc.Listen("0.0.0.0:8080", rpcserver.Config{})
|
||||
// if err != nil { panic(err) }
|
||||
// go rpcserver.Serve(listener, mux, logger)
|
||||
// mux := http.NewServeMux()
|
||||
// rpcserver.RegisterRPCFuncs(mux, Routes)
|
||||
// wm := rpcserver.NewWebsocketManager(Routes)
|
||||
// mux.HandleFunc("/websocket", wm.WebsocketHandler)
|
||||
// logger := log.NewTMLogger(log.NewSyncWriter(os.Stdout))
|
||||
// listener, err := rpc.Listen("0.0.0.0:8080", rpcserver.Config{})
|
||||
// if err != nil { panic(err) }
|
||||
// go rpcserver.Serve(listener, mux, logger)
|
||||
//
|
||||
// Note that unix sockets are supported as well (eg. `/path/to/socket` instead of `0.0.0.0:8008`)
|
||||
// Now see all available endpoints by sending a GET request to `0.0.0.0:8008`.
|
||||
// Each route is available as a GET request, as a JSONRPCv2 POST request, and via JSONRPCv2 over websockets.
|
||||
//
|
||||
// Examples
|
||||
// # Examples
|
||||
//
|
||||
// - [Tendermint](https://github.com/tendermint/tendermint/blob/master/rpc/core/routes.go)
|
||||
// - [Tendermint](https://github.com/tendermint/tendermint/blob/main/rpc/core/routes.go)
|
||||
package jsonrpc
|
||||
|
||||
@@ -51,10 +51,10 @@ info:
|
||||
|
||||
ws ws://localhost:26657/websocket
|
||||
> { "jsonrpc": "2.0", "method": "subscribe", "params": ["tm.event='NewBlock'"], "id": 1 }
|
||||
version: "Master"
|
||||
version: "main"
|
||||
license:
|
||||
name: Apache 2.0
|
||||
url: https://github.com/tendermint/tendermint/blob/master/LICENSE
|
||||
url: https://github.com/tendermint/tendermint/blob/main/LICENSE
|
||||
servers:
|
||||
- url: https://rpc.cosmos.network
|
||||
description: Cosmos mainnet node to interact with the Tendermint RPC
|
||||
@@ -83,7 +83,7 @@ paths:
|
||||
description: |
|
||||
If you want to be sure that the transaction is included in a block, you can
|
||||
subscribe for the result using JSONRPC via a websocket. See
|
||||
https://docs.tendermint.com/master/app-dev/subscribing-to-events-via-websocket.html
|
||||
https://docs.tendermint.com/main/app-dev/subscribing-to-events-via-websocket.html
|
||||
If you haven't received anything after a couple of blocks, resend it. If the
|
||||
same happens again, send it to some other node. A few reasons why it could
|
||||
happen:
|
||||
@@ -95,7 +95,7 @@ paths:
|
||||
|
||||
|
||||
Please refer to
|
||||
https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#formatting
|
||||
https://docs.tendermint.com/main/tendermint-core/using-tendermint.html#formatting
|
||||
for formatting/encoding rules.
|
||||
parameters:
|
||||
- in: query
|
||||
@@ -127,7 +127,7 @@ paths:
|
||||
description: |
|
||||
If you want to be sure that the transaction is included in a block, you can
|
||||
subscribe for the result using JSONRPC via a websocket. See
|
||||
https://docs.tendermint.com/master/app-dev/subscribing-to-events-via-websocket.html
|
||||
https://docs.tendermint.com/main/app-dev/subscribing-to-events-via-websocket.html
|
||||
If you haven't received anything after a couple of blocks, resend it. If the
|
||||
same happens again, send it to some other node. A few reasons why it could
|
||||
happen:
|
||||
@@ -139,7 +139,7 @@ paths:
|
||||
3. node can be offline
|
||||
|
||||
Please refer to
|
||||
https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#formatting
|
||||
https://docs.tendermint.com/main/tendermint-core/using-tendermint.html#formatting
|
||||
for formatting/encoding rules.
|
||||
parameters:
|
||||
- in: query
|
||||
@@ -172,7 +172,7 @@ paths:
|
||||
IMPORTANT: use only for testing and development. In production, use
|
||||
BroadcastTxSync or BroadcastTxAsync. You can subscribe for the transaction
|
||||
result using JSONRPC via a websocket. See
|
||||
https://docs.tendermint.com/master/app-dev/subscribing-to-events-via-websocket.html
|
||||
https://docs.tendermint.com/main/app-dev/subscribing-to-events-via-websocket.html
|
||||
|
||||
CONTRACT: only returns error if mempool.CheckTx() errs or if we timeout
|
||||
waiting for tx to commit.
|
||||
@@ -181,7 +181,7 @@ paths:
|
||||
will contain a non-OK ABCI code.
|
||||
|
||||
Please refer to
|
||||
https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#formatting
|
||||
https://docs.tendermint.com/main/tendermint-core/using-tendermint.html#formatting
|
||||
for formatting/encoding rules.
|
||||
parameters:
|
||||
- in: query
|
||||
@@ -214,7 +214,7 @@ paths:
|
||||
The transaction won't be added to the mempool.
|
||||
|
||||
Please refer to
|
||||
https://docs.tendermint.com/master/tendermint-core/using-tendermint.html#formatting
|
||||
https://docs.tendermint.com/main/tendermint-core/using-tendermint.html#formatting
|
||||
for formatting/encoding rules.
|
||||
parameters:
|
||||
- in: query
|
||||
|
||||
Reference in New Issue
Block a user