GithubHelp home page GithubHelp logo

dojoengine / book Goto Github PK

View Code? Open in Web Editor NEW
33.0 33.0 59.0 30.84 MB

The Dojo Book

Home Page: https://book.dojoengine.org

License: MIT License

Handlebars 23.93% JavaScript 33.16% CSS 35.61% Shell 2.42% Python 4.87%
cairo rust zero-knowledge

book's People

Contributors

9oelm avatar akinbola247 avatar beeinger avatar broody avatar cheelax avatar credence0x avatar cryptonerdcn avatar dpinones avatar edulanasca avatar gianalarcon avatar glihm avatar ivcained avatar kariy avatar libdefi avatar maxgiraldo avatar milancermak avatar mirror-tang avatar nadai2010 avatar notv4l avatar omahs avatar orangeryang avatar ponderingdemocritus avatar rkdud007 avatar robertkodra avatar satyambnsal avatar tarrencev avatar thiscaspar avatar tosinjs avatar tudorpintea999 avatar vietnameserick 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

Watchers

 avatar  avatar  avatar  avatar  avatar

book's Issues

Prepare for 0.2.0

Updates to:

Setup

  • overhaul entirely

Core

  • set! and get!
  • global macro explanations
  • !emit macro for custom world events
  • explicit component keys
  • explain Auth

ERC

  • erc20 / erc721 / erc1155
  • examples for each

Torii

  • torii relay support
  • flesh documentation more

Katana

  • Update to new cli commands

Sozo

  • Update to new cli commands

Deployment

  • Starknet
  • Madara
  • Katana

Packages
Need sections for each

  • @dojoengine/core
  • @dojoengine/react
  • @dojoengine/create-burner

Tutorial

  • Building the dojo-starter + using the dojo-starter-react

Tasks

No tasks being tracked yet.

0.3.0 Overhaul

  • Getting Started
  • Architecture
  • Testing
  • Dojo Modules
  • Onchain chess
  • SDKs
  • Deployment
  • Dojo starters

Torii graphql events and transactions api

Quick note below about new APIs in graphql.

Only events and transactions emitted from your world are indexed.

  • events - We store the key values, data, and txn hash. These events are filterable by keys like entities query. Supports pagination.

  • transactions - we're only storing transaction data for now, transaction receipt can be support in the future. No filtering. Supports pagination.

Update documentation about `sozo auth`

Documentation about sozo auth seems out-dated with v0.3.0 where we're not able to call sozo auth with the name of the contract as stated in the doc.

In this page

sozo auth writer Moves spawn

Where the expected command is:

sozo auth writer Moves <CONTRACT_ADDRESS> --world <WORLD_ADDRESS>

I18n Translate

Hello team, @tarrencev I would like to know if the translations will eventually be added automatically, since I added version 0.2.0, they made changes and the Spanish version was not added, which must be done again.

We have formed a team with @cryptonerdcn and other international translators, who translate starknet book, Cairo book, starknet by example... (we also correct errors in syntax or support new content) and we would like to be organized to start the year with the idea of having everything translated and updating every 15 days in each project.

To do this, we would like to know your opinion and how you are going to handle the translations in dojobook and to know if our initiative would be part of your plans or rewards.

Thanks greetings

First example of system not clear

The first example of a system is in the architecture overview relative to the spawn function.

The text says:

In the spawn function, take note of the second parameter: the IWorldDispatcher interface.
This provides a gateway to the world contract.
By integrating it into the function, it enables the get! and set! macros to interface directly with the world contract.

However the function looks like:

fn spawn(self: @ContractState) {
    // Access the world dispatcher for reading.
    let world = self.world_dispatcher.read();

    // get player address
    let player = get_caller_address();

    // dojo command - get player position
    let position = get!(world, player, (Position));

    // dojo command - set player position
    set!(world, (Position { player, vec: Vec2 { x: 10, y: 10 } }));
}

Is this related to the fact that without using [dojo::contract] the user has to explicitly pass the world dispatcher? Should we update the code example, or modify this text?

Graphql documentation

Should cover but not limited to:

  • explain dynamic schema
  • query structure (components, systems)
  • querying worlds
  • subscribing to worlds
  • brief examples

document impact of the video game on privacy

I fear about privacy when I debug dojo to write documentation.

The issue is that I fear to store infos on the blockchain. If as example, I left my name... it will stay forever on the blockchain.

Could someone provide great lines about privacy on dojo please?

It is mostly for me. I will include these in the doc as well.

Add information about sozo arguments priorities

Sozo is being reworked to have these priorities:

  1. CLI arguments always takes precedence.
  2. Then the environment variables.
  3. Finally, anything found inside the scarb manifest.

We may add a section on that on the book once this PR is merged dojoengine/dojo#1405 to bring better understanding for the user to the possibilities around configurations.

Update Torii reference

Some new torii parameters have been added in 0.3.0 and we need a comprehensive explanation.

Details about enum

Need to add section on using Enums within dojo worlds, specifically around the attributes needed.

#[derive(Serde, Copy, Drop, Introspect)]
enum GameStatus {
    NotStarted: (),
    Lobby: (),
    InProgress: (),
    Finished: (),
}

Add details on Starkli

We should include a section on how to interact with a dojo stack with Starkli

This should include:

  • Working with Katana
  • Working with remote Starknet

Add common errors section

Ideally we wouldn't need this, but might make sense to have one for now. Plus this will help Sensei answer questions if people post the errors.

  • Dojo.js
  • Dojo core
  • Unity

Write ERC1155

Include documentation on how to integrate the standard into a Dojo project

Fix Overview -> Systems page

On Overview -> Systems page, It says that, All Starknet contracts are defined using the #[dojo::contract] decorator

In should instead be: All Starknet contracts are defined using the #[starknet::contract] decorator

use 4 types of documentation?

I want to create chapters so that:

-1 TUTORIAL
-2 HOW TO
-3 API
-4 EXPLAINATION

Seems clearer for me.

Assign me to this issue please. I will start since I will have filled the content of existing chapters.

Katana & StarkNet

Hey, maybe i can help you

Working with Katana
Installation:

Ensure you have Python and Pip installed on your system.
Install Katana using the following command:

pip install katana-eth
Initialize a Project:

Create a new directory for your project and navigate into it.
Run the following command to initialize a Katana project:

katana init
Smart Contract Development:

Write your StarkNet smart contract using Katana's development environment.
Use the following command to compile your contract:

katana compile <contract_file>
Deployment:

Deploy your smart contract to the StarkNet testnet or mainnet using:

katana deploy
Interact with Smart Contract:

Once deployed, interact with your smart contract using Python or any compatible language.
Working with Remote Starknet
Install Starknet SDK:

Install the Starknet SDK on your local machine:

pip install starknet
Set Up Starknet Project:

Create a new directory for your Starknet project and navigate into it.
Run the following command to initialize a Starknet project:

starknet init
Write and Compile Smart Contract:

Write your StarkNet smart contract in the contracts directory.
Compile the smart contract using:

starknet-compile <contract_file>
Deploy Smart Contract:

Deploy the smart contract to the StarkNet testnet or mainnet:

starknet deploy --contract <contract_address>
Interact with Remote Starknet:

Use the Starknet SDK to interact with the deployed smart contract remotely. For example:

from starknet import Starknet

starknet = Starknet()

contract = starknet.contract(address="<contract_address>")

Interact with your contract methods
result = contract.().call()
Remember to replace placeholders like <contract_file>, <contract_address>, and with your actual values.**

Add Entities example

Add example into the Entities section, how to query singular and all entities that have a specific component.

System / Contract separation

In the system page, there is still some location where a system is associated to a contract and this can confuse the user.

Here are some ideas to clarify for the user what system / contract relation is.

  1. What clear in the book, is that a system is a function of a contract, and it needs the world address to operate.
  2. With the dichotomy [starknet::contract] and [dojo::contract], the former is compatible with any starknet contract, and the latter is abstracting the world injection to the user. But both are regular starknet contracts.
  3. The need of having a contract is because this is how starknet works, functions are only defined into a contract.

Proposal:

@@ -1,6 +1,8 @@
-System is a contract
+System is a function in a contract
+
+As you can see a System is like a regular function of a Starknet contract. This contract can include storage, and it can implement interfaces.
-As you can see a System is like a regular Starknet contract. It can include storage, and it can implement interfaces.

 Spawn function
 
-The spawn function is currently the only function that exists in this system. It is called when a player spawns into the world. It is responsible for setting up the player's initial state.
+The spawn function is currently the only system that exists in this contract. It is called when a player spawns into the world. It is responsible for setting up the player's initial state.

Also here in the ECS in 15 mins we may reword.

[translations] Automate translations with actions - Starting with Mandarin

We want to encourage everyone on the planet to experiment with Dojo, so we should translate the book to as many languages as possible.

Dojo is rapidly evolving, and maintaining languages will be a big job.

This could be automated by using an action like - https://github.com/marketplace/actions/openai-continuous-translation-action

This should be combined with how mdbook currently handles translations.

The action should output a file like this:
https://github.com/dojoengine/book/blob/main/po/es.po

Withe GPT-4 32k context this should be achievable.

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.