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

Ocean archive indexer and api server #2724

Merged
merged 207 commits into from
Sep 28, 2024
Merged

Ocean archive indexer and api server #2724

merged 207 commits into from
Sep 28, 2024

Conversation

Jouzo
Copy link
Collaborator

@Jouzo Jouzo commented Nov 27, 2023

Summary

  • Introduces ocean indexes and API

Flags :

"-oceanarchive", Enable ocean archive indexer
"-oceanarchiveserver", Enable ocean archive server
"-oceanarchiveport=<port>", Listen for ocean archive connections on <port>
"-oceanarchivebind=<addr>[:port]", Bind to given address to listen for Ocean connections. Do not expose the Ocean server to untrusted networks such as the public internet! This option is ignored unless -rpcallowip is also passed. Port is optional and overrides -oceanarchiveport. This option can be specified multiple times (default: 127.0.0.1 i.e., localhost)"

@Jouzo Jouzo marked this pull request as draft November 27, 2023 19:36
@Jouzo Jouzo force-pushed the feature/ocean-archive branch 3 times, most recently from f12bdf8 to 96ff191 Compare November 27, 2023 20:19
@Jouzo
Copy link
Collaborator Author

Jouzo commented Dec 19, 2023

List of RPC queries done by Ocean that should be exposed directly by FFI:

account.getAccount
account.getAccountHistory
account.getBurnInfo
account.listAccountHistory
blockchain.getBlockchainInfo
loan.getLoanInfo
loan.getLoanScheme
masternode.getGov
net.getNetworkInfo
poolpair.getPoolPair
poolpair.listPoolPairs
token.getToken
token.listTokens

@Jouzo Jouzo mentioned this pull request Dec 27, 2023
21 tasks
@canonbrother canonbrother force-pushed the feature/ocean-archive branch from cf793b1 to 039219b Compare February 7, 2024 07:15
Jouzo and others added 23 commits February 7, 2024 22:13
* add ApiPageResponse + impl json on list_blocks

* refine

* body -> query
* Added `rockdb` to ocean api.
* Implementation of ocean-api database method  all  module.
* Added data_access layer
* Added test case for module.
* wip

* fail-fast false
* pagination query

* poolpair path api path

* mild refactor on error.rs and block.rs

* masternode typing

* rm debug_handler

* extra line

* default masternodestate

* fix return type

* typo

* pub enum state

* missing import

* clone

* simplified mn
* added block indexing

* added block indexing and query method

* added query methods and extra table

* added query methods to modules

* added oracle price active and prive feed module

* added oracle price active and prive feed module

* rebased indexing ocean-archive

* rebased indexing ocean-archive and updated query methods all modules

* rebased indexing ocean-archive and updated query methods all modules

* fixed white space

* fixed white space

* fixed query method for masternode and masterstats
* OceanStore building

* With RepositoryOps trait

* Cleanup columns

* Implement put/get/list masternode

* Fix MasternodeByHeight get_key

* Cleanup MasternodeData

* Invalidate masternode

* Remove comments

* cfg(test_off)

---------

Co-authored-by: canonbrother <w.canonbrother@gmail.com>
* target branch feature/ocean-archive

* docker-build

* on pr master + note
@Jouzo Jouzo force-pushed the feature/ocean-archive branch from e33fc67 to d422a1b Compare September 24, 2024 08:00
Jouzo and others added 9 commits September 24, 2024 12:48
* model cleanup dup fields

* fix apis

* fmt_rs

* cleanup PriceTicker 2

* rm oracle_history

* model cleanup

* fix api

* clippy

* fmt_rs

* better naming

* fmt

* fix get_oracle_by_address api

* update rounding strategy

update rounding strategy

* aggregated amt and weigtage typing

* fmt_rs
* cache pool utils

* get_network_info_cached

* guard
@Jouzo Jouzo changed the title WIP: Ocean archive and Ocean API Ocean Sep 27, 2024
prasannavl
prasannavl previously approved these changes Sep 27, 2024
@@ -135,7 +135,7 @@ pub async fn init_ocean_server(addr: String) -> Result<()> {
let (user, pass) = ain_cpp_imports::get_rpc_auth().map_err(|e| format_err!("{e}"))?;
let client = Arc::new(
Client::new(
&format!("localhost:{}", ain_cpp_imports::get_rpc_port()),
&format!("http://127.0.0.1:{}", ain_cpp_imports::get_rpc_port()),
Copy link
Member

@prasannavl prasannavl Sep 28, 2024

Choose a reason for hiding this comment

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

Note, we might need to let this be configured from the flags similar to the rest as if the IP binding is different, it might not work

@prasannavl
Copy link
Member

Going ahead and merging this in, as even though it doesn't affect consensus and the rest is also completed isolated and flagged - it's good to have the core part of it in for the testnet release before further refinements and fixes that target the optional ocean archive.

@prasannavl prasannavl changed the title Ocean Ocean archive indexer and api server Sep 28, 2024
@prasannavl prasannavl merged commit b309f1d into master Sep 28, 2024
17 of 28 checks passed
@prasannavl prasannavl deleted the feature/ocean-archive branch September 28, 2024 05:11
@@ -4666,6 +4685,15 @@ Res ProcessDeFiEventFallible(const CBlock &block,
// Construct undo
FlushCacheCreateUndo(pindex, mnview, cache, uint256S(std::string(64, '1')));

// Ocean archive
Copy link
Member

Choose a reason for hiding this comment

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

Maybe this should be after evm_try_unsafe_commit_block in ConnectBlock, that's the very last point of failure when connecting new blocks.

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.

6 participants