Skip to content

Commit

Permalink
feat: chain-api generates OpenRPC definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
aatifsyed committed Mar 13, 2024
1 parent 55fc94b commit c5353d1
Show file tree
Hide file tree
Showing 3 changed files with 703 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/rpc/chain_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ async fn chain_get_block(

async fn chain_get_tipset(
ctx: Data<RPCState<impl Blockstore>>,
LotusJson(ApiTipsetKey(tsk)): LotusJson<(ApiTipsetKey)>,
LotusJson(ApiTipsetKey(tsk)): LotusJson<ApiTipsetKey>,
) -> Result<LotusJson<Tipset>, JsonRpcError> {
let ts = ctx
.state_manager
Expand Down
24 changes: 0 additions & 24 deletions src/rpc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ where
DB: Blockstore + Send + Sync + 'static,
{
use auth_api::*;
// use chain_api::*;
use eth_api::*;
use gas_api::*;
use mpool_api::*;
Expand All @@ -184,29 +183,6 @@ where
module.register_async_method(AUTH_VERIFY, auth_verify::<DB>)?;
// Beacon API
module.register_async_method(BEACON_GET_ENTRY, beacon_get_entry::<DB>)?;
// Chain API
// module.register_async_method(CHAIN_GET_MESSAGE, chain_get_message::<DB>)?;
// module.register_async_method(CHAIN_EXPORT, chain_export::<DB>)?;
// module.register_async_method(CHAIN_READ_OBJ, chain_read_obj::<DB>)?;
// module.register_async_method(CHAIN_HAS_OBJ, chain_has_obj::<DB>)?;
// module.register_async_method(CHAIN_GET_BLOCK_MESSAGES, chain_get_block_messages::<DB>)?;
// module.register_async_method(CHAIN_GET_TIPSET_BY_HEIGHT, chain_get_tipset_by_height::<DB>)?;
// module.register_async_method(
// CHAIN_GET_TIPSET_AFTER_HEIGHT,
// chain_get_tipset_after_height::<DB>,
// )?;
// module.register_async_method(CHAIN_GET_GENESIS, |_, state| chain_get_genesis::<DB>(state))?;
// module.register_async_method(CHAIN_GET_TIPSET, chain_get_tipset::<DB>)?;
// module.register_async_method(CHAIN_HEAD, |_, state| chain_head::<DB>(state))?;
// module.register_async_method(CHAIN_GET_BLOCK, chain_get_block::<DB>)?;
// module.register_async_method(CHAIN_SET_HEAD, chain_set_head::<DB>)?;
// module.register_async_method(CHAIN_GET_MIN_BASE_FEE, chain_get_min_base_fee::<DB>)?;
// module.register_async_method(
// CHAIN_GET_MESSAGES_IN_TIPSET,
// chain_get_messages_in_tipset::<DB>,
// )?;
// module.register_async_method(CHAIN_GET_PARENT_MESSAGES, chain_get_parent_messages::<DB>)?;
// module.register_async_method(CHAIN_GET_PARENT_RECEIPTS, chain_get_parent_receipts::<DB>)?;
// Message Pool API
module.register_async_method(MPOOL_GET_NONCE, mpool_get_nonce::<DB>)?;
module.register_async_method(MPOOL_PENDING, mpool_pending::<DB>)?;
Expand Down
Loading

0 comments on commit c5353d1

Please sign in to comment.