Skip to content

Commit

Permalink
Update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
gabsn committed Jun 5, 2024
1 parent 18e9691 commit 1b47ada
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 136 deletions.
34 changes: 2 additions & 32 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,3 @@
# Contributor Guide
# How to contribute

**starknet.dart** is a dart package allowing any dart program (mainly Flutter apps) to communicate with the [Starknet](https://starknet.io/docs/) blockchain.

The [Starknet nodes](https://github.com/eqlabs/pathfinder/blob/06ea631557937d4319aa539a2021e312ec757ac2/crates/pathfinder/src/rpc.rs) expose a JSON-RPC API (see the [specs](https://github.com/starkware-libs/starknet-specs)) that we can call to call Smart Contract methods or even get information on blocks and past transactions.

The goal of the project is thus to build a bridge between dart applications and Starknet, while staying consistent with the common abstractions used in other blockchain SDKs (see [ethers.js](https://docs.ethers.io/v5/)).

## Why contributing to starknet.dart?

Starknet is a revolution in the web3 world: it allows to [scale Ethereum](https://docs.ethhub.io/ethereum-roadmap/layer-2-scaling/zk-rollups/) and offers the best UX one can dream of on a blockchain thanks to unique features like [account abstraction](https://www.argent.xyz/blog/wtf-is-account-abstraction/) or [session keys](https://github.com/dontpanicdao/starknet-burner).

But web3 mainstream adoption won't happen unless decentralized applications go to mobile. That's why it's a priority to build the best possible Starknet SDK for Flutter, one of the most used cross-platform mobile framework.

If you want to contribute to the web3 adoption and more specifically Starknet one, then you probably **can't have more impact than working on this SDK** that will be used by the majority of Flutter dApps on Starknet!

## How to contribute

### You have a feature suggestion or want to report a bug

Then you should first [check out if this issue does not exist already](https://github.com/gabsn/starknet.dart/issues). If it does, you can upvote the existing one. If it's a new issue, please go on the project [telegram chat](https://t.me/+CWezjfLIRYc0MDY0) and explain what's your problem and why it should be top priority. We'll then add your issue to the roadmap.

### You want to implement a feature / fix a bug / update the doc

1. ⚠️ Very important: if you want to get involved, please go to the [telegram chat](https://t.me/+CWezjfLIRYc0MDY0) and explain which issue you want to tackle. We'll try to do our best to support you and help you.
2. Fork the repository and create a branch prefixed by the issue number.
3. Implement your feature / bug fix and push it to your remote fork. We strongly recommend you to write the test first, then implement the feature (see [TDD](https://en.wikipedia.org/wiki/Test-driven_development)).
4. Go on github and create a Pull Request from your forked repo to the original one.
5. Ping us on telegram with your PR link so we can review it and merge it.

### You want to become a core contributor

After a few qualitative contributions, we'll probably offer you to join the core team to become a maintainer of the project and get paid for your work.
Please refer to [this section](https://starknetdart.dev/how-to-contribute) to know how to contribute.
108 changes: 5 additions & 103 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,116 +4,18 @@ The goal of this SDK is to be able to interact with Starknet smart contracts in

You can also call the JSON-RPC endpoint exposed by the Starknet full nodes (see the [specs](https://github.com/starkware-libs/starknet-specs)).

📚 [docs](https://pub.dev/packages/starknet)
📚 [docs](https://starknetdart.dev)

💬 [telegram chat](https://t.me/+CWezjfLIRYc0MDY0)

🎯 [roadmap](https://github.com/orgs/focustree/projects/1)

🧑‍💻 [how to contribute](https://starknetdart.dev/how-to-contribute)

## Motivation

Starknet is a revolution in the web3 world: it allows to [scale Ethereum](https://docs.ethhub.io/ethereum-roadmap/layer-2-scaling/zk-rollups/) and offers the best possible UX thanks to unique features like [account abstraction](https://www.argent.xyz/blog/wtf-is-account-abstraction/) or [session keys](https://github.com/dontpanicdao/starknet-burner).

But web3 mainstream adoption won't happen unless decentralized applications go to mobile.

That's why it's a priority to **build the best possible Starknet SDK for dart applications**, thus unlocking the era of Flutter mobile apps on Starknet.

## Roadmap

You can follow the progress of the project directly on the [kanban](https://github.com/users/gabsn/projects/1).

## Contributing

If you want to contribute to this project or have any suggestion, please check out our [Contributor Guide](CONTRIBUTING.md).

## Dev Guide

### Initial Setup

1. Install python deps. Make sure to select the python interpreter from the local .venv created by poetry if you're using VS Code.

```sh
poetry install
```

If you have an error about gmp install it like this :

```sh
brew install gmp
```

2. Run devnet in one terminal

```sh
poetry run devnet start
```

3. Setup devnet by deploying contracts

```sh
poetry run devnet setup
```

You can also deploy contracts one by one:

```sh
poetry run deploy balance
```

4. Interact with deployed contracts:

```sh
poetry run interact get_balance
poetry run interact increase_balance 10
```

### Run Tests

You can run the tests with the following command:

```
dart test
```

To run the tests on **devnet** use the following command:

```
NETWORK=devnet dart test -t integration
```

### Release a new version to pub.dev

You simply need to create a PR where you:

1. Bump the package version
2. Add an entry to the `CHANGELOG`

Make sure it passes all the CI tests, then merge it to release a new version of the package.

### Generate freezed model classes

To avoid writing too much boilerplate, we use the [freezed](https://github.com/rrousselGit/freezed) library to automatically generate serializer logic.

You can run the following command to generate those classes:

```
dart run build_runner build
```

Alternatively, you can hit `Cmd + Shift + B` in vscode.

### Generate docs

To generate docs, run:

```
dart doc .
```

For more advanced features, check out the [dartdoc package](https://pub.dev/packages/dartdoc).

### Compile cairo contracts

```sh
protostar build
```

You can see compiled contracts in the `contracts/build` folder.
14 changes: 13 additions & 1 deletion docs/how-to-contribute.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ And in another terminal, deploy the contracts:
melos devnet:setup
```

7. Run the tests:
## How to run the tests

```sh
melos test
Expand All @@ -96,6 +96,18 @@ melos test
- `/examples` contains examples of apps using the packages. They should be accompanied by a tutorial in the docs to reproduce the app from scratch.
- `/docs` contains the documentation of the project. Docs are automatically deployed when we merge to main.

### Generate freezed model classes

To avoid writing too much boilerplate, we use the [freezed](https://github.com/rrousselGit/freezed) library to automatically generate serializer logic.

You can run the following command to generate those classes:

```
dart run build_runner build
```

Alternatively, you can hit `Cmd + Shift + B` in vscode.

## Troubleshooting

Tools need to be at the right version to avoid any incompability:
Expand Down
Empty file added starknetdart.dev
Empty file.

0 comments on commit 1b47ada

Please sign in to comment.