This is a dedicated interface for Kusama Society.
-
Clone this repository.
-
Copy the development sample config file on the root folder:
cp .env.development.sample .env.developmentUse
REACT_APP_PROVIDER_SOCKET=wss://kusama-asset-hub-rpc.polkadot.io(or one of the other options available on the sample config file) if you want to connect to production RPC
yarn installAfter a Kusama Asset Hub or People runtime upgrade, refresh the chain metadata and descriptors:
yarn papi update- Copy the development sample config file on the config folder:
cp config/kusama.yml.sample config/kusama.yml- Use Chopsticks and set
REACT_APP_PROVIDER_SOCKET=ws://127.0.0.1:8000on your.env.developmentto run a local fork of Kusama with predetermined Society storage and a custom runtime (uncomment thewasm-overrideparameter on the config file if you want a custom runtime):
yarn chopsticks
- Or start Chopsticks and the app together with one command. It waits for the Chopsticks RPC before starting the app, and Ctrl+C stops both:
yarn dev
- Private keys for development accounts. Change hard derivation key to switch from
AlicetoBob,Charlie, etc. Use this private key to import these development accounts to a wallet of your choice.
bottom drive obey lake curtain smoke basket hold race lonely fit walk//Alice
Chopsticks allows for custom runtimes to be used. You can build a custom runtime using our fork of the runtimes repository, this version changes the rotation periods from days to a few relay-chain blocks, in order to facilitate tests and development.
- Follow this guide to install Rust and the necessary dependencies to build Substrate
- Clone the forked repository and checkout to this branch:
git checkout main
- Change the code (if you need, if not you can skip this step and use our customized version)
- In the root folder of the forked repository, browse to Asset Hub Kusama's runtime directory
cd system-parachains/asset-hubs/asset-hub-kusama
- Inside the directory, run:
cargo build --release
- After finishing the build, browse back to the root directory and copy the wasm blob to this repository, renaming it to
custom-kusama-runtime.wasm:
cp target/release/wbuild/asset-hub-kusama-runtime/asset_hub_kusama_runtime.wasm ../kappasigmamu.github.io/custom-kusama-runtime.wasm
- Uncomment the
wasm-overrideparameter onconfig/kusama.ymland run Chopsticks:
yarn chopsticks
- You can also access Polkadotjs pointing to your development node to interact with it.
We use IPFS to host the images and Pinata to pin the folder. The images are optimized and renamed to <member_hash>.jpg before getting uploaded. The scripts can be found inside scripts/poi.
- Python libraries:
pip3 install Pillow pillow-heif python-dotenv
- Optimize an entire folder:
python3 optimize_multiple.py <folder_path>
- Rename and optimize single image:
python3 rename_and_optimize.py <image_path> <member_hash>
- PS: requires a
.envinsidescripts/poiwithPINATA_API_KEYandPINATA_API_SECRET - Install IPFS and run it:
ipfs daemon
- Upload folder to Pinata and pin it:
python3 upload.py <file_path>
- Download pinned folder:
python3 download.py <ipfs_hash> <download_path>
- Full job - takes a new image, renames and optimizes it, uploads the new folder to Pinata and pins it, and finally unpins the old folder. The optional param
forcelet's you overwrite an image that already exists.
python3 job.py <image_path> <member_hash> [optional=force]
yarn start
yarn lint
You can automatically fix some issues with yarn lint:fix
yarn testWatch mode:
yarn test --watchNon-watch run (as used in CI):
CI=true yarn test --watchAll=falseE2E tests run against a local Chopsticks fork and the test dev server. Copy the Chopsticks config first:
cp config/kusama.yml.sample config/kusama.ymlRun a suite:
yarn test:e2e dashboard
yarn test:e2e smoke
yarn test:e2e wallet
yarn test:e2e bidding
yarn test:e2e payouts
yarn test:e2e candidate-voting
yarn test:e2e members
yarn test:e2e membership-claim
yarn test:e2e index-selector
yarn test:e2e user-journeys
yarn test:e2e error-handling
yarn test:e2e suspendedRun every suite:
yarn test:e2e allRun tests matching a title substring:
yarn test:e2e grep "should place a bid"Re-run only tests that failed in the previous run (any command above accepts this flag):
yarn test:e2e bidding --failed
yarn test:e2e all --failed
yarn test:e2e grep "place a bid" --failedFailed tests are cached in cypress/.cache/failed-tests.json after each run.
Interactive / local debugging:
yarn test:e2e open # Cypress UI with Chopsticks + dev server
yarn test:e2e smoke --headed # run a suite with a visible browserAll suite commands are implemented by scripts/test-e2e.js, which starts Chopsticks, waits for RPC readiness, starts the app, and runs Cypress.
yarn build
Builds the app for production to the build folder.