Solang Playground - A Solidity web editor for Hyperledger Solang
Welcome to Solang Playground, a Solidity web editor for that enables editing, compiling, deploying and interacting with Solidity smart contracts on Solana or Polkadot.
You can experiment with a hosted version of Solang Playground.
cargo install cargo-make
cargo make deps
cargo make build
cargo make run
By default, the server will be available at http://localhost:9000
.
Once you have compiled your smart contracts using Solang Playground, you can deploy and interact with them on-chain. See tutorial for detailed instructions.
Solang Playground test suite includes tests for the backend and the frontend. To run all available tests, you have to first start the server with cargo make run
in a separate terminal, and then run the following command:
cargo make test
This repository has two main parts:
crates
: Rust code, including:backend
: Actix Web server for the frontend.generate_bindings
: Generates TypeScript bindings for API endpoints.solang
: Contains thesolang-parser
browser
: Contains the monaco editor web server
packages
: TypeScript project for the frontend app, served by the Rust backend.
The Dockerfile for Solang Playground relies on Nestybox's Sysbox runtime. This helps compile Solang Smart Contracts within a protected Docker environment. We also use a multi-stage build process to improve image size.
Here are the instructions to install Sysbox
docker build -t solang-playground .
You can then run the image with:
cargo make docker-run
The docker image is also available on Docker Hub:
docker pull salaheldin18/solang-playground-amd64
Milestone | Related Feature | Status |
---|---|---|
Compile Solang language server to WASM, and integrate it to a Monaco editor. | Allow editing Solidity source files in the browser, with smarts provided from the server (Diagnostics, code completion, etc..) | Completed |
Host Solang on a backend service | Allow compiling smart contracts on the web editor | Completed |
Support Polkadot API | Allow the deployment and interaction with Solidity contracts on Polkadot | Completed |
IDE Improvements | Improve developer experience when trying out the IDE, making it a more attractive option for Solidity devs | In progress |
- This project started out as a fork of https://github.com/silvanshade/tower-lsp-web-demo. Darin Morrison created a demo project where an example tower-lsp language server was compiled to WASM and integrated in a Monaco web editor.
- The structure of
solang-playground
is significantly inspired byink-playground
. This includes the implementation of running the Solang compiler functionality in a sandboxed environment.