This repository provides a comprehensive VS Code devcontainer template specifically tailored for the Sunodo Cartesi Rollups tool. It includes practical examples in both TypeScript and Python to help you get started with blockchain development using Cartesi Rollups.
For an in-depth understanding of Cartesi Rollups, please consult the Cartesi documentation.
A Devcontainer, or Development Container, represents a fully containerized development environment, built using Docker. This setup serves to create a consistent, reproducible, and isolated development scenario that can be seamlessly shared and used across various machines and by different team members. By employing Devcontainers, developers can ensure that everyone involved in the project works in the exact same environment, avoiding the "it works on my machine" syndrome, and streamlining development processes.
Before you proceed with running the Devcontainer, ensure that the following tools are installed on your system:
Note: This Devcontainer setup is compatible with GitHub Codespaces and any other platforms that support Devcontainer environments.
- Docker: For creating and managing the development container.
- Visual Studio Code: As the integrated development environment (IDE).
- Remote Development Extension Pack: This extension pack includes a set of extensions that enable remote development in VS Code.
To initiate and run the Devcontainer, follow these detailed steps:
-
Clone the Repository: Clone this repository to your local machine using the following command:
git clone https://github.com/doiim/sunodo-devcontainer.git
-
Open the Repository in VS Code: Navigate to the cloned repository directory and open it in Visual Studio Code:
cd sunodo-devcontainer code .
-
Reopen in Devcontainer: VS Code will automatically detect the presence of a Devcontainer configuration file. It will prompt you to 'Reopen in Container'. Select this option to shift your development environment into the defined container.
-
Container Build and Initialization: Allow some time for the Devcontainer to build and initialize. This process might take a few minutes, primarily depending on your internet connection speed.
-
Start Developing: Once the Devcontainer is active, you are all set to begin development using the Sunodo Cartesi Rollups template. The environment includes all necessary tools and dependencies pre-installed.
To aid your development with Sunodo, this repository includes sample projects in TypeScript and Python. Here’s how you can use these examples:
-
TypeScript Example: Located in the
typescript-example
directory, this sample provides a basic TypeScript DApp template. The primary application file issrc/index.ts
. To build and run this example, execute:cd typescript-example sunodo build # Builds a Cartesi machine and prepares your DApp sunodo run # Runs the application
-
Python Example: Found in the
python-example
directory, this example includes a simple Python DApp template withdapp.py
as the entry file. To build and run the Python example, follow these commands:cd python-example sunodo build # Builds a Cartesi machine and prepares your DApp sunodo run # Runs the application
By following the above guidelines, you can efficiently set up a development environment for Cartesi Rollups and start building decentralized applications using TypeScript or Python.