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

[ECO-486][ECO-538] Add balance update support #511

Merged
merged 23 commits into from
Oct 2, 2023
Merged

[ECO-486][ECO-538] Add balance update support #511

merged 23 commits into from
Oct 2, 2023

Conversation

alnoki
Copy link
Member

@alnoki alnoki commented Oct 2, 2023

  • Delete deprecated Rust README
  • Add processor for MarketAccounts table handles
  • Add missing postgres views to old migrations
  • Add processor for MarketAccount table entries
  • Add view function to join on table handle for balance updates

To verify

health_check_port: 8085
server_config:
  processor_config:
    type: econia_transaction_processor
    econia_address: 0xc0de11113b427d35ece1d8991865a941c0578b0f349acabbe9753863c24109ff
  postgres_connection_string: postgres://econia:econia@postgres:5432/econia
  indexer_grpc_data_service_address: https://grpc.testnet.aptoslabs.com:443
  indexer_grpc_http2_ping_interval_in_secs: 60
  indexer_grpc_http2_ping_timeout_in_secs: 10
  auth_token: <my_auth_token>
  starting_version: 683453241

Run Docker compose instructions per the docs site then see http://0.0.0.0:3001/balance_updates

@vercel
Copy link

vercel bot commented Oct 2, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
econia ❌ Failed (Inspect) Oct 2, 2023 11:22pm

@alnoki alnoki changed the title [ECO-486][ECO-535] Add balance update support [ECO-486][ECO-538] Add balance update support Oct 2, 2023
#[derive(Clone, Debug, Queryable, Selectable, Insertable)]
#[diesel(table_name = crate::schema::market_account_handles)]
pub struct MarketAccountHandle {
pub user: String,
Copy link
Contributor

@elliottdehn elliottdehn Oct 2, 2023

Choose a reason for hiding this comment

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

I would include a time field so that we can know when a user's accounts first became active.

Copy link
Member Author

Choose a reason for hiding this comment

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

Included as of 5ab84ae

@@ -26,6 +26,8 @@ CREATE TRIGGER change_order_size_events_trigger
AFTER INSERT ON change_order_size_events FOR EACH ROW
EXECUTE PROCEDURE notify_change_order_size_event ();

CREATE VIEW api.change_order_size_events AS SELECT * FROM change_order_size_events;
Copy link
Contributor

@elliottdehn elliottdehn Oct 2, 2023

Choose a reason for hiding this comment

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

You'll need to update the openapi.json in the docs.
If you would: consider changing the host name in the generated docs to use port 3001 instead of 3000. This will allow people to use the request simulator to hit their local deployment. It uses 3000 because it's using the docker internal port to generate the docs.
I didn't do this originally because I didn't want us to have to manually edit the docs but I think this is a fine exception.

Copy link
Member Author

Choose a reason for hiding this comment

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

Deferring API spec updates to #513

@@ -87,3 +92,6 @@ $$ LANGUAGE plpgsql;
CREATE TRIGGER place_swap_order_events_trigger
AFTER INSERT ON place_swap_order_events FOR EACH ROW
EXECUTE PROCEDURE notify_place_swap_order_event ();

CREATE VIEW api.place_swap_order_events AS SELECT * FROM place_swap_order_events;
GRANT SELECT ON api.place_swap_order_events TO web_anon;
Copy link
Contributor

Choose a reason for hiding this comment

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

You'll have to add these in a new migration rather than updating the existing one now that we've distributed this code to other people. They won't be able to run the migration if it's already been run.

Copy link
Member Author

Choose a reason for hiding this comment

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

Included as of 5ab84ae

@vercel vercel bot temporarily deployed to Preview October 2, 2023 21:22 Inactive
@vercel vercel bot temporarily deployed to Preview October 2, 2023 21:25 Inactive
@vercel vercel bot temporarily deployed to Preview October 2, 2023 21:49 Inactive
@vercel vercel bot temporarily deployed to Preview October 2, 2023 21:57 Inactive
@vercel vercel bot temporarily deployed to Preview October 2, 2023 22:06 Inactive
@alnoki alnoki marked this pull request as draft October 2, 2023 22:19
@vercel vercel bot temporarily deployed to Preview October 2, 2023 22:33 Inactive
@alnoki alnoki marked this pull request as ready for review October 2, 2023 22:42
@vercel vercel bot temporarily deployed to Preview October 2, 2023 22:48 Inactive
@alnoki alnoki marked this pull request as draft October 2, 2023 22:50
@alnoki alnoki marked this pull request as ready for review October 2, 2023 22:54
@vercel vercel bot temporarily deployed to Preview October 2, 2023 23:22 Inactive
@alnoki alnoki merged commit 6a47264 into main Oct 2, 2023
1 of 4 checks passed
@alnoki alnoki deleted the ECO-486 branch October 2, 2023 23:28
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