CasperLabs Hackaton October 2022 👻 🎃🕯️
🏰 Deployed on Render at https://casper.onrender.com/ ( beta 🏚️🕸️🕷️)
This projects aims to ease interactions with Casper Blockchain during smart contracts development and for regular queries done with the Casper Client CLI
This project relies on casper-js-sdk and casper-rust-sdk to help with onboarding developers on the Casper Network and also users by providing better insights on Casper Blockchain concepts (URef, Dictionnaries etc..) and with giving the ability to deploy a smart contract signed with the Capser Signer.
Using Chrome or a Chromium-based browser like Brave ? visit the Chrome Web Store, then download and install CasperLabs Signer extension
📜 CasperLabs Signer acts as your CSPR wallet, keeping your accounts and letting you sign deploys on the Casper Network to perform actions like staking, unstaking or sending your tokens to another person or an exchange account.
Web server is implemented in Express.js.
Api server is implemented in NestJS+ Nx structure.
UI is implemented in Angular.js + Nx structure.
Smart contracts are implemented in Rust + Casper Smart contract Crate.
- casper-sdk: contains the Casper Rust SDK in two versions, web and nodejs
- docker: contains Docker files
- wasm: contains client wasm files
- www: contains the Web application files
- Header
- [✓] Integrate with Casper Signer
- [✓] Display active public key and account balance
- Network
- [✓] Input Network Peer
- [✓] Select from Network Peers
- [✓] Check Peer status
- [✓] Change RPC ending suffix
- [✓] Retrieve Root State Hash
- Config
- [✓] Input Root State Hash
- [✓] Retrieve from Signer or input Public Key
- [✓] Retrieve Puse URef associated with Public key
- [✓] Retrieve Balance associated with Public key
- Transfer
- [✓] Transfer from active Public Key
- [✓] Transfer from other Public Key or Purse Uref
- [✓] Transfer to Public Key
- [✓] Transfer to Purse Uref
- [✓] Define Amount to transfer
- Purse
- [✓] Input Purse URef
- [✓] Retrieve Balance associated with URef
- State
- [✓] Input URef / Hash / Deploy Hash / Account Hash
- [✓] Input Named Key Path
- [✓] Retrieve State value
- Dictionaries
- [✓] Input Dictionary item key
- [✓] Input Dictionary URef
- [✓] Input Dictionary name
- [✓] Input Contract hash
- [✓] Retrieve Dictionary value
- Deploy
- [✓] Input Chain name
- [✓] Select from Chain names
- [✓] Input Public Key
- [✓] Input Public Key
- [✓] Input Gas Fee max for a deploy payment
- [✓] Input Time To Live max for a deploy payment
- [✓] Select Wasm file (ModuleBytes)
- [✓] Input Contract or Package name
- [✓] Input Contract or Package hash
- [✓] Input Entry point
- [✓] Input Args
- [✓] Input Contract or Package as target of the deploy
- [✓] Input Package version of the deploy
- [✓] Make deploy
- [🪲] (bugged) Speculative test deploy
- [✓] Sign with Signer and send deploy to network
- Output
- [✓] Display active query results
- Notes
- [✓] Dummy notes takedown
- [✓] Add Dictionnary implementation to test smart contracts
- [✓] Add some RPC calls into wasm client side (Rust SDK)
- [✓] Add Events watchers
- Re implement Events watchers from the Rust SDK
- Casper wallet integration / private key / deprecate Casper Signer
- Whitelist Signer on casper.onrender.com
- Fix Github workflow
- Fix blur events on input
- Fix UI height
- Refactor Angular froms building
- Improve Jest coverage
- Improve Cypress coverage
- Add Cypress coverage Github action
- Improve Css consistentcy
- [✓] Fix transfers from URef or non active public key
- Fix speculative test deploys
- Add check deploy and size check
- Add multisignature flow
- Add delegation / stacking flow ?
- [✓] Upgrading smart contracts
- Escrow app on /escrow route
- Add Escrow smart contracts
- Electron app
- Load / sign deploy
- npm >= 10.2.5
- nodejs >= v20.10.0
This web project was generated and is using
-
Runs on
-
For tests
-
For WebAssembly and Smart contracts on
Donwload and run image with docker-compose.yml 🏃
docker-compose -f './docker/docker-compose.yml' up -d
Pull and run image from https://hub.docker.com/r/gregoshop/casper-deployer 🏃♀️
docker pull gregoshop/casper-deployer
docker container run -t -i --rm -h casper-deployer -p 4200:4200 gregoshop/casper-deployer
Build and run image with Dockerfile 🏃♂️
docker build -t casper-deployer ./docker/ --force-rm
docker container run -t -i --rm -h casper-deployer -p 4200:4200 casper-deployer
Navigate to http://localhost:4200/
📂 Go to
www
folder
cd ./www
Run npm install
to install the application.
npm install
Run npm start
for a dev server. Navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.
npm start
Run npm run start:prod
for a dev server with production configuration. Navigate to http://localhost:4200/.
npm run start:prod
Run npm run build
to build the project. The build artifacts will be stored in the dist/
directory.
npm run build
Run npm run test
to execute the unit tests via Jest.
npm run test
Run nx affected:test
to execute the unit tests affected by a change.
Run npm run e2e
to execute the end-to-end tests via Cypress.
npm run e2e
Run nx affected:e2e
to execute the end-to-end tests affected by a change.
Settings can be changed in /www/libs/util/config/src/config.ts
Default example settings are
{
"api_prefix": "/api/",
"gasFee": "150000000",
"minimumTransfer": "25000000000",
"TTL": "30m",
"idMax": "100000000",
"gasFeeTransfer": "10000"
}
Run nx graph
to see a diagram of the dependencies of the projects.
Visit the Nx Documentation to learn more.
https://github.com/gRoussac/casper-deployer-hackathon-oct-2022/blob/Development-Workflow
https://github.com/gRoussac/casper-deployer-hackathon-oct-2022/blob/master/SECURITY.md
Go to the #hackathon
channel on Discord
If you see any typos or errors you can edit the code directly on GitHub and raise a Pull Request on dev
branch, many thanks !