add monerod code link docs

This commit is contained in:
hinto.janai 2024-09-09 17:31:22 -04:00
parent b93d2275f8
commit f41e6aa99e
No known key found for this signature in database
GPG key ID: D47CE05FA175A499
3 changed files with 69 additions and 5 deletions

View file

@ -35,6 +35,7 @@ pub(super) async fn map_request(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L611-L789>
async fn get_blocks(
state: CupratedRpcHandlerState,
request: GetBlocksRequest,
@ -42,6 +43,7 @@ async fn get_blocks(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L817-L857>
async fn get_blocks_by_height(
state: CupratedRpcHandlerState,
request: GetBlocksByHeightRequest,
@ -49,6 +51,7 @@ async fn get_blocks_by_height(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L859-L880>
async fn get_hashes(
state: CupratedRpcHandlerState,
request: GetHashesRequest,
@ -56,6 +59,7 @@ async fn get_hashes(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L959-L977>
async fn get_output_indexes(
state: CupratedRpcHandlerState,
request: GetOutputIndexesRequest,
@ -63,6 +67,7 @@ async fn get_output_indexes(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L882-L910>
async fn get_outs(
state: CupratedRpcHandlerState,
request: GetOutsRequest,
@ -70,6 +75,7 @@ async fn get_outs(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1689-L1711>
async fn get_transaction_pool_hashes(
state: CupratedRpcHandlerState,
request: GetTransactionPoolHashesRequest,
@ -77,6 +83,7 @@ async fn get_transaction_pool_hashes(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3352-L3398>
async fn get_output_distribution(
state: CupratedRpcHandlerState,
request: GetOutputDistributionRequest,

View file

@ -98,6 +98,7 @@ pub(super) async fn map_request(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1790-L1804>
async fn get_block_count(
mut state: CupratedRpcHandlerState,
request: GetBlockCountRequest,
@ -108,6 +109,7 @@ async fn get_block_count(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1806-L1831>
async fn on_get_block_hash(
mut state: CupratedRpcHandlerState,
request: OnGetBlockHashRequest,
@ -119,6 +121,7 @@ async fn on_get_block_hash(
Ok(OnGetBlockHashResponse { block_hash })
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2209-L2266>
async fn submit_block(
state: CupratedRpcHandlerState,
request: SubmitBlockRequest,
@ -129,6 +132,7 @@ async fn submit_block(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2268-L2340>
async fn generate_blocks(
state: CupratedRpcHandlerState,
request: GenerateBlocksRequest,
@ -140,6 +144,7 @@ async fn generate_blocks(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2468-L2498>
async fn get_last_block_header(
mut state: CupratedRpcHandlerState,
request: GetLastBlockHeaderRequest,
@ -153,6 +158,7 @@ async fn get_last_block_header(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2468-L2498>
async fn get_block_header_by_hash(
mut state: CupratedRpcHandlerState,
request: GetBlockHeaderByHashRequest,
@ -169,14 +175,13 @@ async fn get_block_header_by_hash(
fill_pow_hash: bool,
) -> Result<BlockHeader, Error> {
let hash = helper::hex_to_hash(hex)?;
let block = blockchain::block_by_hash(state, hash).await?;
let block_header = BlockHeader::from(&block);
let (_, block_header) = helper::block_header_by_hash(state, hash, fill_pow_hash).await?;
Ok(block_header)
}
let block_header = get(&mut state, request.hash, request.fill_pow_hash).await?;
// FIXME PERF: could make a `Vec` on await on all tasks at the same time.
let mut block_headers = Vec::with_capacity(request.hashes.len());
for hash in request.hashes {
let hash = get(&mut state, hash, request.fill_pow_hash).await?;
@ -190,19 +195,22 @@ async fn get_block_header_by_hash(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2629-L2662>
async fn get_block_header_by_height(
mut state: CupratedRpcHandlerState,
request: GetBlockHeaderByHeightRequest,
) -> Result<GetBlockHeaderByHeightResponse, Error> {
helper::check_height(&mut state, request.height).await?;
let block = blockchain::block(&mut state, request.height).await?;
let (_, block_header) =
helper::block_header(&mut state, request.height, request.fill_pow_hash).await?;
Ok(GetBlockHeaderByHeightResponse {
base: AccessResponseBase::ok(),
block_header: BlockHeader::from(&block),
block_header,
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2569-L2627>
async fn get_block_headers_range(
mut state: CupratedRpcHandlerState,
request: GetBlockHeadersRangeRequest,
@ -249,6 +257,7 @@ async fn get_block_headers_range(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2664-L2727>
async fn get_block(
mut state: CupratedRpcHandlerState,
request: GetBlockRequest,
@ -280,6 +289,7 @@ async fn get_block(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2729-L2738>
async fn get_connections(
state: CupratedRpcHandlerState,
request: GetConnectionsRequest,
@ -290,6 +300,7 @@ async fn get_connections(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L501-L582>
async fn get_info(
state: CupratedRpcHandlerState,
request: GetInfoRequest,
@ -338,6 +349,7 @@ async fn get_info(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2751-L2766>
async fn hard_fork_info(
state: CupratedRpcHandlerState,
request: HardForkInfoRequest,
@ -355,6 +367,7 @@ async fn hard_fork_info(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2832-L2878>
async fn set_bans(
state: CupratedRpcHandlerState,
request: SetBansRequest,
@ -366,6 +379,7 @@ async fn set_bans(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2768-L2801>
async fn get_bans(
state: CupratedRpcHandlerState,
request: GetBansRequest,
@ -376,6 +390,7 @@ async fn get_bans(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2803-L2830>
async fn banned(
state: CupratedRpcHandlerState,
request: BannedRequest,
@ -387,6 +402,7 @@ async fn banned(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2880-L2932>
async fn flush_transaction_pool(
state: CupratedRpcHandlerState,
request: FlushTransactionPoolRequest,
@ -395,6 +411,7 @@ async fn flush_transaction_pool(
Ok(FlushTransactionPoolResponse { status: Status::Ok })
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2934-L2979>
async fn get_output_histogram(
state: CupratedRpcHandlerState,
request: GetOutputHistogramRequest,
@ -405,6 +422,7 @@ async fn get_output_histogram(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2998-L3013>
async fn get_coinbase_tx_sum(
state: CupratedRpcHandlerState,
request: GetCoinbaseTxSumRequest,
@ -420,6 +438,7 @@ async fn get_coinbase_tx_sum(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2981-L2996>
async fn get_version(
state: CupratedRpcHandlerState,
request: GetVersionRequest,
@ -434,6 +453,7 @@ async fn get_version(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3015-L3031>
async fn get_fee_estimate(
state: CupratedRpcHandlerState,
request: GetFeeEstimateRequest,
@ -446,6 +466,7 @@ async fn get_fee_estimate(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3033-L3064>
async fn get_alternate_chains(
state: CupratedRpcHandlerState,
request: GetAlternateChainsRequest,
@ -456,6 +477,7 @@ async fn get_alternate_chains(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3254-L3304>
async fn relay_tx(
state: CupratedRpcHandlerState,
request: RelayTxRequest,
@ -463,6 +485,7 @@ async fn relay_tx(
Ok(RelayTxResponse { status: todo!() })
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3306-L3330>
async fn sync_info(
state: CupratedRpcHandlerState,
request: SyncInfoRequest,
@ -478,6 +501,7 @@ async fn sync_info(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3332-L3350>
async fn get_transaction_pool_backlog(
state: CupratedRpcHandlerState,
request: GetTransactionPoolBacklogRequest,
@ -488,6 +512,7 @@ async fn get_transaction_pool_backlog(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1998-L2033>
async fn get_miner_data(
state: CupratedRpcHandlerState,
request: GetMinerDataRequest,
@ -505,6 +530,7 @@ async fn get_miner_data(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3453-L3476>
async fn prune_blockchain(
state: CupratedRpcHandlerState,
request: PruneBlockchainRequest,
@ -516,6 +542,7 @@ async fn prune_blockchain(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2035-L2070>
async fn calc_pow(
state: CupratedRpcHandlerState,
request: CalcPowRequest,
@ -523,6 +550,7 @@ async fn calc_pow(
Ok(CalcPowResponse { pow_hash: todo!() })
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3542-L3551>
async fn flush_cache(
state: CupratedRpcHandlerState,
request: FlushCacheRequest,
@ -534,6 +562,7 @@ async fn flush_cache(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L2072-L2207>
async fn add_aux_pow(
state: CupratedRpcHandlerState,
request: AddAuxPowRequest,
@ -548,6 +577,7 @@ async fn add_aux_pow(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3553-L3627>
async fn get_tx_ids_loose(
state: CupratedRpcHandlerState,
request: GetTxIdsLooseRequest,

View file

@ -70,6 +70,7 @@ pub(super) async fn map_request(
})
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L486-L499>
async fn get_height(
state: CupratedRpcHandlerState,
request: GetHeightRequest,
@ -77,6 +78,7 @@ async fn get_height(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L979-L1227>
async fn get_transactions(
state: CupratedRpcHandlerState,
request: GetTransactionsRequest,
@ -84,6 +86,7 @@ async fn get_transactions(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L790-L815>
async fn get_alt_blocks_hashes(
state: CupratedRpcHandlerState,
request: GetAltBlocksHashesRequest,
@ -91,6 +94,7 @@ async fn get_alt_blocks_hashes(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1229-L1305>
async fn is_key_image_spent(
state: CupratedRpcHandlerState,
request: IsKeyImageSpentRequest,
@ -98,6 +102,7 @@ async fn is_key_image_spent(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1307-L1411>
async fn send_raw_transaction(
state: CupratedRpcHandlerState,
request: SendRawTransactionRequest,
@ -105,6 +110,7 @@ async fn send_raw_transaction(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1413-L1462>
async fn start_mining(
state: CupratedRpcHandlerState,
request: StartMiningRequest,
@ -112,6 +118,7 @@ async fn start_mining(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1464-L1482>
async fn stop_mining(
state: CupratedRpcHandlerState,
request: StopMiningRequest,
@ -119,6 +126,7 @@ async fn stop_mining(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1484-L1523>
async fn mining_status(
state: CupratedRpcHandlerState,
request: MiningStatusRequest,
@ -126,6 +134,7 @@ async fn mining_status(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1525-L1535>
async fn save_bc(
state: CupratedRpcHandlerState,
request: SaveBcRequest,
@ -133,6 +142,7 @@ async fn save_bc(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1537-L1582>
async fn get_peer_list(
state: CupratedRpcHandlerState,
request: GetPeerListRequest,
@ -140,6 +150,7 @@ async fn get_peer_list(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1626-L1639>
async fn set_log_hash_rate(
state: CupratedRpcHandlerState,
request: SetLogHashRateRequest,
@ -147,6 +158,7 @@ async fn set_log_hash_rate(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1641-L1652>
async fn set_log_level(
state: CupratedRpcHandlerState,
request: SetLogLevelRequest,
@ -154,6 +166,7 @@ async fn set_log_level(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1654-L1661>
async fn set_log_categories(
state: CupratedRpcHandlerState,
request: SetLogCategoriesRequest,
@ -161,6 +174,7 @@ async fn set_log_categories(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1758-L1778>
async fn set_bootstrap_daemon(
state: CupratedRpcHandlerState,
request: SetBootstrapDaemonRequest,
@ -168,6 +182,7 @@ async fn set_bootstrap_daemon(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1663-L1687>
async fn get_transaction_pool(
state: CupratedRpcHandlerState,
request: GetTransactionPoolRequest,
@ -175,6 +190,7 @@ async fn get_transaction_pool(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1741-L1756>
async fn get_transaction_pool_stats(
state: CupratedRpcHandlerState,
request: GetTransactionPoolStatsRequest,
@ -182,6 +198,7 @@ async fn get_transaction_pool_stats(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1780-L1788>
async fn stop_daemon(
state: CupratedRpcHandlerState,
request: StopDaemonRequest,
@ -189,6 +206,7 @@ async fn stop_daemon(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3066-L3077>
async fn get_limit(
state: CupratedRpcHandlerState,
request: GetLimitRequest,
@ -196,6 +214,7 @@ async fn get_limit(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3079-L3117>
async fn set_limit(
state: CupratedRpcHandlerState,
request: SetLimitRequest,
@ -203,6 +222,7 @@ async fn set_limit(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3119-L3127>
async fn out_peers(
state: CupratedRpcHandlerState,
request: OutPeersRequest,
@ -210,6 +230,7 @@ async fn out_peers(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3129-L3137>
async fn in_peers(
state: CupratedRpcHandlerState,
request: InPeersRequest,
@ -217,6 +238,7 @@ async fn in_peers(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L584-L599>
async fn get_net_stats(
state: CupratedRpcHandlerState,
request: GetNetStatsRequest,
@ -224,6 +246,7 @@ async fn get_net_stats(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L912-L957>
async fn get_outs(
state: CupratedRpcHandlerState,
request: GetOutsRequest,
@ -231,6 +254,7 @@ async fn get_outs(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3139-L3240>
async fn update(
state: CupratedRpcHandlerState,
request: UpdateRequest,
@ -238,6 +262,7 @@ async fn update(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L3242-L3252>
async fn pop_blocks(
state: CupratedRpcHandlerState,
request: PopBlocksRequest,
@ -245,6 +270,7 @@ async fn pop_blocks(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L1713-L1739>
async fn get_transaction_pool_hashes(
state: CupratedRpcHandlerState,
request: GetTransactionPoolHashesRequest,
@ -252,6 +278,7 @@ async fn get_transaction_pool_hashes(
todo!()
}
/// <https://github.com/monero-project/monero/blob/cc73fe71162d564ffda8e549b79a350bca53c454/src/rpc/core_rpc_server.cpp#L193-L225>
async fn get_public_nodes(
state: CupratedRpcHandlerState,
request: GetPublicNodesRequest,