Coder Social home page Coder Social logo

Comments (8)

irisli avatar irisli commented on July 20, 2024

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.

irisli avatar irisli commented on July 20, 2024

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.

nullstyle avatar nullstyle commented on July 20, 2024

TOML 👍

from stellar-protocol.

bartekn avatar bartekn commented on July 20, 2024

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.

caiges avatar caiges commented on July 20, 2024

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.

nullstyle avatar nullstyle commented on July 20, 2024

@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.

caiges avatar caiges commented on July 20, 2024

@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.

jedmccaleb avatar jedmccaleb commented on July 20, 2024

this is done now. we went with stellar.toml

from stellar-protocol.

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.