Skip to content

Blockchain-Voting-Based-System/vodth-on-sui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sui Brief Tutorial

PUblish the package

$ sui client publish --gas-budget 5000000

Get active address

$ sui client active-address

Create a new event

  • The below script will create an event object and transfer to the address.
  • When integrating with DApp the event-object-id should be stored for future uses.
  • Replace with the actual address. The address can be obtain by the above script.
  • Replace with the the published package Ex: 0xa2cfae1dfcf4cf2116c710580757b5db5863fd0985daaacdf074c7b51ae32a42
sui client ptb \
        --assign to_address @<active-address> \
        --move-call <package-id>::vote::new_event \
        --assign event \
        --transfer-objects "[event]" to_address \
        --gas-budget 20000000

Add new candidate to the event\

This script will look for the provided package and module and call the input function name with the respective arguments.

  • Replace with the the published package Ex: 0xa2cfae1dfcf4cf2116c710580757b5db5863fd0985daaacdf074c7b51ae32a42
  • Replace with the actual event id
sui client call \
    --package <package-id> \ 
    --module vote \
    --function new_candidate \
    --args <event-id>

Add a new ballot/ Voting

This script will a create a vote for the provied event and candidate.

  • Replace with the actual package-id
  • Replace with the event object id
  • Replace with the candidate object id
sui client call \
    --package <package-id> \
    --module vote \
    --function new_ballot \
    --args <event-id> <candidate-id> <voter-hash> --gas-budget 50000000

Upgrading Sui version with Cargo

  1. Mainnet
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch mainnet sui
  1. Testnet
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch testnet sui
  1. Devnet
cargo install --locked --git https://github.com/MystenLabs/sui.git --branch devnet sui

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages