Git Product home page Git Product logo

docs's Introduction

Write code for the Internet Computer

You can get started right away by downloading the Internet Computer Software Development Kit (SDK) and cloning an existing sample project or by exploring the documentation. Check out the links below to begin building smart contract canisters to run on the Internet Computer:

  • Get the SDK Download the SDK for the Internet Computer.
  • Quick Start Deploy your first app on the Internet Computer.
  • Examples Repository Explore on your own in the examples repository.
  • Language Guide Explore the Motoko programming language.
  • Videos Watch the Building Applications for the Internet Computer: Fundamentals video series.

Contributing to the documentation

The Internet Computer blockchain is removing the limitations from smart contract software with a network that scales its capacity with demand and serves interactive web content directly to end users. If you are interested in learning more about the project, you can connect with other developers in the community through the Developer Forum and follow us on social media for information about upcoming events and new developments.

If you would like to contribute to the documentation, see our CONTRIBUTING and CODE OF CONDUCT to get started.

Updating the Site Navigation

To update the left-side site navigation, make changes to nav.adoc.

Testing your changes locally

To test your changes locally, clone the [dfinity-docs-playbook] https://github.com/dfinity/dfinity-docs-playbook and follow the installation instructions. Push the changes you want to preview up to a branch on GitHub. You will need to modify the antora-playbook.yml to point to your branch, which will look something like

content:
  sources:
    # Remote repositories and branches
    - url: [email protected]:dfinity/docs.git
      branches: "your-branch-name"

Note: the URL may be different if you are working from a fork

Then, run npm run build to compile the documentation.

You will then need to open the static directory in your browser with a simple static file server to preview your changes.

Note - the root page of the site automatically redirects to https://smartcontracts.org, so you will need to skip past the index to another page. For example, http://127.0.0.1:5500/build/site/docs/quickstart/local-quickstart.html.

docs's People

Contributors

ais-dfn avatar alexabsmith avatar andreacerulli avatar bogwar avatar carstenjacobsen avatar crusso avatar derlerd-dfinity avatar dprats avatar enzoh avatar ericswanson-dfinity avatar eve832 avatar fifteen42 avatar ggreif avatar jancamenisch avatar jensgroth avatar jiangweifeng avatar jwiegley avatar krpeacock avatar lsgunnlsgunn avatar o0x avatar oggy-dfin avatar olaszakos avatar r-birkner avatar robin-kunzler avatar roman-kashitsyn avatar sandianyu avatar sesi200 avatar timohanke avatar yotamhc avatar yvonneanne 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docs's Issues

Motoko - Actor

Walkthrough and edit - please claim in title or issue body.

How to Access dfinity service from my Backend

As is our first use of dfinity and motoko I need to use it as microservice with my own backend so it'll be storage for the sensitive data.

I Searched the whole internet on how can I send request to motoko project but I didn't find anything helpful.

Update the Quick start for the NNS UI for: Add neurons to an existing neuron

Is your feature request related to a problem? Please describe.
New features are being added to the NNS UI application and we want to at least provide basic task information in the Quick start so that users don't have to hunt down random Medium articles or blog posts that are light on instructions or out-of-date.

Incrementing a counter Issues

Describe the bug
This bug report will detail issues found in the Incrementing a counter Rust tutorial

** To Reproduce **

  1. Add a open curly bracket in the dfx.json code block to match the close curly brace:
"build": "cargo build --target wasm32-unknown-unknown --package  rust_counter --release",
"candid": "src/rust_counter/counter.did",
"wasm": "target/wasm32-unknown-unknown/release/rust_counter.wasm",
"type": "custom"
}

Should be:

"rust_counter": {
      "build": "cargo build --target wasm32-unknown-unknown --package  rust_counter --release",
      "candid": "src/rust_counter/counter.did",
      "wasm": "target/wasm32-unknown-unknown/release/rust_counter.wasm",
      "type": "custom"
    }
  1. Step #4 doesn't have a copy widget on the code block
  2. Version bump the second Cargo.toml (within the src directory). Was:
[package]
name = "rust_counter"
version = "0.1.0"
authors = ["DFINITY <[email protected]>"]
edition = "2018"

[lib]
path = "counter.rs"
crate-type = ["cdylib"]

[dependencies]
ic-cdk = { path = "../../../cdk-rs/src/ic-cdk", version = "0.1.0" }
ic-cdk-macros = { path = "../../../cdk-rs/src/ic-cdk-macros", version = "0.1.0" }
ic-types = "0.1.1"
lazy_static = "1.4.0"

should be

[package]
name = "rust_counter"
version = "0.1.0"
authors = ["DFINITY <[email protected]>"]
edition = "2018"

[lib]
path = "counter.rs"
crate-type = ["cdylib"]

[dependencies]
ic-cdk = { path = "../../../cdk-rs/src/ic-cdk", version = "0.2.4" }
ic-cdk-macros = { path = "../../../cdk-rs/src/ic-cdk-macros", version = "0.2.4" }
ic-types = "0.1.1"
lazy_static = "1.4.0"

CLI Reference has an incorrect ceiling `--memory allocation`

Describe the bug
The docs specify the wrong upper limit of the --memory-allocation flag.

To Reproduce
Steps to reproduce the behavior:

Run the code:
dfx canister --network=ic install --all --memory-allocation=16GB --mode=upgrade

Receive the error:
The Replica returned an error: code 5, message: "Canister moi4t-aqaaa-aaaaa-qbbra-cai trapped explicitly: An error happened during the call: 5: MemoryAllocation expected to be in the range [0..8589934592], got 16000000000"`

The docs say:

--memory-allocation <memory-allocation> Specifies how much memory the canister is allowed to use in total. You can set this value in the range of 0 to 256 TB. The default is 8GB.

Expected behavior
The docs should specify the actual ceiling limit for canister memory, not 256 TB.

The CLI should reflect what the ceiling is in the docs.

Additional context
Forum thread here

Bug in Example

I cant seem to find the place to ask this question. I am unable to make a comment in the forum for some reason.
In the docs at #_revise_the_source_code_in_your_program

After changing the code, building and reinstalling I get this type error:

~/Downloads/MOKOTO/location_hello master*
❯ dfx build && dfx canister install favorite_cities -m reinstall
Building canisters...
Installing code for canister favorite_cities, with canister_id cxeji-wacaa-aaaaa-aaaaa-aaaaa-aaaaa-aaaaa-q

~/Downloads/MOKOTO/location_hello master*
❯ dfx canister call favorite_cities location '(vec {"San Francisco";"Paris";"Rome"})'

main.mo

actor {
    public func location(cities : [Text]) : async Text {
        return "Hello, from " # (debug_show cities) # "!";
    };
    public func location_pretty(cities : [Text]) : async Text {
        var str = "Hello from ";
        for (city in cities.vals()) {
                str := str # city #", ";
        };
        return str # "bon voyage!";
    }
};

Also, do I have to rebuild everytime I make a change?

Thank you.

Disregard. I had to change directories and fix the path in dfx.json.

Thank you. Please do tell where I should be posting this and all about rebuilding. Thank you.

0.7.0 release notes

We are starting to collect a pretty big backlog of changes related to the 0.7.0-beta releases. It seems like a good idea to do a "catch-up package" of release notes that we can add to for the launch of 0.7.0 (public "latest").

Edit this page links broken on all docs

Describe the bug
The Edit button on each docs page doesn't work as it links to the /master/ branch instead of /main/.

For example, on the getting-started page, it links to

https://github.com/dfinity/docs/edit/master/modules/quickstart/pages/quickstart-intro.adoc

but should link to

https://github.com/dfinity/docs/edit/main/modules/quickstart/pages/quickstart-intro.adoc

To Reproduce
Steps to reproduce the behavior:

  1. Visit any documentation page.
  2. Press the "edit this page" button
  3. View the 404 error on GitHub.

Expected behavior

  1. Visit any documentation page
  2. Click the "edit this page button"
  3. Get taken to the edit view on GitHub for that page.

Screenshots
grafik

grafik

Desktop (please complete the following information):
N/A

Smartphone (please complete the following information):
N/A

Additional context
I think this can be fixed by changing master to main in the antora.ymlfile, but I was unable to build the docs locally to verify this. The contributing page mentions a page called antora-playbook.yml "in another repository" but doesn't say which. The SDK repository references https://github.com/dfinity-lab/dfinity-docs-playbook but that does not exist (or is private).

Bugs from case sensitive commands / functions

From Zendesk:

  1. Using an actor in the Hello, World! program
    Capital D in Debug created an error. (Resolved when changed to lowercase)
    2: Page: Importing standard library functions
    Capital L and A in List & AssocList created an error (Resolved when changed to lowercase)

Quickstart Guide does not work

The Installation through the quickstart guide (https://sdk.dfinity.org/docs/quickstart/quickstart.html) fails for me.

To make it reproducible here is a Dockerfile that triggers the issue.

FROM ubuntu:18.04
RUN apt update && apt install -y sudo curl
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash - 
RUN apt install -y nodejs
RUN echo y | sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
RUN dfx --version

Simply, docker build . to witness the error.
The installation script says:

Version found: 0.5.4
Creating uninstall script in ~/.cache/dfinity
uninstall path=/root/.cache/dfinity/uninstall.sh
Checking for latest release...
tar: This does not look like a tar archive

gzip: stdin: unexpected end of file
tar: Child returned status 1
tar: Error is not recoverable: exiting now
Will install in: /usr/local/bin
Installed /usr/local/bin/dfx

And dfx --version has no output.

dfx doesn't start

I followed the quickstart guide (https://sdk.dfinity.org/docs/quickstart/quickstart.html). When starting dfx I get the following error.

> dfx start --background
⠁ Starting up the client...
Apr 02 16:12:46.759 INFO Dfinity Replica Started
Apr 02 16:12:46.759 INFO Existing node ID: 15441190334538835598
thread 'main' panicked at 'Could not rename temporary file for port report: Os { code: 18, kind: Other, message: "Invalid cross-device link" }', src/libcore/result.rs:1165:5
⠠ Replica exited with exit code: 101

Hello, World! Rust CDK Quick Start Issues

Describe the bug
This bug report will detail issues found in the Hello, World! Rust CDK Quick Start

To Reproduce

  1. ls -l cdk_rs/src returns ls: cdk_rs/src: No such file or directory ; instead it should be ls -l cdk-rs/src which the expected. ✅
  2. To modify the Cargo.toml configuration file should say To modify (or create) the Cargo.toml configuration file since folks using Dfx will need to create one ✅
  3. Use the [workspace] key to specify the source file directories for your program.
    [workspace] should be a code block (since previous keys were in code blocks): [workspace]

  4. Version bump the second Cargo.toml (within the src directory). Was:
[package]
name = "rust_hello"
version = "0.1.0"
authors = ["Your Name <[email protected]>"]
edition = "2018"

[lib]
path = "main.rs"
crate-type = ["cdylib"]

[dependencies]
ic-cdk = { path = "../../../cdk-rs/src/ic-cdk", version = "0.1.0" }
ic-cdk-macros = { path = "../../../cdk-rs/src/ic-cdk-macros", version = "0.1.0" }

should be:

[package]
name = "rust_hello"
version = "0.1.0"
authors = ["Your Name <[email protected]>"]
edition = "2018"

[lib]
path = "main.rs"
crate-type = ["cdylib"]

[dependencies]
ic-cdk = { path = "../../../cdk-rs/src/ic-cdk", version = "0.2.4" }
ic-cdk-macros = { path = "../../../cdk-rs/src/ic-cdk-macros", version = "0.2.4" }

New Additions

  1. Users need to install the ic-cdk-optimizer in order to ensure that their rust code is sufficiently small for uploading as a canister: cargo install ic-cdk-optimizer
  2. Users need to make a release directory within their rust_hello directory: mkdir -p target/wasm32-unknown-unknown/release/
  3. Users need to optimize their code. From the rust_hello directory: ic-cdk-optimizer target/wasm32-unknown-unknown/debug/rust_hello.wasm -o target/wasm32-unknown-unknown/release/rust_hello-opt.wasm
  4. Users need to update their dfx.json to point to the optimized wasm in the canisters.rust_hello.wasm key: "wasm": "target/wasm32-unknown-unknown/release/rust_hello-opt.wasm"

Add `dfx start --clean` to Troubleshooting

From Tungsten Hackathon:

"dfx start" fails with this error:"Internet Computer replica started... \n thread 'main' panicked at 'State at height 86987 had disappeared before we had a chance to make a CUP. This should not happen.', consensus/src/catchup_package_maker.rs:111:17 \n Replica exited with signal: 6" The command "dfx start --clean" fixes it. maybe we should suggest that instead.

Incorrect boilerplate in "Explore the default project"

The tutorial named Explore the default project says that there will be a "src" folder in explore_hello_assets with two files. When I generate a new project with dfx new , the folder is named "public" instead and does not contain any HTML, only this index.js

import explore_hello from 'ic:canisters/explore_hello';

explore_hello.greet(window.prompt("Enter your name:")).then(greeting => {
  window.alert(greeting);
});

Using dfx 0.6.26.

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.