sorodev


Namesorodev JSON
Version 0.0.2 PyPI version JSON
download
home_page
SummaryDevelop with soroban more efficiently
upload_time2023-12-28 12:18:08
maintainer
docs_urlNone
authorflokapi
requires_python>=3.7,<4.0
licenseGPL-3.0-only
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # About

Sorodev is a CLI tool and Python package which allows to develop with [Soroban](https://soroban.stellar.org/) more efficiently. 

It is designed for Linux systems (Debian, WSL, ...)



### Why?

While [soroban-cli](https://soroban.stellar.org/docs/reference/soroban-cli) is like a Swiss knife to interact with Soroban, it also requires many arguments and parameters to specify the context, such as the current network being used, the last deployment addresses, ...

Similarly, Rust is a generic and customizable language, which requires to replicate the same patterns for each contract.

The idea behind `sorodev` is to provide the setup to get started with a development on Soroban and to bring some tools on top of `soroban-cli`.

For example:
- create new Soroban projects and contracts (create default `Cargo.toml`, `lib.rs`, `test.rs`)
- use a `sorodev.json` to configure the current parameters
- build, test, deploy, invoke contracts, or make contract bindings with simple commands

To sum up, Sorodev indends to make it easier for anyone to start developping on Soroban and to enable a more efficient development experience.

However, it's recommended to understand both the [Soroban development setup](https://soroban.stellar.org/docs/category/getting-started) and [how Sorodev works](https://github.com/flokapi/sorodev/tree/main/src/sorodev).


# Getting started

## Installation

### Install Soroban

Install Rust

```shell
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
```

Install the WebAssembly compilation target

```
rustup target add wasm32-unknown-unknown
```

Install `soroban-cli`

```
cargo install soroban-cli
```



### Install Sorodev

```shell
pip install sorodev
```



## Standalone project

```shell
mkdir example
cd example

sorodev install
sorodev add-contract hello_soroban
sorodev add-account alice
sorodev build
sorodev test
sorodev deploy hello_soroban
sorodev invoke hello_soroban hello --args "--to Sorodev"
```



## Create an Astro project

```shell
npm create astro@4.0.1 example_astro --\
	--template basics\
	--install\
	--no-git\
	--typescript strictest

cd example_astro

sorodev install
sorodev add-contract hello_soroban
sorodev add-account alice
sorodev build
sorodev deploy hello_soroban
sorodev make-binding hello_soroban
```


In `pages/index.astro`, add the following lines:

```jsx
---
import Layout from "../layouts/Layout.astro";
import Card from "../components/Card.astro";

+ import { Contract, networks } from "hello_soroban-client";

+ const greeter = new Contract({
+   ...networks.testnet,
+   rpcUrl: "https://soroban-testnet.stellar.org",
+ });
+ 
+ const { result } = await greeter.hello({ to: "Sorodev" });
---
```



```jsx
- <h1>Welcome to <span class="text-gradient">Astro</span></h1>
+ <h1><span class="text-gradient">{result.join(" ")}</span></h1>
```



In the `package.json`, add the following script:

```
"scripts": {
    ...
    "postinstall": "sorodev build && sorodev deploy hello_soroban && sorodev make-binding hello_soroban"
}
```



Then run:

```shell
npm i
npm run dev
```
Then open `http://localhost:4321/`, you should see `Hello Sorodev`.


## Create a Next.js project


            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "sorodev",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "flokapi",
    "author_email": "flokapi@pm.me",
    "download_url": "https://files.pythonhosted.org/packages/c9/74/2a516a862506ca6cf8914ab3b78a02a8dc3acb9116e6fc54dc833afac006/sorodev-0.0.2.tar.gz",
    "platform": null,
    "description": "# About\n\nSorodev is a CLI tool and Python package which allows to develop with [Soroban](https://soroban.stellar.org/) more efficiently. \n\nIt is designed for Linux systems (Debian, WSL, ...)\n\n\n\n### Why?\n\nWhile [soroban-cli](https://soroban.stellar.org/docs/reference/soroban-cli) is like a Swiss knife to interact with Soroban, it also requires many arguments and parameters to specify the context, such as the current network being used, the last deployment addresses, ...\n\nSimilarly, Rust is a generic and customizable language, which requires to replicate the same patterns for each contract.\n\nThe idea behind `sorodev` is to provide the setup to get started with a development on Soroban and to bring some tools on top of `soroban-cli`.\n\nFor example:\n- create new Soroban projects and contracts (create default `Cargo.toml`, `lib.rs`, `test.rs`)\n- use a `sorodev.json` to configure the current parameters\n- build, test, deploy, invoke contracts, or make contract bindings with simple commands\n\nTo sum up, Sorodev indends to make it easier for anyone to start developping on Soroban and to enable a more efficient development experience.\n\nHowever, it's recommended to understand both the [Soroban development setup](https://soroban.stellar.org/docs/category/getting-started) and [how Sorodev works](https://github.com/flokapi/sorodev/tree/main/src/sorodev).\n\n\n# Getting started\n\n## Installation\n\n### Install Soroban\n\nInstall Rust\n\n```shell\ncurl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh\n```\n\nInstall the WebAssembly compilation target\n\n```\nrustup target add wasm32-unknown-unknown\n```\n\nInstall `soroban-cli`\n\n```\ncargo install soroban-cli\n```\n\n\n\n### Install Sorodev\n\n```shell\npip install sorodev\n```\n\n\n\n## Standalone project\n\n```shell\nmkdir example\ncd example\n\nsorodev install\nsorodev add-contract hello_soroban\nsorodev add-account alice\nsorodev build\nsorodev test\nsorodev deploy hello_soroban\nsorodev invoke hello_soroban hello --args \"--to Sorodev\"\n```\n\n\n\n## Create an Astro project\n\n```shell\nnpm create astro@4.0.1 example_astro --\\\n\t--template basics\\\n\t--install\\\n\t--no-git\\\n\t--typescript strictest\n\ncd example_astro\n\nsorodev install\nsorodev add-contract hello_soroban\nsorodev add-account alice\nsorodev build\nsorodev deploy hello_soroban\nsorodev make-binding hello_soroban\n```\n\n\nIn `pages/index.astro`, add the following lines:\n\n```jsx\n---\nimport Layout from \"../layouts/Layout.astro\";\nimport Card from \"../components/Card.astro\";\n\n+ import { Contract, networks } from \"hello_soroban-client\";\n\n+ const greeter = new Contract({\n+   ...networks.testnet,\n+   rpcUrl: \"https://soroban-testnet.stellar.org\",\n+ });\n+ \n+ const { result } = await greeter.hello({ to: \"Sorodev\" });\n---\n```\n\n\n\n```jsx\n- <h1>Welcome to <span class=\"text-gradient\">Astro</span></h1>\n+ <h1><span class=\"text-gradient\">{result.join(\" \")}</span></h1>\n```\n\n\n\nIn the `package.json`, add the following script:\n\n```\n\"scripts\": {\n    ...\n    \"postinstall\": \"sorodev build && sorodev deploy hello_soroban && sorodev make-binding hello_soroban\"\n}\n```\n\n\n\nThen run:\n\n```shell\nnpm i\nnpm run dev\n```\nThen open `http://localhost:4321/`, you should see `Hello Sorodev`.\n\n\n## Create a Next.js project\n\n",
    "bugtrack_url": null,
    "license": "GPL-3.0-only",
    "summary": "Develop with soroban more efficiently",
    "version": "0.0.2",
    "project_urls": {
        "documentation": "https://github.com/flokapi/sorodev",
        "homepage": "https://github.com/flokapi/sorodev",
        "repository": "https://github.com/flokapi/sorodev"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "cb6324aaf0f04406a22da032eb0e2bf582d88df9c4f2fd55a010c17493a42dce",
                "md5": "7677c666abd831357690ac30713f9880",
                "sha256": "5a72cc423589265564df82b031c106b7b1694e31175f5b2afb705e011bd06374"
            },
            "downloads": -1,
            "filename": "sorodev-0.0.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "7677c666abd831357690ac30713f9880",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 21281,
            "upload_time": "2023-12-28T12:18:06",
            "upload_time_iso_8601": "2023-12-28T12:18:06.162499Z",
            "url": "https://files.pythonhosted.org/packages/cb/63/24aaf0f04406a22da032eb0e2bf582d88df9c4f2fd55a010c17493a42dce/sorodev-0.0.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c9742a516a862506ca6cf8914ab3b78a02a8dc3acb9116e6fc54dc833afac006",
                "md5": "6da31ac66d847a0f1222547dde605e05",
                "sha256": "68a67a6037e2374f1c9f9412bcfc32f0178207e0cb74795f4fa190a70deba315"
            },
            "downloads": -1,
            "filename": "sorodev-0.0.2.tar.gz",
            "has_sig": false,
            "md5_digest": "6da31ac66d847a0f1222547dde605e05",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 19520,
            "upload_time": "2023-12-28T12:18:08",
            "upload_time_iso_8601": "2023-12-28T12:18:08.617925Z",
            "url": "https://files.pythonhosted.org/packages/c9/74/2a516a862506ca6cf8914ab3b78a02a8dc3acb9116e6fc54dc833afac006/sorodev-0.0.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-12-28 12:18:08",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "flokapi",
    "github_project": "sorodev",
    "github_not_found": true,
    "lcname": "sorodev"
}
        
Elapsed time: 0.27262s