Brought to you by the Snek-oil Shillers.
Chairman DAO is a DAO framework for worker-owned cooperatives built on ICP.
dfxtool: follow this guide- Rust, including
wasm32-unknown-unknown:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
rustup default stable
rustup target add wasm32-unknown-unknown- NPM and typescript
Once all prerequisites are installed, install the project by doing:
npm installFirst, ensure you have the canisters created for your instance by running:
npm run setupAll the canister should have been created. Next, you can build the service by doing:
npm run buildNOTE: For some reason, at this point I have to edit the src/declarations/chairman_dao/index.js declaration file to hardcode the canister ID in the `process.env:
const process = {
env: {
CANISTER_ID_CHAIRMAN_DAO: "<CANISTER_ID>",
DFX_NETWORK: "local",
}
}If you are using the local ICP network, run:
dfx start --background --cleanNow that the service is built and the canisters are created, you can deploy the code to the canisters by running:
dfx deployNOTE: To deploy a demo coffee-shop DAO, run the deploy_demo script:
# First, create the Alice, Bob, and Chris identities if you need to.
dfx identity get-principal --identity Alice
dfx identity get-principal --identity Bob
dfx identity get-principal --identity Chris
# Then, run the deploy demo script
npm run deploy-demo
# NOTE: On certain systems (windows), you may just need to run the script manually:
./deploy_demo.shLaunch the development server to see your DAO:
npm startTo teardown your development network, run:
dfx stop
If you make changes to the server, you will need to re-generate the candid files. First, build the service:
cargo build --release --target wasm32-unknown-unknown --package chairman_daoThen, update the candid file:
candid-extractor target/wasm32-unknown-unknown/release/chairman_dao.wasm > src/chairman_dao/src/chairman_dao.didIf needing to generate the declarations files for the frontend, run:
dfx generateMuch inspiration for the smart-contract came from the official ICP example DAO.