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

Add a README about scripts. #685

Merged
merged 1 commit into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ tar xf node-v14.16.0-linux-x64.tar.xz
npm i -g yarn
```

### Helper Scripts

See the [scripts](scripts) directory.

### Running Eden with Ephemeral Chains Locally

Ephemeral chains are instances of the EOS blockchain spawned by `nodeos` locally, with manipulated data from our chain runners, eg: [Basic Genesis Runner](contracts/eden/tests/run-genesis.cpp), [Elections Runner](contracts/eden/tests/run-elections.cpp) (which finishes with an open, running election), and [Completed Elections Runner](contracts/eden/tests/run-complete-elections.cpp). By running a ephemeral chain you are in full control of the blockchain, giving you more flexibility to test the Eden contracts.
Expand Down
26 changes: 26 additions & 0 deletions scripts/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Helper Scripts

There are a few different types of scripts in this directory. Many of them by default use WAX Testnet and accounts on WAX Testnet from the files:

- `genesis_accounts` - 14 accounts (a subset of `genesis_accounts_long_list`)
- `genesis_accounts_long_list` - 66 accounts

...however you can customize these scripts to use whatever chain--remote or local--you want with whatever contract and user accounts you want. These can be used for one-off actions, or together in serial to stand up communities or process inductions. Modify at will to accomplish what you want. And if you create new, helpful scripts, submit them in PRs.

## Set up a new community

Make sure you have cleos up and running and keys properly imported. If you have access, you can get WAX Testnet keys from the Notion wiki. This assumes you already have the contract account set up on chain and contracts deployed.

1. If you've previously used the contract account for tests, run the `clearall` action to reset the community.
1. `init_community.sh` creates a new community in genesis mode with the accounts you specified.
1. `genesis_profiles.sh` sets up genesis members' profiles.
1. `genesis_donate.sh` transfers the donation amount to the contract account and then executes the action to donate. This completes genesis members' inductions. (Remember, in Genesis mode, the witness/endorsement step is not required.)

## Other scripts

- `election_opt_in_out.sh` - Bulk register members for an election
- `complete_induction.sh` - Set up a profile for a pending member induction
- `faucet_waxsweden.sh` - Get users more WAX Testnet tokens
- `create_test_accounts.sh` - Creates test accounts
- `docker_build.sh` - Build the contract using a Docker container
- `eden_chain_runner.sh` - See [Running Eden With Ephemeral Chains Locally](https://github.com/gofractally/Eden#running-eden-with-ephemeral-chains-locally)