Coder Social home page Coder Social logo

soroban-docs's Introduction

[Deprecated] Soroban Documentation and API Reference

Soroban Documentation has been consolidated into Stellar Developer Documentations.

To read the Stellar Developer Docs: https://developers.stellar.org/ To contribute or open issues in the Stellar Developer Docs: https://github.com/stellar/stellar-docs

Please do not open issues in this repo as it is no longer actively maintained.


Welcome to the official home repository for Documentation and API Reference for the Soroban smart contracts platform.

Table of Contents

Contributing

Contributions are more than welcome! Thank you! ๐ŸŽ‰

Before diving in, please read our Stellar Contribution Guide for details on contributing to Stellar's various repositories. Please take special note of the code of conduct.

Our documentation site is built using Docusaurus. The content is written in MDX, which adds a lot of cool possibilities. Even if you're unfamiliar with plain markdown, do not fear! You can still contribute in a helpful and meaningful way. markdown is super easy to learn, and will come quite naturally after only a bit of practice. You can always help fix typos, spelling, and broken links, too.

Quick Start

To begin development on the documentation, you will first need yarn installed on your system. Once it is, you can run the following commands:

git clone https://github.com/stellar/soroban-docs
cd soroban-docs
yarn install
yarn start

This will begin the development server, and open a browser window/tab pointing to http://localhost:3000/docs/. This development server will auto-reload when it detects changes to the repository.

After you've made your changes, please use prettier to ensure consistent formatting throughout the repository:

yarn check:mdx # this will search for problems in the MDX files
yarn format:mdx # this will fix any problems that were found

Repository Structure

  • /docs/ Contains all the documentation content. If you're contributing to the actual documentation, rather than site functionality, this is likely where you will want to be.
    • /docs/<subdirectory>/ Each subdirectory inside the docs directory contains content documents relating to a common idea (tutorials, or technical reference for example). There can also be subdirectories nested even further, which will follow the same rules. The location of a document within this directory structure will have a direct impact on the URL given to the document on the site (unless there is metadata or front matter that overrides these defaults.)
    • /docs/<subdirectory>/_category_.json This file contains information that determines the directory's location and position within the site's sidebar.
    • /docs/<subdirectory>/<filename>.mdx The actual documents live in these files (written in markdown), and also contains "front matter" which can specify configuration parameter for the document's display, URL, etc. All filenames must use dashes for spaces instead of spaces or underscores
  • /api/ Contains the pages documenting the methods available through the Soroban RPC service. The top-level files here are pretty bog-standard markdown files. However, the documentation for each of the available methods is generated from an OpenRPC specification file. This file should not be edited by hand! It's generated from a subset of schema documents. If you find a problem with the specification document, please create an issue and we can take care of it as quickly as we can.
  • /dapps/ Contains the pages for the Dapps Challenge set of exercises and tutorials, as well as other information on tools and techniques for building Dapps using Soroban. Many of these pages rely on several custom React components.
  • /src/ Contains non-documentation files like custom React components and styling.
  • /static/ Contains static assets. Anything in this directory will be copied to the root of the final build directory.
  • /nginx/ Contains configuration used to deploy and host the docs site. Unless you're part of Stellar's IT Ops team, you probably don't need to do anything with this. Exception:
    • /nginx/includes/redirects.conf Contains redirect rules to avoid broken links. If you find a broken link somewhere out in the wilds of the internet, and there's no way for it to be changed, a redirect could be a useful tool. (Note our aim isn't to completely avoid 404 pages for a user. That would be impossible and impractical. These redirects are evaluated on a case-by-case basis, and it may be determined that a redirect isn't the right approach in some instances.)

Markdown Basics

If you're unfamiliar with markdown, there are loads of good tutorials and cheat sheets out there. Check out some of these resources to get a handle on the basics:

soroban-docs's People

Contributors

2opremio avatar achallagundla avatar anupsdf avatar briwylde08 avatar chadoh avatar christian-rogobete avatar desmodrone avatar dmkozh avatar elizabethengelman avatar elliotfriend avatar graydon avatar janewang avatar jayz22 avatar jcx120 avatar jonjove avatar julian-dev28 avatar kalepail avatar leighmcculloch avatar namankumar avatar overcat avatar paulbellamy avatar piyalbasu avatar rice2000 avatar shaptic avatar sisuresh avatar sreuland avatar stellarsaur avatar tamirms avatar tomerweller avatar tsachiherman 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

Watchers

 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

soroban-docs's Issues

DOCS: add accountID info on https://soroban.stellar.org/docs/learn/built-in-types#account-id-accountid

What version are you using?

https://soroban.stellar.org/docs/learn/built-in-types#account-id-accountid
Last updated on Nov 2, 2022

What did you do?

scroll down to Account ID section

What did you expect to see?

Most of the time contracts should use the Address type, which is an

maybe

account ID (AccountId) or a contract ID (BytesN<32>).

or maybe

enum custom type

What did you see instead?

Most of the time contracts should use the Address type, which is a

and then nothing

Refresh the Welcome page

The current content is based on the preview releases before we had soroban-sli, soroban-rpc and futurenet

404 link to token spec interface

There's an invalid link on this page: https://soroban.stellar.org/docs/how-to-guides/stellar-asset-contract#contract-interface In the last paragraph, the link to the SDK points to where the soroban-token-spec used to live. I know they're moving it around some, I'm just not sure the right place to link to at the moment.

What version are you using?

The current version that's live on soroban.stellar.org

What did you do?

Clicked the link behind the word SDK the link is pointing to https://github.com/stellar/rs-soroban-sdk/blob/main/soroban-token-spec/src/lib.rs, but that file no longer exists.

What did you expect to see?

The source code for the asset contract.

What did you see instead?

A 404 page.

Create a resource that describes the Soroban<>Stellar relationship

The Stellar<>Soroban interop is currently described in out-of-date CAPs and in the code. We need a resource that gathers all this information. Some topics:

  • Interop scope: wrapped assets and shared accounts
  • Interop out-of-scope: DEX/AMMs/etc
  • FAQ: where should I issue my assets? what should wallets default to? etc.

add more docs on how to call the online smart contract

What problem does your feature solve?

I am researching how to use soroban to develop a DAPP and want to call the smart contract which is deployed to the test network with the SDKs or the api.

What would you like to see?

I want to use js sdk to call the smart contract which is deployed to the test network

What alternatives are there?

Page not found error

What did you do?

  1. Go to https://soroban.stellar.org/docs/examples/token
  2. Click on the built-in token contract link.

What did you expect to see?

This page - https://soroban.stellar.org/docs/built-in-contracts/token-contract

What did you see instead?

Page Not Found. The link is incorrect - https://soroban.stellar.org/docs/examples/built-in-contracts/token-contract (notice the examples in the path).

Additional info

The weird thing is that I don't see this issue when I run the docs locally with yarn.

I can also avoid this error by following these steps

  1. Go to https://soroban.stellar.org/docs/
  2. Click on Examples -> Token -> built-in token contract

Dev deployment of docs tracking dev branch for pre-release docs preparation

Could we have a second deployment of the Soroban docs off a dev branch that we merge to main at next release? It'd allow us to contribute to the docs now without them being released, and a deployment will mean we can see the rendered version somewhere.

One of the take aways from the last retro was the ask that we contribute to docs during the iteration instead of just at the end. We're making breaking changes to many things, and so we can't update the docs and push to main otherwise the docs will be out of sync with the version available to contract developers.

Change target directory in soroban-examples

There has been a recent changes in soroban-examples where target directory is now part of each example's directory instead of being at the top level directory. Our docs need to be updated to refer to target/wasm32-unknown-unknown/... instead of ../target/wasm32-unknown-unknown/.. in the examples.

Convo ref

Token: Add docs that point to example contracts that use the token example, and describe how the interface works.

Users are getting stuck trying to create a token contract and using it. We should point to an example contract like the liquidity pool that not only uses existing token contract instances, but also creates one for the pool share token.

We should also describe how the interface works. Some users are not familiar with EIP-20 and I've seen users trying to call xfer_from without calling incr_allow first.

Docs: SDK developer orientation

While SDF is focusing efforts on Rust, some other teams are interested in building fr other toolchains. In the absence of a more complete spec, we should at least give some pointers as to how one would approach developing a non-rust sdk.

Add information to liquidity pool example explaining why contract expects funds already sent

What problem does your feature solve?

I have seen several people ask about why the liquidity pool expects users to send the funds outside of the contract operations. Clearly this is not obvious, so the documentation should explain it to reduce future confusion.

What would you like to see?

Add information explaining the merits of this design.

What alternatives are there?

N/A

Docs 0.6.0 Cargo.toml

Version

soroban 0.6.0
soroban-env 0.0.14

What did you do?

In the documentation under "Create a New Project" the documentation specifies:

[package]
name = "project-name"
version = "0.1.0"
edition = "2021"

Where edition is = 2021. Yet, a few lnes below in "Wrapping it up" it shows edition = "2022". This will prompt the following error when building a contract:

failed to parse manifest at ../[project-name]/Cargo.toml

Caused by:
  failed to parse the `edition` key

Caused by:
  this version of Cargo is older than the `2022` edition, and only supports `2015`, `2018`, and `2021` editions.

Generated category pages contain broken markdown links

What version are you using?

n/a

What did you do?

View https://soroban.stellar.org/docs/category/getting-started

What did you expect to see?

Regular text.

What did you see instead?

Unrendered markdown links:

๐Ÿ“„๏ธ Setup
Soroban contracts are small programs written in the [Rust] programming language.

๐Ÿ“„๏ธ 1. Hello World
Once you've [Setup] your development environment, you're ready to create your first Soroban contract.

๐Ÿ“„๏ธ 2. Storing Data
The [increment example] demonstrates how to write a simple contract that stores data, with a single function that increments an internal counter and returns the value.

๐Ÿ“„๏ธ 3. Deploy to a Local Network
If you have Docker installed, you can run a local standalone network with the [Stellar Quickstart] Docker image.

๐Ÿ“„๏ธ 4. Connect Freighter Wallet
Signing Transactions with Freighter

๐Ÿ“„๏ธ 5. Deploy to Futurenet
If you have Docker installed, you can run a local node with the [Stellar Quickstart] Docker image that joins the [Futurenet] network, 

These text snippets appear to be automatically pulled from their respective pages, but the markdown has not been interpreted.

This looks pretty bad, and is on pages that are immediately encountered by devs.

I poked at docusaurus but don't understand it well enough to fix.

Create a "Running Soroban RPC" how-to

In which we:

  1. explain what soroban-rpc is
  2. requirements for running soroban-rpc
  3. describe how to use quickstart to run a futurenet soroban-rpc instance
  4. link to ecosystem instances and service providers (maybe later on?)

incorrect setup instruction

What version are you using?

Preview 8

What did you do?

Iโ€™ve been following this guide to install soroban on an instance and I get an error ( see below )

What did you expect to see?

No error

What did you see instead?

  CARGO_CFG_TARGET_FEATURE = Some("fxsr,sse,sse2")
  running: "c++" "-O3" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-Wall" "-Wextra" "-o" "/tmp/cargo-installjjndAn/release/build/link-cplusplus-8d2b77841a7ece7d/out/f2184eeae4f5b2e3-dummy.o" "-c" "/tmp/cargo-installjjndAn/release/build/link-cplusplus-8d2b77841a7ece7d/out/dummy.cc"

  --- stderr


  error occurred: Failed to find tool. Is `c++` installed?


warning: build failed, waiting for other jobs to finish...
error: failed to compile `soroban-cli v0.7.0`, intermediate artifacts can be found at `/tmp/cargo-installjjndAn

Add Soroban-RPC API docs

What problem does your feature solve?

Currently the soroban rpc jsonrpc API docs are at https://docs.google.com/document/d/1TZUDgo_3zPz7TiPMMHVW_mtogjLyPL0plvzGMsxSz6A/edit

It was initially put there for open feedback and discussion. But that has tapered off and is now being spammed.
It's hard to find, and hard to read.

What would you like to see?

Let's manually write a markdown format of these docs in /api here in this repo for now, so people can find them, and they are integrated with our other soroban docs.

What alternatives are there?

We looked at using openrpc spec to autogenerate docs, but the docusaurus integration is gnarly (#127)

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.