Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(docs): Update README #344

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 23 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,46 @@ You can find some package documentation below:
| [@bnb-chain/greenfield-js-sdk](./packages/chain-sdk/README.md) | A client library for Greenfield Chain |
| [@bnb-chain/greenfiled-file-handle](./packages/file-handle/README.md) | WASM module that handle file, such as `checksums` |
| [@bnb-chain/greenfield-zk-crypto](./packages/zk-crypto/README.md) | WASM module about sign crypto |
| [@bnb-chain/create-gnfd-app](./packages/create-gnfd-app/README.md) | Create Greenfield App Quickly |

## Document
[Document](./packages/chain-sdk/README.md)
## Online Examples

## Examples
* [Nextjs](https://codesandbox.io/p/github/rrr523/greenfield-nextjs-template/main)
* [Create React App](https://codesandbox.io/p/github/rrr523/greenfield-cra-template/main)
* [Vite](https://codesandbox.io/p/github/rrr523/greenfield-vite-template/main)

There are runnable examples included in the [examples](./examples/) folder
## Quick Start

* [Next.js Example(TypeScript)](./examples/nextjs/README.md)
* [Nodejs](./examples/nodejs/README.md)
You can use [`create-gnfd-app`](./packages/create-gnfd-app/README.md) to create a app quickly.

```bash
> npx @bnb-chain/create-gnfd-app
```

### Try in Stackblitz
![](./packages/create-gnfd-app/example.gif)

You can try out some examples directly in your browser through Stackblitz:

* [Next.js Exmaple(Typescript)](https://stackblitz.com/edit/github-kikred?file=src%2Fpages%2Ftx.tsx)
<!-- There are runnable examples included in the [examples](./examples/) folder

* [Next.js Example(TypeScript)](./examples/nextjs/README.md)
* [Nodejs](./examples/nodejs/README.md) -->

### Running Examples Locally

Clone the project and install dependencies:
<!--
1. Clone the project and install dependencies:

```bash
> git clone git@github.com:bnb-chain/greenfield-js-sdk.git
> cd greenfield-js-sdk
> pnpm install
```

Build package:
2. Build package:
```bash
> pnpm run -F "./packages/**" -r build
```

copy env template file:
3. copy env template file:
```bash
> cp .env.simple .env
```
Expand All @@ -60,13 +67,12 @@ NEXT_PUBLIC_TOKEN_HUB_CONTRACT_ADDRESS=
NEXT_PUBLIC_CROSS_CHAIN_CONTRACT_ADDRESS=
```

> The contract address may be outdated due to Greenfield reset, refer to https://docs.bnbchain.org/greenfield-docs/docs/guide/dapp/contract-list get the latest contract address.
> The contract address may be outdated due to Greenfield reset, refer to https://docs.bnbchain.org/greenfield-docs/docs/guide/dapp/contract-list get the latest contract address. -->


abd then run example:
<!-- abd then run example:
```bash
> npx next dev
```
``` -->

## Supported JS environments

Expand Down