Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement new REST API: GET /colors/ #33

Merged
merged 5 commits into from
Apr 22, 2024
Merged

Implement new REST API: GET /colors/ #33

merged 5 commits into from
Apr 22, 2024

Conversation

Yamaguchi
Copy link
Contributor

Implement new REST API

GET /colors/[:last_seen_color_id]

chaintope/tapyrus-explorer#55

@Yamaguchi Yamaguchi force-pushed the feature/get_colors_api branch from 78967d0 to ef4a407 Compare March 14, 2024 19:49
@@ -36,8 +36,8 @@ page_size = "0.4.2"
prometheus = "0.11.0"
openassets-tapyrus = "^0.2.4"
rayon = "1.5.0"
rocksdb = { version = "0.15.0", optional = true }
rocksdb-oldcpu = { version = "0.12.4", optional = true, package = "rocksdb" }
rocksdb = { version = "^0.22.0", optional = true }
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新のmacOS環境でビルドが通らなかったため、アップデート

@@ -26,7 +26,7 @@ impl<'a> Iterator for ScanIterator<'a> {
if self.done {
return None;
}
let (key, value) = self.iter.next()?;
let (key, value) = self.iter.next()?.ok()?;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

最新のmacOS環境(rust: 1.76.0)でビルドが通らなかったため、修正

@Yamaguchi
Copy link
Contributor Author

ちなみに、この実装だとすでに運用中のesplora-tapyrusがある場合は、データを削除してインデックスを作り直す必要があります。テストネットの場合だとインデックスの再作成に、現状20分以上は必要です。

doc/API.md Outdated Show resolved Hide resolved
doc/API.md Outdated Show resolved Hide resolved
@Yamaguchi Yamaguchi force-pushed the feature/get_colors_api branch 2 times, most recently from 48864d2 to 35f122f Compare March 24, 2024 18:43
@Yamaguchi Yamaguchi force-pushed the feature/get_colors_api branch from 35f122f to 4f17079 Compare March 25, 2024 05:39
@Yamaguchi
Copy link
Contributor Author

以下の2点を修正してまsう

  • ブロック高をlittle endianで入れていたために高さ順にcolor_idを取得しようとした場合に正しく取れない現象を修正3aa81f5
  • GET /colors のレスポンスに発行量などの情報を追加で返すようにした7c71bb8

doc/API.md Outdated
@@ -227,6 +227,13 @@ For example: `{ "1": 87.882, "2": 87.882, "3": 87.882, "4": 87.882, "5": 81.129,

## Tokens

### `GET /colors[/:last_seen_color_id]`

Returns a list of the 25 (`color_id`, `block_height`) pairs
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

他に、chain_statsmempool_statsも含まれているようなので、それぞれ何を指すか説明を追記してください。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

5b40145  で追記してます

@azuchi azuchi merged commit 805f935 into main Apr 22, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants