Skip to content

Commit

Permalink
Updating README.md and Renaming (#496)
Browse files Browse the repository at this point in the history
  • Loading branch information
MedovTimur authored Nov 1, 2024
1 parent 506fc06 commit abf591a
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 40 deletions.
2 changes: 1 addition & 1 deletion contracts/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 3 additions & 9 deletions contracts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,26 +29,20 @@ Note that it's built from the latest commit on the `master` branch. Therefore, w
### 🏗️ Build all contract & states

```sh
cargo b
cargo b -r
```

### ✅ Build & run tests

Run all tests, except `gclient` ones:
```sh
cargo t -- --skip gclient
cargo t -r -- --skip gclient
```

Run all tests:
```sh
# Download the node binary.
cargo xtask node
cargo t
```

### 🚀 Run CI locally (should be done before a commit)
```sh
cargo xtask ci
cargo t -r
```

## Versioning & backwards compatibility
Expand Down
19 changes: 19 additions & 0 deletions contracts/car-races/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Car Races

This project is a competitive environment where strategy-based programs race against each other, aiming to optimize speed, tactics, and resource management on the track. Each program operates autonomously, employing unique strategies to outmaneuver opponents and complete the race as efficiently as possible.

A detailed description of the project can be found on the [wiki](https://wiki.vara.network/docs/examples/Gaming/racingcars).

⚙️ **Note**: The project code is developed using the [Sails](https://github.com/gear-tech/sails) framework.

### 🏗️ Building

```sh
cargo b -r -p "car-races"
```

### ✅ Testing

```sh
cargo t -r -p "car-races-app"
```
2 changes: 1 addition & 1 deletion contracts/car-races/app/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const PATH_TO_STRATEGIES: [&str; 2] = [
];

const PATH_TO_CAR_RACES: &str =
"../../target/wasm32-unknown-unknown/release/car_races_wasm.opt.wasm";
"../../target/wasm32-unknown-unknown/release/car_races.opt.wasm";

#[test]
fn test_car_races_without_session() {
Expand Down
4 changes: 2 additions & 2 deletions contracts/car-races/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "car-races-wasm"
name = "car-races"
version.workspace = true
edition.workspace = true
license.workspace = true
Expand All @@ -16,4 +16,4 @@ car-races-app = { path = "../app" }

[lib]
crate-type = ["rlib"]
name = "car_races_wasm"
name = "car_races"
19 changes: 19 additions & 0 deletions contracts/syndote/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Sails Syndote

Sails Syndote is a Monopoly-inspired game where the players are automated programs that compete and strategize to dominate the game board. Each player represents a program, creating a unique experience as they navigate the game autonomously. A sample player program is available at this [link](https://github.com/gear-foundation/dapps/tree/master/contracts/syndote/player).

A detailed description of the project can be found on the [wiki](https://wiki.vara.network/docs/examples/Gaming/monopoly).

⚙️ **Note**: The project code is developed using the [Sails](https://github.com/gear-tech/sails) framework.

### 🏗️ Building

```sh
cargo b -r -p "syndote"
```

### ✅ Testing

```sh
cargo t -r -p "syndote-app"
```
10 changes: 10 additions & 0 deletions contracts/syndote/player/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Syndote player

This repository contains the code for a player program in the Syndote game. The player program includes strategies and logic for navigating the game autonomously and making decisions to gain an advantage on the board.

### 🏗️ Building

```sh
cargo b -r -p "syndote"
```

9 changes: 5 additions & 4 deletions contracts/tic-tac-toe/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[![Open in Gitpod](https://img.shields.io/badge/Open_in-Gitpod-white?logo=gitpod)](https://gitpod.io/#FOLDER=vara-man/https://github.com/gear-foundation/dapps)
[![Docs](https://img.shields.io/github/actions/workflow/status/gear-foundation/dapps/contracts.yml?logo=rust&label=docs)](https://dapps.gear.rs/vara_man_io)

# Sails Tic-Tac-Toe

A detailed description of the project can be found on the [wiki](https://wiki.vara.network/docs/examples/Gaming/tictactoe).

⚙️ **Note**: The project code is developed using the [Sails](https://github.com/gear-tech/sails) framework.

### 🏗️ Building

```sh
cargo b -r -p "tic-tac-toe-wasm"
cargo b -r -p "tic-tac-toe"
```

### ✅ Testing
Expand Down
2 changes: 1 addition & 1 deletion contracts/tic-tac-toe/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ schnorrkel.workspace = true

[dev-dependencies]
gclient.workspace = true
tic-tac-toe-wasm = { path = "../wasm" }
tic-tac-toe = { path = "../wasm" }
tokio = "1"
8 changes: 4 additions & 4 deletions contracts/tic-tac-toe/app/tests/test.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use sails_rs::calls::*;
use sails_rs::gtest::{calls::*, System};
use tic_tac_toe_wasm::{
use tic_tac_toe::{
traits::{TicTacToe, TicTacToeFactory},
Config, GameResult, TicTacToe as TicTacToeClient, TicTacToeFactory as Factory,
};
Expand All @@ -17,7 +17,7 @@ async fn test_play_game() {
let program_space = GTestRemoting::new(system, ADMIN_ID.into());
let code_id = program_space
.system()
.submit_code_file("../../target/wasm32-unknown-unknown/release/tic_tac_toe_wasm.opt.wasm");
.submit_code_file("../../target/wasm32-unknown-unknown/release/tic_tac_toe.opt.wasm");

let tic_tac_toe_factory = Factory::new(program_space.clone());
let config = Config {
Expand Down Expand Up @@ -89,7 +89,7 @@ async fn add_and_remove_admin() {

let code_id = program_space
.system()
.submit_code_file("../../target/wasm32-unknown-unknown/release/tic_tac_toe_wasm.opt.wasm");
.submit_code_file("../../target/wasm32-unknown-unknown/release/tic_tac_toe.opt.wasm");

let tic_tac_toe_factory = Factory::new(program_space.clone());
let config = Config {
Expand Down Expand Up @@ -138,7 +138,7 @@ async fn allow_messages() {

let code_id = program_space
.system()
.submit_code_file("../../target/wasm32-unknown-unknown/release/tic_tac_toe_wasm.opt.wasm");
.submit_code_file("../../target/wasm32-unknown-unknown/release/tic_tac_toe.opt.wasm");

let tic_tac_toe_factory = Factory::new(program_space.clone());
let config = Config {
Expand Down
4 changes: 2 additions & 2 deletions contracts/tic-tac-toe/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "tic-tac-toe-wasm"
name = "tic-tac-toe"
version.workspace = true
edition.workspace = true
license.workspace = true
Expand All @@ -16,4 +16,4 @@ tic-tac-toe-app = { path = "../app" }

[lib]
crate-type = ["rlib"]
name = "tic_tac_toe_wasm"
name = "tic_tac_toe"
9 changes: 5 additions & 4 deletions contracts/vara-man/README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
[![Open in Gitpod](https://img.shields.io/badge/Open_in-Gitpod-white?logo=gitpod)](https://gitpod.io/#FOLDER=vara-man/https://github.com/gear-foundation/dapps)
[![Docs](https://img.shields.io/github/actions/workflow/status/gear-foundation/dapps/contracts.yml?logo=rust&label=docs)](https://dapps.gear.rs/vara_man_io)

# Vara Man

A detailed description of the project can be found on the [wiki](https://wiki.vara.network/docs/examples/Gaming/varaman).

⚙️ **Note**: The project code is developed using the [Sails](https://github.com/gear-tech/sails) framework.

### 🏗️ Building

```sh
cargo b -r -p "vara-man-wasm"
cargo b -r -p "vara-man"
```

### ✅ Testing
Expand Down
2 changes: 1 addition & 1 deletion contracts/vara-man/app/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ schnorrkel.workspace = true
[dev-dependencies]
gtest.workspace = true
gclient.workspace = true
vara-man-wasm = { path = "../wasm" }
vara-man = { path = "../wasm" }
tokio = "1"
extended_vft_wasm = { git = "https://github.com/gear-foundation/standards/"}
8 changes: 4 additions & 4 deletions contracts/vara-man/app/tests/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use gtest::{Log, Program};
use sails_rs::calls::*;
use sails_rs::gtest::{calls::*, System};
use sails_rs::{ActorId, Encode, U256};
use vara_man_wasm::{
use vara_man::{
traits::{VaraMan, VaraManFactory},
Config, Level, Status, VaraMan as VaraManClient, VaraManFactory as Factory,
};
Expand Down Expand Up @@ -54,7 +54,7 @@ async fn test_play_game() {

let code_id = program_space
.system()
.submit_code_file("../../target/wasm32-unknown-unknown/release/vara_man_wasm.opt.wasm");
.submit_code_file("../../target/wasm32-unknown-unknown/release/vara_man.opt.wasm");

let vara_man_factory = Factory::new(program_space.clone());
let config = Config {
Expand Down Expand Up @@ -122,7 +122,7 @@ async fn test_play_game_with_fungible_token() {

let code_id = program_space
.system()
.submit_code_file("../../target/wasm32-unknown-unknown/release/vara_man_wasm.opt.wasm");
.submit_code_file("../../target/wasm32-unknown-unknown/release/vara_man.opt.wasm");

let vara_man_factory = Factory::new(program_space.clone());
let config = Config {
Expand Down Expand Up @@ -184,7 +184,7 @@ async fn test_play_tournament() {

let code_id = program_space
.system()
.submit_code_file("../../target/wasm32-unknown-unknown/release/vara_man_wasm.opt.wasm");
.submit_code_file("../../target/wasm32-unknown-unknown/release/vara_man.opt.wasm");

let vara_man_factory = Factory::new(program_space.clone());
let config = Config {
Expand Down
2 changes: 1 addition & 1 deletion contracts/vara-man/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "vara-man-wasm"
name = "vara-man"
version.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
19 changes: 19 additions & 0 deletions contracts/zk-battleship/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Zero-knowledge battleship

This project is a battleship game that leverages zero-knowledge (zk) cryptography, enabling players to verify each other's moves without revealing any hidden information about their boards. The game preserves privacy through zk proofs, allowing players to prove the validity of their actions while keeping their board configurations confidential.In the repository, there is also a circom directory containing circuits essential for generating the zk proofs required in the game.

For a more in-depth explanation of the game mechanics, design, and zk proof integration, please visit the project [wiki](https://wiki.vara.network/docs/examples/Gaming/Battleship/zk-battleship).

⚙️ **Note**: The project code is developed using the [Sails](https://github.com/gear-tech/sails) framework.

### 🏗️ Building

```sh
cargo b -r -p "zk-battleship"
```

### ✅ Testing

```sh
cargo t -r -p "zk-battleship-app"
```
2 changes: 1 addition & 1 deletion contracts/zk-battleship/app/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "zk-battleship"
name = "zk-battleship-app"
version.workspace = true
edition.workspace = true
license.workspace = true
Expand Down
6 changes: 3 additions & 3 deletions contracts/zk-battleship/wasm/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[package]
name = "zk-battleship-wasm"
name = "zk-battleship"
version.workspace = true
edition.workspace = true
license.workspace = true

[dependencies]
zk-battleship = { path = "../app" }
zk-battleship-app = { path = "../app" }

[build-dependencies]
gear-wasm-builder.workspace = true
sails-idl-gen.workspace = true
zk-battleship = { path = "../app" }
zk-battleship-app = { path = "../app" }
2 changes: 1 addition & 1 deletion contracts/zk-battleship/wasm/build.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use sails_idl_gen::program;
use std::{env, fs::File, path::PathBuf};
use zk_battleship::Program;
use zk_battleship_app::Program;

fn main() {
gear_wasm_builder::build();
Expand Down
2 changes: 1 addition & 1 deletion contracts/zk-battleship/wasm/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#![no_std]

#[cfg(target_arch = "wasm32")]
pub use zk_battleship::wasm::*;
pub use zk_battleship_app::wasm::*;

0 comments on commit abf591a

Please sign in to comment.