Giter Site home page Giter Site logo

youth_chamaa_rust's Introduction

youth_chamaa

Description

This is a Rust-based smart contract canister for the Internet Computer, which implements a contribution management system. The contract allows for the creation and management of groups, admins, members, contributions, and proposals with the following features:

  • Create and update admin details.
  • Create groups and add members.
  • Add contributions and award points to members.
  • Create and vote on proposals.
  • Retrieve contributions and proposals.
  • Get the leaderboard of members based on points.

Requirements

  • rustc 1.64 or higher
$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh
$ source "$HOME/.cargo/env"
  • rust wasm32-unknown-unknown target
$ rustup target add wasm32-unknown-unknown
  • candid-extractor
$ cargo install candid-extractor
  • install dfx
$ DFX_VERSION=0.15.0 sh -ci "$(curl -fsSL https://sdk.dfinity.org/install.sh)"
$ echo 'export PATH="$PATH:$HOME/bin"' >> "$HOME/.bashrc"
$ source ~/.bashrc
$ dfx start --background

If you want to start working on your project right away, you might want to try the following commands:

$ cd icp_rust_boilerplate/
$ dfx help
$ dfx canister --help

Update dependencies

update the dependencies block in /src/{canister_name}/Cargo.toml:

[dependencies]
candid = "0.9.9"
ic-cdk = "0.11.1"
serde = { version = "1", features = ["derive"] }
serde_json = "1.0"
ic-stable-structures = { git = "https://github.com/lwshang/stable-structures.git", branch = "lwshang/update_cdk"}

did autogenerate

Add this script to the root directory of the project:

https://github.com/buildwithjuno/juno/blob/main/scripts/did.sh

Update line 16 with the name of your canister:

https://github.com/buildwithjuno/juno/blob/main/scripts/did.sh#L16

After this run this script to generate Candid. Important note!

You should run this script each time you modify/add/remove exported functions of the canister. Otherwise, you'll have to modify the candid file manually.

Also, you can add package json with this content:

{
    "scripts": {
        "generate": "./did.sh && dfx generate",
        "gen-deploy": "./did.sh && dfx generate && dfx deploy -y"
      }
}

and use commands npm run generate to generate candid or npm run gen-deploy to generate candid and to deploy a canister.

Running the project locally

If you want to test your project locally, you can use the following commands:

# Starts the replica, running in the background
$ dfx start --background

# Deploys your canisters to the replica and generates your candid interface
$ dfx deploy

youth_chamaa_rust's People

Contributors

coolestnick avatar wekesadev avatar

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.