Skip to content

Commit

Permalink
Merge pull request #146 from dojoengine/torii-client
Browse files Browse the repository at this point in the history
Torii client
  • Loading branch information
ponderingdemocritus authored Dec 11, 2023
2 parents 0585813 + 2a25d0e commit c168b98
Show file tree
Hide file tree
Showing 7 changed files with 54 additions and 21 deletions.
2 changes: 2 additions & 0 deletions src/cairo/world.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
> **To think about:** Consider Autonomous Worlds as sovereign blockchains residing within another blockchain - a nested blockchain, so to speak. Just as you can deploy contracts onto Ethereum to enhance its functionality, you can similarly introduce systems into the World contract to enrich its features. While anyone can contribute to the World, akin to Ethereum, authorization is required to interact with model state. There is a dedicated topic to [Authorisation](./authorization.md).
![overview](../images/world-map.png)

## The World Contract

The world contract functions as a central store for the world models and systems. Every contract that interacts with the world, must use the world contract address as the first parameter. This is how the world contract is able to manage the state of the world.
Expand Down
42 changes: 26 additions & 16 deletions src/deployment/locally.md
Original file line number Diff line number Diff line change
@@ -1,31 +1,41 @@
## Deploying Locally to Katana
## Local Deployment with Katana

Dojo is engineered for rapid development, boasting a lightning-fast local development sequencer, [Katana](../toolchain/katana/overview.md). Katana serves as an on-device Starknet blockchain, allowing you to rigorously test your smart contracts before transitioning them to the remote testnet.
Experience the power of rapid development with Dojo, featuring the ultra-fast local development sequencer, [Katana](../toolchain/katana/overview.md). Katana acts as an on-device Starknet, enabling thorough testing of your dojo world in a controlled environment before migrating them to the remote testnet.

### Katana Deployments
### Easy Katana Deployments

Deploying to Katana could not be easier.
Deploying to Katana is straightforward and efficient.

> This assumes you have followed the [Quick Start](../getting-started/quick-start.md) guide and have a project initialized.
> **Pre-requisite:** Ensure you've completed the [Quick Start](../getting-started/quick-start.md) guide and have your project set up.
From your project directory, run:
To initiate Katana from your project directory, execute:

```bash
katana --disable-fee
```

This has started a local Katana which you can now deploy on!
This command launches a local instance of Katana, setting the stage for your deployment.

### Deploying to Katana
### Step-by-Step Guide to Deploy on Katana

To deploy your project to Katana, run:
Deploying your project to Katana involves a few simple steps.\

```bash
sozo migrate --name test
```
1. **Compile Your Contracts:**

Note - this will only work if you have compiled your contracts. If you have not, run:
If you haven't compiled your contracts yet, run:

```bash
sozo build
```
```bash
sozo build
```

Compiling ensures that your contracts are ready for deployment.

2. **Migrate your Project:**

To migrate, run:

```bash
sozo migrate
```

Success! You have now migrated your world. You will be able to interact with the world using [sozo](../toolchain/sozo/overview.md).
2 changes: 1 addition & 1 deletion src/deployment/remote.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ world_address = "0x5b328933afdbbfd44901fd69a2764a254edbb6e992ae87cf958c70493f2d2

If you credentials are correct in the Scarb.toml then a simple migrate will deploy the world to Starknet.

### Deploy to Remote Katana
### Deploy to Remote [Katana](../toolchain/katana/overview.md)

Katanas are able to be hosted and run as remote testnets, however this is not recommended for production use.

Expand Down
Binary file added src/images/world-map.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/toolchain/sozo/world-commands/execute.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Performing a system execution requires sending a transaction, therefore, `execut
### USAGE

```sh
# you can use the name or address of the contract
sozo execute <CONTRACT> <ENTRYPOINT>
```

Expand Down
10 changes: 9 additions & 1 deletion src/toolchain/torii/grpc.md
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
# Graphql
## gRPC

_TL;DR_

- gRPC is an efficient way to fetch your data
- You can subscribe to entity and model events via the gRPC
- Read more - [gRPC](https://grpc.io/docs/what-is-grpc/introduction/)

You can use the gRPC directly or you can use it through a developed client. A great way to use it is via [dojo.js](../../client/dojojs.md) torii-client package.
18 changes: 15 additions & 3 deletions src/toolchain/torii/overview.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,20 @@
![katana](../../images/torii-icon-word.png)

## Torii - Networking & Indexing
## Torii

Torii is an automatic indexer for dojo worlds. Built in rust to be blazingly fast and exceptionally scalable. Torii provides a fully typed, dynamically generated GraphqQL interface and a high performance gRPC api for binding clients to the world state.
Torii is an automatic indexer and client for dojo worlds. Built in rust to be blazingly fast and exceptionally scalable. Torii provides a fully typed, dynamically generated GraphqQL interface and a high performance gRPC api for binding clients to the world state. There are two parts to torii, the client and the server.

### Torii Server

The torii server comprises of the rust backend that exposes the graphql and gRPC endpoints.

### Torii Client

Torii client interfaces with the server to provide an easy to use api for your clients:

- [wasm](../../client/torii/torii-wasm.md)
- [unity](../../client/torii/unity.md)
- [c](../../client/torii/unity.md)

### Usage

Expand All @@ -12,7 +24,7 @@ Torii leverages world introspection to bootstrap directly from an onchain deploy
torii --world <World Address>
```

You'll have a GraphQL API running at `http://localhost:8080/graphql` and a gRPC api at `http://localhost:8080/grpc`
You'll have a GraphQL API running at `http://localhost:8080/graphql` and a gRPC api at `http://localhost:8080`

## Installation

Expand Down

0 comments on commit c168b98

Please sign in to comment.