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

Test staking #277

Merged
merged 20 commits into from
Mar 19, 2021
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
40 changes: 40 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,46 @@ by any relay chain, but still runs the Moonbeam runtime logic.
./target/release/moonbase-standalone --dev
```

### Dev Addresses

Launching the node in devmode will prefund a list of dev addresses that are derived from
the canonical mnemonic: "bottom drive obey lake curtain smoke basket hold race lonely fit walk"

#### Alith:

- Address:0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac
- PrivKey:0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133

#### Baltathar:

- Address:0x3Cd0A705a2DC65e5b1E1205896BaA2be8A07c6e0
- PrivKey:0x8075991ce870b93a8870eca0c0f91913d12f47948ca0fd25b49c6fa7cdbeee8b

#### Charleth:

- Address:0x798d4Ba9baf0064Ec19eB4F0a1a45785ae9D6DFc
- PrivKey:0x0b6e18cafb6ed99687ec547bd28139cafdd2bffe70e6b688025de6b445aa5c5b

#### Dorothy:

- Address:0x773539d4Ac0e786233D90A233654ccEE26a613D9
- PrivKey:0x39539ab1876910bbf3a223d84a29e28f1cb4e2e456503e7e91ed39b2e7223d68

#### Ethan:

- Address:0xFf64d3F6efE2317EE2807d223a0Bdc4c0c49dfDB
- PrivKey:0x7dce9bc8babb68fec1409be38c8e1a52650206a7ed90ff956ae8a6d15eeaaef4

#### Faith:

- Address:0xC0F0f4ab324C46e55D02D0033343B4Be8A55532d
- PrivKey:0xb9d2ea9a615f3165812e8d44de0d24da9bbd164b65c4f0573e1ce2c8dbd9c8df

#### Gerald:

- Address:0x7BF369283338E12C90514468aa3868A551AB2929
- PrivKey:0x96b8a38e12e1a31dee1eab2fffdf9d9990045f5b37e44d8cc27766ef294acf18

### Docker image

An alternative to building locally is to use docker to run a pre-build binary.
Expand Down
5 changes: 5 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,8 @@ And then run `yarn run moonbeam-launch`
### Change Config

Change the path in the config_moonbeam.json file to use polkadot in a different location.

### Generate Test Specs

To update the specs, run :
`./target/release/moonbeam build-spec --chain local >test.json`
8 changes: 4 additions & 4 deletions tools/config_moonbeam.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@
"parachains": [
{
"bin": "../target/release/moonbeam",
"id": "200",
"id": "1000",
"rpcPort": 36846,
"wsPort": 36946,
"port": 36335,
"balance": "1000",
"chain": "local",
"chain": "staking-test-spec.json",
"flags": [
"--no-telemetry",
"--no-prometheus",
Expand All @@ -39,12 +39,12 @@
},
{
"bin": "../target/release/moonbeam",
"id": "200",
"id": "1000",
"rpcPort": 36847,
"wsPort": 36947,
"port": 36336,
"balance": "1000",
"chain": "local",
"chain": "staking-test-spec.json",
"flags": [
"--no-telemetry",
"--no-prometheus",
Expand Down
84 changes: 84 additions & 0 deletions tools/config_moonbeam_staking.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"relaychain": {
"bin": "../../polkadot/target/release/polkadot",
"chain": "rococo-local",
"nodes": [
{
"name": "alice",
"wsPort": 36944,
"port": 36444
},
{
"name": "bob",
"wsPort": 36955,
"port": 36555
},
{
"name": "charlie",
"wsPort": 36956,
"port": 36556
},
{
"name": "dave",
"wsPort": 36957,
"port": 36557
}
]
},
"parachains": [
{
"bin": "../target/release/moonbeam",
"id": "1000",
"rpcPort": 36846,
"wsPort": 36946,
"port": 36335,
"balance": "1000",
"chain": "staking-test-spec.json",
"flags": [
"--no-telemetry",
"--no-prometheus",
"--author-id=6be02d1d3665660d22ff9624b7be0551ee1ac91b",
"--",
"--execution=wasm"
]
},
{
"bin": "../target/release/moonbeam",
"id": "1000",
"rpcPort": 36847,
"wsPort": 36947,
"port": 36336,
"balance": "1000",
"chain": "staking-test-spec.json",
"flags": [
"--no-telemetry",
"--no-prometheus",
"--author-id=C0F0f4ab324C46e55D02D0033343B4Be8A55532d",
"--",
"--execution=wasm"
]
},
{
"bin": "../target/release/moonbeam",
"id": "1000",
"rpcPort": 36848,
"wsPort": 36948,
"port": 36337,
"balance": "1000",
"chain": "staking-test-spec.json",
"flags": [
"--no-telemetry",
"--no-prometheus",
"--author-id=Ff64d3F6efE2317EE2807d223a0Bdc4c0c49dfDB",
"--",
"--execution=wasm"
]
}
],
"simpleParachains": [],
"hrmpChannels": [],
"types": {
"Address": "MultiAddress",
"LookupSource": "MultiAddress"
}
}
3 changes: 2 additions & 1 deletion tools/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"package-moon-key": "node_modules/.bin/tsc moon-key.ts; node_modules/.bin/pkg -t node14 moon-key.js; rm moon-key.js",
"build-moonbeam-launch": "yarn add PureStake/polkadot-launch#moonbeam-launch",
"moonbeam-launch": "yarn run build-moonbeam-launch && mkdir -p specFiles && ts-node moonbeam-launch.ts",
"moonbeam-test": "yarn run build-moonbeam-launch && mkdir -p specFiles && ts-node moonbeam-test.ts"
"moonbeam-test": "yarn run build-moonbeam-launch && mkdir -p specFiles && ts-node moonbeam-test.ts",
"test-staking": "yarn run build-moonbeam-launch && mkdir -p specFiles && ts-node test-staking.ts"
}
}
86 changes: 86 additions & 0 deletions tools/staking-test-spec.json

Large diffs are not rendered by default.

3 changes: 1 addition & 2 deletions tools/test-alpha.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
import { ApiPromise, WsProvider } from "@polkadot/api";
import Web3 from "web3";
import { typesBundle } from "../moonbeam-types-bundle";
import { FAITH } from "./test-constants";
const wsProviderUrl = `wss://wss.testnet.moonbeam.network`;
const GERALD = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b";
const FAITH = "0xC0F0f4ab324C46e55D02D0033343B4Be8A55532d";

export default async function test(ACC: string) {
const web3 = new Web3(wsProviderUrl);
Expand Down
14 changes: 14 additions & 0 deletions tools/test-constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
export const GERALD = "0x6be02d1d3665660d22ff9624b7be0551ee1ac91b";
export const FAITH = "0xC0F0f4ab324C46e55D02D0033343B4Be8A55532d";
export const ETHAN_PRIVKEY = "0x7dce9bc8babb68fec1409be38c8e1a52650206a7ed90ff956ae8a6d15eeaaef4";
export const ETHAN = "0xFf64d3F6efE2317EE2807d223a0Bdc4c0c49dfDB";
export const ALITH_PRIVKEY = "0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133";
export const ALITH = "0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac";
export const STAKING_AMOUNT = "1.0000 kUnit";

export const GLMR = 1_000_000_000_000_000_000n;
export const MIN_GLMR_STAKING = 1000n * GLMR;
export const MIN_GLMR_NOMINATOR = 5n * GLMR;
export const DEFAULT_GENESIS_BALANCE = 2n ** 80n;
export const DEFAULT_GENESIS_STAKING = 1_000n * GLMR;
export const GENESIS_ACCOUNT_BALANCE = DEFAULT_GENESIS_BALANCE - DEFAULT_GENESIS_STAKING;
Loading