https://github.com/nervosnetwork/godwoken-examples
https://github.com/nervosnetwork/godwoken-examples
Last synced: over 1 year ago
JSON representation
- Host: GitHub
- URL: https://github.com/nervosnetwork/godwoken-examples
- Owner: nervosnetwork
- License: mit
- Created: 2020-12-24T06:04:28.000Z (over 5 years ago)
- Default Branch: develop
- Last Pushed: 2021-12-21T08:41:32.000Z (over 4 years ago)
- Last Synced: 2025-04-12T01:55:18.945Z (over 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 3.62 MB
- Stars: 5
- Watchers: 9
- Forks: 18
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Godwoken Examples
## Install dependencies & Build
```bash
yarn && yarn run build-all
```
## Update Tools Configs
Firstly copy config files.
```bash
export SCRIPT_DEPLOY_RESULT_PATH=
export GODWOKEN_CONFIG_PATH=
yarn run copy-configs
```
Or copy by yourself.
```bash
cp packages/tools/configs/scripts-deploy-result.json
cp packages/tools/configs/godwoken-config.toml
yarn run convert-config-format # convert `godwoken-config.toml` to `godwoken-config.json`
```
For testnet
```bash
yarn run generate-testnet-configs
```
## Generate your lumos config
If run dev chain, lumos config should generated by yourself, and [this tool](https://github.com/classicalliu/lumos-config-generator) may help you.
For example, in linux system
```bash
wget https://github.com/classicalliu/lumos-config-generator/releases/download/v0.1.1/lumos-config-generator-linux-amd64 -O lumos-config-generator
chmod +x ./lumos-config-generator
./lumos-config-generator
# `config.json` is the generated lumos config file.
```
## Account operations
Run `node ./packages/tools/lib/account-cli.js --help` to see how to `deposit`, `deposit-sudt`, `transfer`, `withdraw` and `get-balance`.
```bash
LUMOS_CONFIG_FILE= node ./packages/tools/lib/account-cli.js --help # for devnet
node ./packages/tools/lib/account-cli.js --help # for testnet
```
### Notes
If you switched to a new CKB chain, you should switch to a new indexer path `--indexer-path ` or just delete `indexer-data` dir.
## Polyjuice CLI
Run `node ./packages/tools/lib/polyjuice-cli.js --help` to see how to `creator creator account`, `deploy contract`, `call contract`.
```bash
node ./packages/tools/lib/polyjuice-cli.js --help # for devnet
ENABLE_TESTNET_MODE=true node ./packages/tools/lib/polyjuice-cli.js --help # for testnet
```