dojoengine / book Goto Github PK
View Code? Open in Web Editor NEWThe Dojo Book
Home Page: https://book.dojoengine.org
License: MIT License
The Dojo Book
Home Page: https://book.dojoengine.org
License: MIT License
Updates to:
Setup
Core
ERC
Torii
Katana
Sozo
Deployment
Packages
Need sections for each
Tutorial
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.
The Testing section of the documentation as well Systems section are not up to date, I'd like to work on it.
Here are the links to the sections that needs update: https://github.com/dojoengine/book/blob/main/src/cairo/testing.md#writing-integration-tests
https://github.com/dojoengine/book/blob/main/src/cairo/systems.md
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>
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
In the Custom Event page, there is several occurrences to components, which are now models since last dojo version.
Current situtation
Hello-dojo section shows dojo-starter v0.3.0-rc8
Solution
Update Hello-dojo tutorial to shows dojo-starter v0.3.0
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?
Since this PR dojoengine/dojo@09115ef
model_names
has been removed from the Graphql schema
Should cover but not limited to:
Following this PR dojoengine/dojo#1215
We have to update the Update graphql queries
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.
Sozo is being reworked to have these priorities:
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.
Migrate VI from 0.2.0 to 0.3.0
Some new torii parameters have been added in 0.3.0 and we need a comprehensive explanation.
Add instructions for deploying to remote Starknet.
Add content here Starknet
Dojo systems can be called via a library call function, so they can effectively be computed read.
Torii section is too brief right now, we need to add the following:
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: (),
}
We should include a section on how to interact with a dojo stack with Starkli
This should include:
We need to explain try_get
in the context of commands and where it is useful
Update dojo-chess content
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.
Include documentation on how to integrate the standard into a Dojo project
Migrate translation from 0.2.0 to 0.3.0
We need an explanation within the torii section on how grpc works along with an example.
Include documentation on how to integrate the standard into a Dojo project
Migrate translation from 0.2.0 to 0.3.0
In the model page there is a SerdeLen
that could be removed, or should we keep this for backward reference?
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
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.
Migrate JA from 0.2.0 to 0.3.0
Migrate KO from 0.2.0 to 0.3.0
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 example into the Entities section, how to query singular and all entities that have a specific component.
In the Events new format the event declaration does not compile with new cairo version.
@@ -1,5 +1,6 @@
#[event]
#[derive(Copy, Drop, starknet::Event)]
enum Event {
- DeckCreated(DeckCreated)
+ DeckCreated: DeckCreated,
}
The output of the get!
command in the https://github.com/dojoengine/book/blob/main/src/cairo/hello-dojo.md file is supposed to be a Position
component and not a Moves
component.
A fix PR will be sent immediately.
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.
a system is a function
of a contract, and it needs the world address to operate.[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.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.
Add instructions for deploying to remote katana
Add content here Remote katana
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.