Giter Club home page Giter Club logo

docs's Introduction





NEAR Protocol - scalable and usable blockchain

Discord CI

This is the repository for the official documentation of NEAR Protocol, a user-friendly and carbon-neutral blockchain, built from the ground up to be performant, secure, and infinitely scalable.

Quick start

Check out the following links

Contributing

NEAR uses Docusaurus for documentation. Please refer to their documentation for details on major structural contributions to the documentation.

For simple content changes you have 2 options

The instant PR

This is the fastest way to submit content changes directly from the page where you notice a mistake.

  1. Open any page in the docs on https://docs.near.org
  2. Click the [ Edit ] button at the top right hand side of every content page
  3. Make your edits to the document that opens in GitHub by clicking the โœŽ (pencil) icon
  4. Submit a PR with your changes and comments for context

The typical PR

This is the standard fork-branch-commit workflow for submitting pull requests to open source repositories

  1. Fork this repo to your own GitHub account (or just clone it directly if you are currently a member of NEAR)

  2. Open your editor to the top level repo folder to view the directory structure as seen below

  3. Move into the /website folder where you will run the following commands:

    • Make sure all the dependencies for the website are installed:

      # Install dependencies
      yarn
    • Run the local docs development server

      # Start the site
      yarn start

      Expected Output

      # Website with live reload is started
      LiveReload server started on port 35729
      Docusaurus server started on port 3000

      The website for docs will open your browser locally to port 3000

  4. Make changes to the docs

  5. Observe those changes reflected in the local docs

  6. Submit a pull request with your changes - Please check for broken links before opening PR ๐Ÿ™

Directory Structure

Your project file structure should look something like this with a few key files and folders highlighted

โ”œโ”€โ”€ CODE_OF_CONDUCT.md
โ”œโ”€โ”€ CONTRIBUTING.md
โ”œโ”€โ”€ LICENSE-APACHE.txt
โ”œโ”€โ”€ LICENSE-MIT.txt
โ”œโ”€โ”€ README.md             <-- the document you are reading right now
โ”œโ”€โ”€ docs                  <-- all the content for the site is in this folder as markdown files
โ””โ”€โ”€ website
    โ”œโ”€โ”€ build
    โ”œโ”€โ”€ core
    โ”œโ”€โ”€ i18n
    โ”œโ”€โ”€ package.json
    โ”œโ”€โ”€ pages
    โ”œโ”€โ”€ sidebars.js     <-- rarely used for changing left-hand-side page navigation
    โ”œโ”€โ”€ docusaurus.config.js     <-- rarely used for general site configuration (including header links)
    โ”œโ”€โ”€ static
    โ””โ”€โ”€ test-links.sh     <-- always used to test links before submitting changes

Found a broken link?

For broken links internal to the docs, please submit an issue or PR request as per above.

If you found a broken link from a Google search, please request to remove it from their index here: https://www.google.com/webmasters/tools/removals

Check for broken links

Before opening a pull request, please check for broken links:

yarn test

or id you are in the ./website directory:

yarn full-test

docs's People

Contributors

ailisp avatar amgando avatar anaisurlichs avatar behaviary avatar benkurrek avatar bowenwang1996 avatar bucanero avatar chadoh avatar ckshei avatar dependabot[bot] avatar doriancrutcher avatar eriktrautman avatar flmel avatar frankbraun avatar frol avatar gagdiez avatar garikbesson avatar idea404 avatar ilblackdragon avatar janedegtiareva avatar janewang avatar khorolets avatar matiasbenary avatar maxhr avatar mikedotexe avatar nikurt avatar nxsyed avatar thisisjoshford avatar vgrichina avatar volovyks 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  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

docs's Issues

Place game tutorial quickstart broken

After clicking on the Near Studio quickstart link at the beginning of the Place game tutorial, I am brought to Near Studio. When I click "run" I get the following error:

[error]: Task build failed: Invalid code point 6695714

[BUG] Contribution guideline is hard to find

Describe the bug
Contribution guideline ideally should be at the most prominent place.
Right now it's under "Community" > "Contribution Guidelines" > "Nearcore"
Specifically, we need the section about development in staging (and that it's the active branch) be very visible to everyone.
But also I always use Operations section for my copy&paste

Open external links in new tab

Clicking any link not within docs.nearprotocol.com should automatically open in a new tab to avoid ejecting the user annoyingly from the docs.

Examples for nearlib

Is your feature request related to a problem? Please describe.
Currently nearlib doesn't have any textual description or examples how to use it

Describe the solution you'd like
We need to have brief details about nearlib and then few examples on how to use nearlb

[DOC] Usage examples for nearlib

Is your feature request related to a problem? Please describe.
The goal is to make it easy for people to integrate into wallets / backend applications.

Current nearlib README (https://github.com/nearprotocol/nearlib) doesn't contain any examples of usage or links to such examples.

Same true about docs: we have "FRONTEND API (NEARLIB)" with a huge list of API items, but nothing how to use it.

Describe the solution you'd like
For this, we need a page with details how to use nearlib to create key pairs, create transactions, sign a transaction and send it to the network.

Additional context
Examples:

Tutorials

Herd developers to write tutorials. Goal to have at least 3 meaningful tutorials with one clear super tutorial.

Place game tutorial error

I'm following along with the "place" game tutorial. When I get to the second paragraph of step 3 I'm instructed to run the tests. Doing so results in the following errors:

[info]: Task build is running...
ERROR TS2304: Cannot find name 'globalStorage'.

   globalStorage.setItem(coords, value);
   ~~~~~~~~~~~~~
 in main.ts(4,2)


ERROR TS2304: Cannot find name 'globalStorage'.

   return globalStorage.getItem(coords);
          ~~~~~~~~~~~~~
 in main.ts(8,9)


WARNING AS102: User-defined: "Calling 'memory.allocate' requires a memory manager to be present."

     WARNING("Calling 'memory.allocate' requires a memory manager to be present.");
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 in ~lib/memory.ts(42,4)


WARNING AS102: User-defined: "Calling 'memory.allocate' requires a memory manager to be present."

     WARNING("Calling 'memory.allocate' requires a memory manager to be present.");
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 in ~lib/memory.ts(42,4)


ERROR TS2304: Cannot find name 'globalStorage'.

       let cellEntry = globalStorage.getItem(near.str(row) + "," + near.str(col));
                       ~~~~~~~~~~~~~
 in main.ts(19,22)


ERROR AS200: Conversion from type 'i32' to 'String' requires an explicit cast.

       arrResult[i] = cellEntry;
                      ~~~~~~~~~
 in main.ts(20,21)


WARNING AS102: User-defined: "Calling 'memory.free' requires a memory manager to be present."

     WARNING("Calling 'memory.free' requires a memory manager to be present.");
     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 in ~lib/memory.ts(48,4)


[error]: Task build failed: Compile error

[DOC] blockchain primitives primer

Is your feature request related to a problem? Please describe.
We don't seem to have anything that surfaces and contextualizes nearcore primitives like block and chunk.

Describe the solution you'd like
The nearcore source files are well commented but a primer would likely include a few links out to resources for understanding Merkle trees, Public Key Cryptography and other common knowledge among crypto enthusiasts.

Additional context
Here's an example of a clear, concise intro to Merkle Trees including basic mechanisms of use and justification for the technology

https://media.consensys.net/ever-wonder-how-merkle-trees-work-c2f8b7100ed3

[DOC] Add minimal version of node for near-shell

Is your feature request related to a problem? Please describe.
People have older version of node and our tools don't work. Errors are also not clear.

Describe the solution you'd like
Have version of node required (at least 12) on all the pages that mention near-shell

[BUG] Documentation for boardcast_tx_commit RPC

Describe the bug
Currently it says "Send Transaction (In development)" https://docs.nearprotocol.com/docs/interaction/rpc#send-transaction-in-development which is not true as we actually using this RPC for most of nearlib.

Expected behavior
Title: Send Transaction (wait until done)

RPC:

http post http://127.0.0.1:3030/ jsonrpc=2.0 method=broadcast_tx_commit params:="[<base 58 of the SignedTransaction>]" id="dontcare"

Result:

{"jsonrpc":"2.0","result":{"status":"Completed","transactions":[{"hash":"GLTdMcUAVT5DB6YEWABcMgASFuPGFMCbQkC8TcvZdby3","result":{"logs":[],"receipts":["8YrftHfvmDA4EAwf6BZe3d5TQd51joJW3JHpoj4iAUBF"],"result":null,"status":"Completed"}},{"hash":"8YrftHfvmDA4EAwf6BZe3d5TQd51joJW3JHpoj4iAUBF","result":{"logs":[],"receipts":[],"result":"","status":"Completed"}}]},"id":133}

[BUG] Structure for validators doesn't make sense

Describe the bug & expected behaviour
Currently there when I click "Become a validator" I expect to have a full materials from how to start node locally, on Google or whatever cloud, how to create account and how to stake.

Instead there are few links to other docs which doesn't seem like people see and follow.

Finding "Running a node" under "Local Setup" is unexpected.
"Running a node on Windows" goes before "Running a node" in the list is also strange.

In "Running a node" the section for Google cloud is at the end. May be worth separating it into separate section which then links to the running node https://docs.nearprotocol.com/docs/local-setup/running-testnet#running-official-testnet-node-with-docker section for actually how to start.

[BUG] _contract_.contractpromise.md has missing contract name in `.then` API examples

Describe the bug
docs/runtime-ts/classes/_contract_.contractpromise.md (is it auto-generated?) features .then() usage with a wrong number of arguments (the first argument must be contract name).

  let callbackPromise = promise.then(
     "_onItemAdded",
     requestArgs.encode(),
     2,  // Attaching 2 additional requests, in case we need to do another call
  );

The comment about the number 2 is completely misleading. It is a gas amount and it should be a much greater number, e.g. 100000.

Expected behavior
The example should work out of the box.

  let callbackPromise = promise.then(
     context.contractName,
     "_onItemAdded",
     requestArgs.encode().serialize(),
     100000
  );

๐Ÿ“ Location
https://docs.nearprotocol.com/docs/runtime-ts/classes/_contract_.contractpromise.html

BTW, the link from the navigation menu is broken (does not include .html)!

Collections need better documentation

Currently documentation for collections is auto-generated and hard to read. We need better documentation and more examples explaining how they work.

RPC documentation outdated

Start a local node with myaccount account as a validator.
Issue a transaction:

http post http://127.0.0.1:3030/ jsonrpc=2.0 method=query params:="[\"account/myaccount\",[]]" id="dontcare"

Observe error message:

HTTP/1.1 200 OK
content-length: 156
content-type: application/json
date: Fri, 26 Jul 2019 18:39:40 GMT

{
    "error": {
        "code": -32602,
        "data": "Failed parsing args: invalid type: sequence, expected a string",
        "message": "Invalid params"
    },
    "id": "dontcare",
    "jsonrpc": "2.0"
}

Rename File structure to something more informative

Is your feature request related to a problem? Please describe.
The most important and valuable document in all the docs is named "File Structure"

Describe the solution you'd like
It should be named Overview or something

documentation structure

Is your feature request related to a problem? Please describe.
the current structure (the outline / table of contents) of our documentation isn't intuitive and doesn't seem to follow the typical flow

Describe the solution you'd like
by comparing several options we can pick / generate a better structure and reorganize the docs to match it

Additional context
here are a few examples of well structured docs

thoughts? @AnaisUrlichs and @potatodepaulo

npm test with local node fails

I tried to run npm test in a freshly build new project (running locally), the test fails and throws the following error:

[unknown contract]: Runtime error: Account alice.near tries to create new account with 1000000000000, but only has 0

[DOC] FAQ section

Is your feature request related to a problem? Please describe.

Many people are asking the same questions on Discord over and over. This is a waste of valuable time, especially when we've answered this Q somewhere else.

Describe the solution you'd like

  1. A FAQ section that clearly answers the most basic questions
    a) We need to compile these.
  2. Links to S.O. in the docs and FAQ

[DOC] Update "Local Development on Local Node"

Is your feature request related to a problem? Please describe.
The problem is that this document is out of date: https://docs.nearprotocol.com/docs/local-setup/local-dev-node

Describe the solution you'd like
This page should be titled "Local Development on Local Network" and needs a small re-write.

It should show peeps how to spin up a "local network", not a "local node". The difference in practice is simple as running "start_localnet" with an "acccounts.csv" inside of the ~/.near folder. The technical difference is that the "start_testnet" syncs with our public testnet and the former creates an entirely separate network. The separate network is more stable since it doesn't sync our breaking changes

Additional context
Important Definitions

  • Public Testnet - The network that we maintain and run nodes for of the most up to date master branch of nearcore
  • Local Testnet - The same thing as running a "Local Node"
  • Local Node - Running the nearcore code on your system in a way that it syncs to the Public Testnet
  • Local Network - Any branch pulled from nearcore (including staging, commit hash, or a feature branch) that starts without synching to the "Public Testnet." Two benefits are: 1) More stability because you can freeze a version 2) You can define genesis yourself for all sorts of shenanigans

Screen Shot 2019-11-11 at 1 44 31 PM

RPC documentation

Documenting RPC (probably should finalize it first based on feedback from libs)

add highlights / callouts

Is your feature request related to a problem? Please describe.
sometimes there are important statements we want to call out inline in our docs (ie. some aspect of our API is under heavy development or something is a recent addition to the API)

Describe the solution you'd like
a highlighted blockquote is always a good idea. it doesn't seem like Docusaurus supports this natively like MkDocs does with admonitions but we should be able to replicate this functionality with some custom markdown parsing if a simpler solution isn't found

Additional context
see this MkDocs explainer for more context about the desired feature


thoughts? @AnaisUrlichs and @potatodepaulo

[DOC] Accounts and Keys Page

Is your feature request related to a problem? Please describe.
I don't know how accounts work!

Describe the solution you'd like
I want a page where I can read about em

[BUG] core dump instructions don't work on mac

Running a node doc page:
core dump instructions don't work on mac
(To enable coredump for docker, do echo '/tmp/core.%t.%e.%p' | sudo tee /proc/sys/kernel/core_pattern to modify system coredump location to /tmp.)

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.