GithubHelp home page GithubHelp logo

Comments (7)

cc32d9 avatar cc32d9 commented on September 26, 2024

I would propose a 2-phase plan:

Phase 1. Isolated FIO API

remove /v1/chain from user interaction, and define an API that completely covers everything an end-user application needs to use. Ideally, start a fio_api_plugin which would open its own HTTP socket and implement the API independently from EOSIO API.

Methods that require sending a transaction could be implemented as follows:

  1. User calls an unauthenticated API method, like /fio/transfer_fio.

  2. The server prepares an EOSIO transaction and sends a binary blob back to the user for signing.

  3. The user calls /fio/push_transaction with the signed blob.

So, all user-facing smart contract actions can be encapsulated in such an API. Also this plugin would provide all informational requests, such as searching for a domain, displaying fees, looking up the user balance.

Phase 2. Migrate to vanilla EOSIO

This requires significant efforts, and potentially a relaunch of the FIO blockchain. The goal is to have the original nodeos code as delivered by Block.one and have all FIO specifics isolated in a plugin.

Also as many customizations as possible, such as permissions management, should be moved from nodeos code into the system smart contract.

In this case, fio_api_plugin would also perform public key format conversion to keep the backward compatibility with "FIOxxx" keys.

The native EOSIO API doesn't even need to be exposed to the public. It would only be used for internal infrastructure at BP and application service providers.


If Phase 1 is started ASAP, it will guarantee long-term compatibility for user-facing software, and will allow for a thorough and careful implementation of Phase 2.

from fio.

aaroncox avatar aaroncox commented on September 26, 2024

Regarding Phase 1: removing access to the native /v1/chain/ API endpoints would break any cross compatibility we already have with existing generic EOSIO tooling (such as eosjs). This change would be a bit extreme.

Instead I'd just recommend leaving the /v1/chain plugin and APIs alone completely while still allowing access to them when needed. Any modified or additional API calls that need to be established for FIO can be put in the fio_api_plugin as described, which can coexist with the native API calls.

from fio.

cc32d9 avatar cc32d9 commented on September 26, 2024

Phase 1 can be introduced smoothly, in sub-phases:

1.1 introduce the new API and keep the old one

1.2 phase out the old API

1.3 cut the old API from public access

from fio.

lukestokes avatar lukestokes commented on September 26, 2024

while still allowing access to them when needed

I'm still fuzzy on how v1 calls can remain unchanged without deeper integration into the consensus logic of the chain (fees, error responses, etc), but that's probably due to my lack of understanding. The fees are what protect the chain and no call on chain can be free.

from fio.

lukestokes avatar lukestokes commented on September 26, 2024

Adding some links here regarding wrapping eosjs and this example of how it might be done.

from fio.

cc32d9 avatar cc32d9 commented on September 26, 2024

while still allowing access to them when needed

I'm still fuzzy on how v1 calls can remain unchanged without deeper integration into the consensus logic of the chain (fees, error responses, etc), but that's probably due to my lack of understanding. The fees are what protect the chain and no call on chain can be free.

see here, for example. max_fee is the action argument that is passed along other arguments. So it's not a change in the base transaction protocol:

https://github.com/fioprotocol/fio/blob/master/fio.contracts/contracts/fio.address/fio.address.cpp#L413

from fio.

ericbutz avatar ericbutz commented on September 26, 2024

Tracked in: https://fioprotocol.atlassian.net/browse/BD-1905

from fio.

Related Issues (20)

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.