Comments (8)
I like the idea of moving stellar.txt to something that is easier to parse. Still Any change from stellar.txt to another format will reduce the need for custom stellar.txt parsers.
With JSON, we lose the ability to add comments [semantically]. Most JSON parsers don't allow comments and is not allowed in the JSON spec. We will have to make this choice carefully since it's a big part of the protocol on how users interact with gateways.
Yaml is a great alternative since it is more human readable (optional newlines) and supports comments. In both the short and long term, it should be fine to use yaml since it has a well defined spec and libraries for it are fairly common.
In YAML, it could be organized like this:
federation_url: "https://api.stellar.org/federation"
reverse_federation_url: "https://api.stellar.org/reverseFederation"
accounts:
- "gJGPgbCnaP3vypwoxtXWEn9tyoARywPE7F"
- "gJGPgbCnaP3vypwoxtXWEn9tyoARywPE7F"
currencies:
USD: "gJGPgbCnaP3vypwoxtXWEn9tyoARywPE7F"
SCT: "gDSSa75HPagWcvQmwH7D51dT5DPmvsKL4q"
# This is a comment
validators:
nakuKsirzNq66iejBfxKxt8Rw4t7kP5ZWSrvWzVKEVSHSkJKYd1: "SDF1"
n3gVwaSDBtVi4Xd2XBh7rvcwis4uBabu5aNn7WKtEqazJbLHR9n: "SDF2"
nfozTPzMytTKuuHBJrPB9DVxPccKeNVh8vsEomUAwNWuWrNxwDB: "SDF3"
naSBAykwFkmw6JLKqPG7HPFMK1GZqu1rdnwbhtTxyTmVX1b6b8z: "SDF4"
nf3yCmpieMFvAbv5r5jBhGeXheuhc3boAkdmBbpXb6HC7HDkf13: "SDF5"
from stellar-protocol.
One thing though is that there are disadvantages with yaml such that the specification is extremely long. It's not as simple as just picking one spec. Another alternative is toml: https://github.com/toml-lang/toml
I think that before we pick a new format for stellar.txt, we need to have a discussion before quickly just picking another format without analyzing the costs and benefits.
from stellar-protocol.
TOML 👍
from stellar-protocol.
Problem with TOML is that:
Latest tagged version: v0.2.0.
Be warned, this spec is still changing a lot. Until it's marked as 1.0, you should assume that it is unstable and act accordingly.
I think YAML is simpler and cleaner than JSON and has built-in/package parsers in most of popular languages.
from stellar-protocol.
What are the advantages to having semantic comments available in the structure of the file to be parsed (for the purposes of stellar.txt -- not in the general sense)? Most JSON documents are to be consumed using a known structure either by definition, documentation or by discovery. I'm definitely in favor of something other than a plain text file for a structured set of data. +1
from stellar-protocol.
@caiges comments are useful (to me, at least) when you look at the currencies list which is expressed as a (currency code, address) pair. Being able to include a comment that gives a name to that address is useful for me.
That said, I would also prefer a more structured format, such as TOML or YAML.
from stellar-protocol.
@nullstyle I can understand that. I would lean more towards JSON as it's arguably more familiar and more easily consumed (just by an arbitrary survey of standard libs of various languages).
from stellar-protocol.
this is done now. we went with stellar.toml
from stellar-protocol.
Related Issues (20)
- CAP-0054: Add Renounce Ownership Function to Admin Interface HOT 5
- CAP-0052 - provide a way to retrieve the return value of an on-chain contract call HOT 3
- SEP-9: add proof_of_liveness field HOT 1
- Transfer SEPs: add optional `refund_account` attribute to transaction initiation requests HOT 2
- SEPs (6, 12, 24, 31): Update callback header from `X-Stellar-Signature` to `Signature` HOT 4
- SEP-9: define a generalized account identifier format HOT 4
- SEP-9: add `bank_account_type` field HOT 2
- SEP-6: /deposit and /withdraw IDs should map to list of transactions rather than a single transaction HOT 22
- SEP-24: make `account` for deposit request optional to match withdraw request
- Add SEP for Soroban token interface HOT 1
- Nice
- SEP-7: thoughts on using "web+stellar://" instead of "web+stellar:"? HOT 1
- SEP-6: standardize structured off-chain deposit instructions for users HOT 1
- SEP-6: Providing deposit instructions asynchronously
- security HOT 1
- SEP-24: Layered fee structure HOT 1
- SEP-24: Configure fees by payment method HOT 1
- SEP-9: support `organization.referrer`
- Add deviation parameter instead of pure uniform periods HOT 8
- Support for `memo` field in SEP-9 Financial Account Fields
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 stellar-protocol.