Skip to content

Latest commit

 

History

History
135 lines (103 loc) · 2.75 KB

File metadata and controls

135 lines (103 loc) · 2.75 KB

Quick Start

Get started with Sekiva development in minutes.

Clone and Setup

  1. Clone the repository:

    git clone https://github.com/your-org/sekiva.git
    cd sekiva
  2. Install dependencies:

    # Install Rust dependencies
    cargo build
    
    # Install frontend dependencies
    cd sekiva-frontend
    bun install

Development Workflow

Smart Contracts

  1. Build contracts:

    cargo pbc build
  2. Run tests:

    cargo test
  3. Generate TypeScript bindings:

    # Generate Factory contract bindings
    cargo pbc abi codegen --ts \
      target/wasm32-unknown-unknown/release/sekiva.abi \
      sekiva-frontend/src/contracts/SekivaFactoryGenerated.ts \
      --deserialize-rpc
    
    # Generate Organization contract bindings
    cargo pbc abi codegen --ts \
      target/wasm32-unknown-unknown/release/collective.abi \
      sekiva-frontend/src/contracts/CollectiveGenerated.ts \
      --deserialize-rpc
    
    # Generate Ballot contract bindings
    cargo pbc abi codegen --ts \
      target/wasm32-unknown-unknown/release/ballot.abi \
      sekiva-frontend/src/contracts/BallotGenerated.ts \
      --deserialize-rpc

Frontend

  1. Start development server:

    cd sekiva-frontend
    bun run dev
  2. Access at http://localhost:5173

First Deployment

  1. Create an account

  2. Deploy the factory contract

  3. Update frontend configuration:

    // sekiva-frontend/src/config.ts
    export const FACTORY_ADDRESS = '<YOUR_FACTORY_ADDRESS>';

Common Tasks

Create Organization

cargo pbc transaction action <SEKIVA_CONTRACT_ADDRESS> deploy_organization \
  <ORG_NAME> \
  <ORG_DESCRIPTION> \
  <ORG_PROFILE_IMAGE> \
  <ORG_BANNER_IMAGE> \
  <X_URL> \
  <DISCORD_URL> \
  <WEBSITE_URL> \
  <ORG_ADMINISTRATOR> \
  --abi <SEKIVA_ABI> \
  --gas 10000000 \
  --privatekey <PRIVATE_KEY_FILE>

Create Ballot

cargo pbc transaction action <ORG_CONTRACT_ADDRESS> deploy_ballot \
  [ <UP_TO_5_OPTIONS_SEPARATED_BY_A_SPACE> ] \
  <BALLOT_TITLE> \
  <BALLOT_DESC> \
  <ADMIN> \
  <DURATION_IN_SECONDS> \
  --abi <ORG_PBC> \
  --gas 10000000 \
  --privatekey <PRIVATE_KEY_FILE>

Example:

cargo pbc transaction action 02a51cbe067086205f82c48b4714d3781070c4cdd5 deploy_ballot \
  [ YES NO ] \
  'Does this work?' \
  "Let's see..." \
  '00ccb2dd9d08a91f1815c0945762597f48bc5323c6' \
  300 \
  --abi target/wasm32-unknown-unknown/release/collective.pbc \
  --gas 10000000 \
  --privatekey 006e0dd6c0dfa4b012e0b3ac085b1105754879503a.pk

Next Steps