Skip to content

Commit

Permalink
indexer: forward suins requests (MystenLabs#12268)
Browse files Browse the repository at this point in the history
## Description 

refer title

## Test Plan 

test locally with http://ewr-mnt-rpc-03.mainnet.sui.io:9000/ as
underlying FN and make sure SuiNS endpoints work

```
curl --location --request POST http://127.0.0.1:3030 \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_resolveNameServiceAddress",
"params": ["seanmikha.sui"]
}'
{"jsonrpc":"2.0","result":"0xe0b97bff42fcef320b5f148db69033b9f689555348b2e90f1da72b0644fa37d0","id":1}%                                                 
curl --location --request POST http://127.0.0.1:3030 \
--header 'Content-Type: application/json' \
--data-raw '{
"jsonrpc": "2.0",
"id": 1,
"method": "suix_resolveNameServiceNames",
"params": ["0xe0b97bff42fcef320b5f148db69033b9f689555348b2e90f1da72b0644fa37d0"]
}'
{"jsonrpc":"2.0","result":{"data":["seanmikha.sui"],"nextCursor":"0xce63acd667fb227282c32eeef8d63e543996df9617715649d2a68436a31161b0","hasNextPage":false},"id":1}%       
```

---
If your changes are not user-facing and not a breaking change, you can
skip the following section. Otherwise, please indicate what changed, and
then add to the Release Notes section as highlighted during the release
process.

### Type of Change (Check all that apply)

- [ ] protocol change
- [ ] user-visible impact
- [ ] breaking change for a client SDKs
- [ ] breaking change for FNs (FN binary must upgrade)
- [ ] breaking change for validators or node operators (must upgrade
binaries)
- [ ] breaking change for on-chain data layout
- [ ] necessitate either a data wipe or data migration

### Release notes
  • Loading branch information
gegaowp authored May 31, 2023
1 parent 36912ab commit 7907ff5
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions crates/sui-indexer/src/apis/indexer_api.rs
Original file line number Diff line number Diff line change
Expand Up @@ -449,19 +449,19 @@ where
Ok(())
}

async fn resolve_name_service_address(&self, _name: String) -> RpcResult<Option<SuiAddress>> {
// TODO(gegaowp): implement name service resolver in indexer
todo!()
async fn resolve_name_service_address(&self, name: String) -> RpcResult<Option<SuiAddress>> {
self.fullnode.resolve_name_service_address(name).await
}

async fn resolve_name_service_names(
&self,
_address: SuiAddress,
_cursor: Option<ObjectID>,
_limit: Option<usize>,
address: SuiAddress,
cursor: Option<ObjectID>,
limit: Option<usize>,
) -> RpcResult<Page<String, ObjectID>> {
// TODO(gegaowp): implement name service resolver in indexer
todo!()
self.fullnode
.resolve_name_service_names(address, cursor, limit)
.await
}
}

Expand Down

0 comments on commit 7907ff5

Please sign in to comment.