Git Product home page Git Product logo

dactyl's Introduction

The XRP Ledger

The XRP Ledger is a decentralized cryptographic ledger powered by a network of peer-to-peer nodes. The XRP Ledger uses a novel Byzantine Fault Tolerant consensus algorithm to settle and record transactions in a secure distributed database without a central operator.

XRP

XRP is a public, counterparty-free asset native to the XRP Ledger, and is designed to bridge the many different currencies in use worldwide. XRP is traded on the open-market and is available for anyone to access. The XRP Ledger was created in 2012 with a finite supply of 100 billion units of XRP.

rippled

The server software that powers the XRP Ledger is called rippled and is available in this repository under the permissive ISC open-source license. The rippled server software is written primarily in C++ and runs on a variety of platforms. The rippled server software can run in several modes depending on its configuration.

If you are interested in running an API Server (including a Full History Server) or a Reporting Mode server, take a look at Clio. rippled Reporting Mode is expected to be replaced by Clio.

Build from Source

Key Features of the XRP Ledger

  • Censorship-Resistant Transaction Processing: No single party decides which transactions succeed or fail, and no one can "roll back" a transaction after it completes. As long as those who choose to participate in the network keep it healthy, they can settle transactions in seconds.
  • Fast, Efficient Consensus Algorithm: The XRP Ledger's consensus algorithm settles transactions in 4 to 5 seconds, processing at a throughput of up to 1500 transactions per second. These properties put XRP at least an order of magnitude ahead of other top digital assets.
  • Finite XRP Supply: When the XRP Ledger began, 100 billion XRP were created, and no more XRP will ever be created. The available supply of XRP decreases slowly over time as small amounts are destroyed to pay transaction costs.
  • Responsible Software Governance: A team of full-time, world-class developers at Ripple maintain and continually improve the XRP Ledger's underlying software with contributions from the open-source community. Ripple acts as a steward for the technology and an advocate for its interests, and builds constructive relationships with governments and financial institutions worldwide.
  • Secure, Adaptable Cryptography: The XRP Ledger relies on industry standard digital signature systems like ECDSA (the same scheme used by Bitcoin) but also supports modern, efficient algorithms like Ed25519. The extensible nature of the XRP Ledger's software makes it possible to add and disable algorithms as the state of the art in cryptography advances.
  • Modern Features for Smart Contracts: Features like Escrow, Checks, and Payment Channels support cutting-edge financial applications including the Interledger Protocol. This toolbox of advanced features comes with safety features like a process for amending the network and separate checks against invariant constraints.
  • On-Ledger Decentralized Exchange: In addition to all the features that make XRP useful on its own, the XRP Ledger also has a fully-functional accounting system for tracking and trading obligations denominated in any way users want, and an exchange built into the protocol. The XRP Ledger can settle long, cross-currency payment paths and exchanges of multiple currencies in atomic transactions, bridging gaps of trust with XRP.

Source Code

Here are some good places to start learning the source code:

  • Read the markdown files in the source tree: src/ripple/**/*.md.
  • Read the levelization document to get an idea of the internal dependency graph.
  • In the big picture, the main function constructs an ApplicationImp object, which implements the Application virtual interface. Almost every component in the application takes an Application& parameter in its constructor, typically named app and stored as a member variable app_. This allows most components to depend on any other component.

Repository Contents

Folder Contents
./bin Scripts and data files for Ripple integrators.
./Builds Platform-specific guides for building rippled.
./docs Source documentation files and doxygen config.
./cfg Example configuration files.
./src Source code.

Some of the directories under src are external repositories included using git-subtree. See those directories' README files for more details.

Additional Documentation

See Also

dactyl's People

Contributors

dmwilcox avatar eternalkenshi avatar iroskam avatar jbheron avatar mduo13 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dactyl's Issues

Different (custom?) formulas for auto-html-filename

right now the HTML filename has, like, two possible formulas:

  • match md filename exactly including folders
  • convert / into - (flatten folder structure)

It would be great to add at least one more for using just the leaf filename (omit folders). Maybe other formulas too if any ideas come up.

Link checker should support non-default output directory or targets

Right now the link checker just reads the config file and checks the output directory regardless of what's there. Also, it reports "success" if said directory is empty or doesn't exist, when that case should probably be considered a failure.

It would be nice to support nonstandard output directories, like the -o option of dactyl_build, but -o is already an alias to --offline in the link checker so reusing that parameter would be a breaking change.

Another neat function would be a "virtual" link checker that keeps everything in memory, like the style checker, so you can specify a target to it instead of needing to run dactyl_build first. It would need to do some funny business to try and interpret whether static files would end up in the correct place when written out.

Example CSS for filters that need it

Some of the built-in filters rely on CSS that's not included in this repo. Update the examples/ include the sample css (and maybe have an assets folder?).

Spellchecking

It would be great if Dactyl's style-checker included a spell-checker. The spellchecker should have the ability to modify the standard dictionary.

Option to specify no_cover in config file on per-target basis

Right now if you don't want to use the default cover file for a target, you have to specify the --no_cover option on the commandline every time you build. It should be possible to add a no_cover flag to a target in the config file in case you don't want that target to use the default cover page. There are good reasons you may want to do this (maybe you want to include a special cover page for that target or you want something to appear before the table of contents that's normally provided by the cover page)

Make link substitution a filter and move it to a sub-field

Right now the link substitution behavior is kind of confusing and janky. It should be possible to implement it as a filter so it's not turned on by default.

Also, it would make sense to move the image substitutions to a specific field instead of just looking for top-level fields of page objects that happen to match target names. (The fact that it works as it does is a holdover from before Dactyl had real preprocessing functionality.)

Explore working around Prince's file-path bug on Windows

Prince has a bug that causes links between different files to break when Dactyl builds them:

Normalise input filenames to avoid missing links on Windows. (ref, ref)

As long as that bug is on their roadmap and not done, linking between files in Dactyl-produced PDFs won't work.

However, it might be possible to work around this by changing the current working directory before running Prince so the paths don't have to include any slashes.

Use StrictUndefined

the preprocessor and possibly the template processor should use StrictUndefined so they error out on missing fields.

Except if byass_errors is true of course

Read all pages in a folder

It would be cool to specify a whole folder of files in the config so that Dactyl would read the folder and expand that into a whole list of pages. Ideally you could specify a shell-like pattern, such as *.md, so you only get the files you want.

Maybe a special type of entry in the "pages" array:

  - __dactyl_type: pageset
    md_pattern: api_methods/*.md
    category: API Methods
    targets:
        - api-ref

Restructure build pipeline

The dactyl_build.py source is a mess of functions with too many arguments passed up and down and called in an unclear order.

It would be great to structure some of those types of information into classes and more strictly enforce type-safety for those classes.

Reorganizing the build pipeline would probably be helpful for #48 so that the "first pass" work could get done more effectively.

Explore alternative PDF options

wkhtmltopdf seems like a good open-source option for people who don't want to buy a Prince license. It would be cool if Dactyl could be configured to use that or other HTML-to-PDF tools.

Passive voice detection

You can estimate the number of instances of passive voice by looking for instances of an auxiliary verb (am/are/were/being/is/was/be) followed by a word ending in "ed" or a pre-populated list of irregular past tense words. It's not foolproof, but it's enough to recognize when a sentence is overusing passive voice.

The Style Checker should report the proportion of sentences with passive voice detected in all pages. This can be an "information-only" detail by default. To make it involved in pass/fail, one would add goals for the proportion of detected passive voice instances per sentence. (Ideally the ratio is probably ~10%.) This would probably work similar to the readability scores in the style checker now.

Should report version number without reading config file

if you're in a folder with a broken config file, or missing a custom filter, or something, dactyl_build -v errors out rather than doing what it's supposed to.

It shouldn't need to read the config file to output a version number.

When performing the Elastic indexing of headers, doesn't like headers with dot notation

I'm getting some weird errors from dactyl when trying to build the payment object schema. This is only when trying to publish the doc to the clients site using Jenkins.

I'm thinking dactyl is seeing two heading that start with the same object name, and it's not liking it.
latest error is this:

Previous error was this (different section of the page:

01:21:54 Uploading to ES: PUT https://HOSTNAME/ripplenet_payment_object-v1.1.4-supporting_info_schema/article/payment-object-additional-info.rmtinf.html
01:21:54 ES upload failed with error: '{"error":{"root_cause":[{"type":"mapper_parsing_exception","reason":"Could not dynamically add mapping for field [Amt.DscntApldAmt.Tp.Cd Known Values]. Existing mapping for [subheadings.Amt] must be of type object but found [text]."}],"type":"mapper_parsing_exception","reason":"Could not dynamically add mapping for field [Amt.DscntApldAmt.Tp.Cd Known Values]. Existing mapping for [subheadings.Amt] must be of type object but found [text]."},"status":400}'
01:21:54 Build step 'Execute shell' marked build as failure
01:21:54 Stopping Docker container after build completion
01:21:54 $ ssh-agent -k
01:21:54 unset SSH_AUTH_SOCK;
01:21:54 unset SSH_AGENT_PID;
01:21:54 echo Agent pid 19008 killed;
01:21:54 [ssh-agent] Stopped.

In each of these cases, dactyl hit a header that had previously started with the same word.

Examples of failed builds are in Jenkins
project: clients-doc-push, builds: 846-850
Happens with documents/network-rulebook/payment-object-addl-info/properties/rmtinf.md

There's a barf when dactyl hits the header

##### `LineDtls.Id.Tp.CdOrPrtry` Known Values

AS there is already a header

#### `LineDtls`

in the file that has been indexed

Built-in server

Many similar tools provide a built-in HTTP server so you can test the site locally with minimal setup. Dactyl could probably provide something very similar with Python's built-in simple HTTP server.

Allow multiple content_static_path values

In some cases you may want to source images from multiple static path folders. Dactyl should support supplying an array of paths instead of just one content_static_path—each of the specified folders would get copied into the output folder (if -s is supplied) or the temp folder (for PDF)

Opening files fails on Windows sometimes

Per XRPLF/xrpl-dev-portal#599 it looks like opening files without explicitly specifying the encoding is a problem because Windows defaults to latin-1 instead of utf-8.

Fixing this will require a system where I can reliably reproduce (can dig out a Windows laptop and see how it goes)...

Optional Numbered Headings

For some documents, like the Network Rulebook, we may need to use numbered headings. I believe it's possible to do this by defining counters in the CSS, as exemplified here: https://gist.githubusercontent.com/joshbode/491ad0e678d456ea8ddc/raw/0921dbce72b1602958d4c0cc4b03a30768cd2cd8/numbered_headings.md

However, since we don't want to make that the default behavior, I think we'd want to make that an optional filter.

original jira ticket: https://ripplelabs.atlassian.net/browse/DOC-895

Offline mode

Having suffered through some internet outages lately, I've come to appreciate how useful it would be to have an option that skips any docs that require external contents and does as much as it can offline (rather that waiting for connections to time out even if --bypass_errors is supplied)

Create macro that can be called from within content to pull in child pages

Create a macro that enables us to pull in child pages (child page title link and blurb) that can be called from within a content block.

This will enable us to provide the autogenerated child page content - within a content block that provides a bit of content that includes markdown.

For an example of a page that could benefit from this macros, see https://developers.ripple.com/ledger-object-types.html.

Original jira ticket: https://ripplelabs.atlassian.net/browse/DOC-1564

Proper frontmatter handling

Currently, Dactyl can parse frontmatter in Markdown files, but it does so late enough in the build pipeline that it can't use the metadata from the frontmatter for any useful purpose.

It would be great if you could use frontmatter to define as much as possible about pages, so the config file itself wouldn't have to be so large. This could also improve portability to/from other similar systems like Jekyll.

Pass in vars at runtime

It would be nice to be able to pass in a list or file with arbitrary key-value vars to set on the target at runtime, so you can build better scripts around Dactyl

(This is done in a private branch of Ripple's docs-private repo, so it just needs to be ported and merged in.)

Automatic md link conversion

Similar to how the XREFs filter works, it should be possible to convert valid links between markdown source files into links to their corresponding HTML files.

This would dramatically improve the ease of importing existing (GitHub-compatible) markdown into Dactyl. It might even be a big enough deal that this filter should be enabled by default.

User filters directory

Config should let the user specify one (or more?) user filters directories. Dactyl should load filters from those directories preferentially, falling back upon the filters included in the core Dactyl package.

This way users can write their own filters that don't need to be contributed back to the Dactyl core.

Improved multi-language support

Much of the current multi-locale stuff could probably be automated by making certain assumptions. This would take some investigation to make a proper plan first, especially one that would not be too much migration work, but here are some obvious ones:

  • dactyl_build could compile .po files, if present, by calling Babel automatically
  • Similarly, it could automatically extract {% trans %} strings to update the .pot file and .po files when run. If possible, it would be good to have a notification that new strings need to be translated.

Bigger challenges include:

  • Support multiple languages in a single "target" with separate prefixes based on the language? Or build multiple "targets" (one per language) with a single command?
  • Managing hyperlinks in MD content (including translated content) so that things go to the correct translation when using absolute URLs
  • Maybe impossible, but some kind of assist for managing anchor links in translated content & links to/from untranslated pages.
  • Guidance for managing translation age / updates. Maybe with Transifex? TBD.

Feature request: make .html extension optional on generated files

People have noted that the .html extension on xrpl.org pages gives the impression that we are somewhat behind the times. Other comparable sites don't use such extensions and thus their use may reflect poorly on sites powered by Dactyl.

Here are some of the competitive examples:

Improve handling of missing filters

When a custom filter is not available, Dactyl tries loading it from all the custom filter paths, then falls back to the built-in filter path. Import errors on the last step aren't caught & can't be bypassed, but any case of a missing or inaccurate filter falls through to that case.

This gives a misleading error in a lot of cases and interferes with some other things too.

Split up SCSS for easier derivatives

Dactyl's SCSS file is a monolith when it could be split into multiple smaller, modular files that are included to build the default CSS file.

Similar to Bootstrap's SCSS, Dactyl's files should make careful use of variables, !default statements, and dividing things up by topic. This would make it easier to build a custom SCSS file that leverages some elements of Dactyl's styles and can be updated with minimal effort.

As a bonus, make an NPM package for these so it's easier for other projects to load these files along with the Bootstrap source files.

Code highlighting at build time

Existing Dactyl sites use a JavaScript solution like highlight.js to provide syntax highlighting for code blocks. This runs in the browser, which means more to download and more to run on the client side, on every page view. For everything except API tools, syntax highlighting only has to be done once, at compile time.

The CodeHilite extension, which comes with Python-Markdown, can do this as part of the Markdown-parsing build step.

Then sites just need the appropriate CSS, with option to customize.

Optimize build time

Building a suite of docs can be pretty time-consuming. For example, building the XRPL dev portal takes ~25 seconds on my (relatively high-spec) desktop. There are probably some redundant steps or something that can be done to optimize the build so it runs a bit faster. Maybe some of it can also be parallelized on multi-core CPUs.

It would also be nice to improve the speed of the link checker, which is also probably something that can be parallelized.

Handle Python version limitations more gracefully

Trying to import custom filters on Python 3.4.x and earlier fails in the wrong place because the import logic (see also: #23) tries to use importlib.util.module_from_spec which doesn't exist in versions before 3.5.

Dactyl should (at least) print a proper error/warning if you try to do this and maybe should allow you to skip over the custom filters or implement a v3.4-compatible import for them

Separate local configuration

Certain config options are meant to be local to an individual system, not to a project, but they're all defined in the same config file. This doesn't really make sense for a shared project that stores the config file in version control.

System-local config options should be configurable from a separate file that's stored in a userspace location such as $HOME/.config/dactyl/local.yml or something. Such options include:

  • temporary_files_path
  • prince_executable

Link checker: support absolute paths w/ prefix

By relying on the target.prefix field, the link checker should be able to check at least some absolute links whose start matches the prefix. This would improve link checking in sites with "pretty" URLs, which generally need to use absolute links extensively.

Feature Request: Make images not links in PDFs

Images are currently generated as links in both HTML and PDFs. In the HTML, this is a nice feature because clicking on the image opens the image in a new browser tab. However, hovering over or clicking on the image in the PDF results in a weird experience because the "link" is to the local output file structure. See attached screenshot for an example.

Acceptance Criteria

  • Clicking image in HMTL still opens new tab
  • Image in PDF is non-clickable

Link to original JIRA issue: https://ripplelabs.atlassian.net/browse/DOC-1376

remap config option names for templates

There are 3 types of template fields (6 total) but they're somewhat inconsistent

Field Name Description
default_template The global default HTML template
pdf_template The global default PDF template
target/page. template The per-target/per-page (inherited) HTML template
target/page. pdf_template The per-target/per-page (inherited) PDF template

To be absolutely explicit, default_template and target/page. template would be best renamed html_template. The less dramatic change would be to change default_template to template or change the global pdf_template to default_pdf_template.

Synchronize values passed to preprocessor and templates

For simplicity's sake, the values passed to the templates and the values passed to the preprocessor should be as similar as possible. (There are cases where a field won't be present; for example, the preprocessor won't have the rendered HTML as a field.)

Mostly these are aleady OK but the preprocessor doesn't have access to all the good stuff the templates have, like current_time and so on

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.