Git Product home page Git Product logo

mentat's People

Contributors

0rphon avatar damons avatar gluax avatar jels-boolean avatar macs-j1149 avatar meshiest avatar mowkoshka avatar protryon avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

mentat's Issues

[Feature] Swap Make with Bazel

Several of us here use Windows for development, and Make isn't very windows friendly.

We should swap to a more cross-friendly tool to help development.

[Feature] Backend Support Aggregation

๐Ÿš€ Feature

Have the ability to seamlessly support and add multiple networks.

Motivation

The Rosetta design easily supports this, though the spec says you should not do this.
However, we should have the option to also allow this.

Implementation

Change Mentat so you can implement multiple services at once and the routes should check the network and call to the correct network.

[Proposal] Configuration File

A configuration file would be cleaner and easier to work with than Env variable reading scattered everywhere in the code.

[Feature] Cross Origin Headers

๐Ÿš€ Feature

An option for configurable Access-Control-Allow-Origin, Access-Control-Allow-Method, headers present on POST requests and OPTIONS endpoints for the Rosetta API endpoints.

Motivation

When developing frontends that query remote APIs on different addresses, CORS is required for access. Having these headers present on Mentat removes the need for a reverse proxy solely for them.

Implementation

The route_builder will need to be extended to add OPTIONS routes.

The configuration will need to add fields to support allowed origins/*.

SnarkOS Tracking Docs

We need to have documentation tracking what is and isn't currently possible for a rosetta-snarkOS implementation.

[Feature] Wasm Bindgen Client

๐Ÿš€ Feature

Wasm Bindgen for the client.

Motivation

So it can be used from typescript and called from the front end.

Implementation

Use the wasm_bindgen crate to help derive the typescript types.

[Feature] allow users to specify their own middleware checks

right now in the middleware we only look at blockchain and network in NetworkIdentifier. this is an issue because the kind of check done relies on the node being run. ie bitcoin doesnt have shards but other networks do and they will need to check those

i purposely made the signature to the check function very generic. what we could do is allow the user to supply pointers to their own check functions that would get run in the middleware. we could obviously still provide default ones as well, but i think there are cases where overriding the default will be required.

[Bug] cant implement `/call` with current caching system

/call in Rosetta API has an idempotent field that states the following:

Idempotent indicates that if /call is invoked with the same CallRequest again, at any point in time, it will return the same CallResponse. Integrators may cache the CallResponse if this is set to true to avoid making unnecessary calls to the Rosetta implementation. For this reason, implementers should be very conservative about returning true here or they could cause issues for the caller.

the issue is, our current caching system needs to know if caching is implemented on a route at compile time. so we would need to implement two different versions of /call and call it based on the contents of idempotent

[MVP] Match Rosetta SDK Spec

๐Ÿš€ Feature

Mentat should match the Rosetta SDK spec.

Motivation

The goal is to match the Rosetta SDK spec as Mentat is meant to be an SDK for implementing Rosetta services.
This allows us to be added to the rosetta-ecosystem repository and the ecosystem category of the community site.

Implementation

Some of these may already be done or need to be slightly modified.
All bolded ones are required.
Just going to list them all here for now.

Additionally, each of these should be demonstrated in an examples directory.

[Feature] Add Tips Request

๐Ÿš€ Feature

Add an optional endpoint named sync/progress/etc.

Motivation

This way you can see how synced your current block is and the latest block.

Implementation

A new endpoint that returns this information, is only available in online mode.

Containarized Deployment

Make a containerized deployment for rosetta.
Spec found here.

  • Endpoints
    • Specify Offline vs Online modes.
    • Mainnet vs Testnet modes.
  • Container snarkos-node

[Feature] Health Check Endpoint

๐Ÿš€ Feature

A health check endpoint.

Motivation

An API typically has a health check endpoint, which is typically cheap and easy to call so a user can test the server.

[Proposal] Performance Checking Tests

To build a performance test framework, we should use oha.
It is a binary, so we could either wrap around it from rust or write shell scripts to test individual endpoints.

I suppose we would also need different data to accomplish such a goal.
It may be cleaner to consider moving each Mentat implementation to different repositories so data for each isn't cluttering this repo.
We could add onto the readme or maybe a separate markdown file the list of repos who use Mentat. People could make PR's to add their service to it.

[Bug] Node always needs to be launched

๐Ÿ› Bug Report

The node should always be launched, but it is only launched during online mode.

Steps to Reproduce

Launch node in offline mode and you cannot make any rpc calls.

Code/Action snippet to reproduce

(https://github.com/monadicus/mentat/blob/main/mentat/src/server/mod.rs#L143)

Expected Behavior

RPC calls should work as long as they don't make any outbound connections.

(Write what you expected to happen here)

Your Environment

  • Mentat Version: Main

missing `network_identifier` check

a check is never performed to make sure the network_identifier field is correct before making a request to a node, meaning you can specify testnet in your request to mentat but mentat will blindly pass on the request to whatever node is running without checking if its actually testnet first. this would lead to either incorrect data being returned or an error being returned from a seemingly valid request.

"network_identifier": {
    "blockchain": "bitcoin",
    "network": "mainnet",
    "sub_network_identifier": {
        "network": "shard 1",
        "metadata": {
            "producer": "0x52bc44d5378309ee2abf1539bf71de1b7d7be3b5"
        }
    }
},

so basically, we need to add checks for each endpoint in mentat to make sure the blockchain/network being requested actually exists and return an error if it doesn't. if i recall correctly this info should be available as environment variables, so this would be as simple as adding a method on the NetworkIdentifier struct that performs this check then calling that method whenever network_identifier is passed

[Feature] 404 catch all

๐Ÿš€ Feature

We need to catch 404s

Motivation

We should return a proper error for a 404.

Implementation

Axum allows you to set a fallback 404 catcher.

Readme

Write the readme.
Possibly the same standard of readmes as done for rosetta-bitcoin/etherum.

[Feature] implement all errors

we need to look at the output of coinbase's rosetta impl's /network/options endpoint to make sure we implement all the errors that they implement

[Bug] Configuration Template Generation Fails

๐Ÿ› Bug Report

Generating a templated configuration file for mentat's rosetta-snarkos fails.

Code/Action snippet to reproduce

cargo run ./conf.dne.toml

Stack trace & error message

thread 'main' panicked at 'Failed to create default toml configuration at `./conf2.toml`: unsupported Rust type', C:\Users\jonat\AppData\Roaming\work\Monadicus\mentat\mentat\src\conf\configuration.rs:195:13
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Expected Behavior

Should generate the configuration file.

Pass Rosetta API tests

This involves filling in the logic for the currently standing endpoints and then writing tests that confirm proper functionality.

We can use bitcoin data for now:

[Feature] Graphql Queries in addition to the rest api

๐Ÿš€ Feature

Graphql query language for all the rest calls.

Motivation

Graphql is a great way for developers to write custom calls.

Implementation

Ideally, once we have the types module auto-generate the graphql queries as well.

Cache Layer

To have the tests run at a reasonable rate, as well as for general performance, there needs to be a caching layer.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.