Comments (10)
Anyone (registered in the XBR network) can publish an API definition:
/**
* Publish an API to the service API registry.
*
* @param api: Globally unique (and unchangeable) API ID (a 16 bytes UUID).
* @param schema: API schema definition (required).
IPFS Multihash pointing to a schema definition file.
* @param terms: Optional copyright, legalese and terms (for human/developers consumption).
IPFS Multihash pointing to a terms archive file.
* @param docs: Optional API documentation (for human/developer consumption).
IPFS Multihash pointing to a documentation archive file.
*/
function publishAPI (bytes16 api,
string memory schema,
string memory terms,
string memory docs) public;
- Once an API has been published, it is frozen: its schema definition and its terms cannot be changed anymore.
- The documentation for an API (different from the schema) can be changed after the API has been published in the first place
from wamp-xbr.
The approach of identifiying APIs using UUIDs, and freezing APIs once published, follows established practice in eg MS COM (component object model):
The COM standard requires that an interface definition must not change once it has been published. The author cannot, for example, add a new method to an existing interface. The author must instead create a new interface. While there are no restrictions on what methods must be in that interface, a common practice is to have the next-generation interface include all the of the old interface's methods, plus any new methods. It's not unusual for an interface to have several generations. Typically, all generations perform essentially the same overall task, but they're different in specifics. Often, a COM component implements every current and prior generation of a given interface's lineage. Doing so allows older applications to continue using the object's older interfaces, while newer applications can take advantage of the features of the newer interfaces. Typically, a descent group of interfaces all have the same name, plus an integer that indicates the generation. For example, if the original interface were named IMyInterface (implying generation 1), then the next two generations would be called IMyInterface2 and IMyInterface3.
source: https://docs.microsoft.com/en-us/windows/win32/prog-dx-with-com
While an APIs UUID is known and published on-chain, any interface naming (such as WAMP URIs) is only part of the schema definition - which lives off-chain (as a file on IPFS or elsewhere).
from wamp-xbr.
Since an API is frozen once published (neither its schema nor its term can change), the only data that can be update is the API documentation, for which we need to provide a public function - which can only be called by the original publisher of the respective API:
function updateAPIDocs (bytes16 api,
string memory docs) public;
from wamp-xbr.
Q: In addition to API schema
, terms
and docs do we need an API
meta(machine readable, but different from the contents of
schema`)?
from wamp-xbr.
The relation between APIs and services (implementing said APIs), and between an API registry/catalog and a service registry - in general - is such:
source of diagram: https://wso2.com/blogs/thesource/2014/07/api-registry-and-service-registry/
For XBR
- the API registry/catalog is living on-chain as described above
- the service registry also lives on-chain - essentially every data market maintains its own service registry (again, see #38)
from wamp-xbr.
Terminology:
- Interface ("API"): abstract but binding contract between two software components - in XBR, interfaces are always WAMP interfaces (a collection of PubSub topics and its event payloads, and RPC procedures and its call arguments, return and error payloads)
- API Catalog: global on-chain instance (singleton) of published APIs
- Service Registry: in XBR, each data market is a service registry
- Service: in XBR, always a XBR seller delegate which is a WAMP component that implements one or more interfaces (in above sense)
- Service Offer/Consent: in XBR, a seller may announce that it provides a service in a market which implements one or more interfaces
from wamp-xbr.
XBR API schema definition: this needs some design around the following constraints (which are already clear at this point):
- the URIs of WAMP topics, procedures and errors must be defined
- the payload of WAMP events and WAMP call arguments/results/errors should be defined in FlatBuffers schema
here is a first sketch of how that may look like:
from wamp-xbr.
so with above design, we would have the following top-level entities:
from wamp-xbr.
XBRNetwork.register(eula, profile)
XBRNetwork.createMarket(terms, meta) -> market adr
market terms content: zip file with documents
market terms ipfs adr (from content)
market meta content:
market name
market title
market description
market tags
market icon
market homepage
market created timestamp + blocknumber
transaction plane wamp url + realm & market maker adr
data plane wamp url + realm
market meta ipfs adr (from content)
XBRMarket.join(actor types, meta, consent)
XBRMarket.openBuyerChannel(recipient, delegate, amount)
XBRMarket.openSellerChannel(recipient, delegate, amount)
XBRNetwork.createCatalog(terms, meta) -> catalog adr
XBRCatalog.publishAPI(api id, meta)
XBRCatalog.publishService(service id, meta)
from wamp-xbr.
landed via #90
from wamp-xbr.
Related Issues (20)
- Store total supply along market fee
- Test XBR on Rinkeby with DAI
- Deploy v20.5.1 on Rinkeby HOT 5
- Test XBR on witti testnet HOT 3
- Publish stackLicense files to IPFS HOT 1
- Legal review: XBR and draft German Crypto Securities Act HOT 1
- Complete XBRDomain
- Review contract data attributes
- update to solidity v0.6.12
- INVALID_CLOSING_SEQ when closing a channel
- GAIA-X
- SENDER_NOT_A_MEMBER When setting consent
- Recheck links in truffle migrate
- XbrRelease
- Deploy v21.1.1 on Rinkeby HOT 5
- Upgrade to OpenZeppelin Contracts 4.0
- User joining and members can stake
- WhitelistCrowdsale
- PaymentSplitter for cleared fees HOT 1
- Review licenses
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wamp-xbr.