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

Document support for config.js #155

Merged
merged 5 commits into from Nov 29, 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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .prettierignore
@@ -0,0 +1,4 @@
dist
node_modules
README.md
*.json
7 changes: 6 additions & 1 deletion README.md
Expand Up @@ -45,8 +45,13 @@ polkadot-launch config.json
### Configuration File

The required configuration file defines the properties of the network you want to set up.
You may use a json or a js file.

You can see an example [here](config.json).
You can see the examples:
- [config.json](config.json)
- [config.js](config.js)

You may find the .js alternative more convenient if you need comments, trailing commas or if you prefer do dedup some portions of the config.

#### `relaychain`

Expand Down
92 changes: 92 additions & 0 deletions config.js
@@ -0,0 +1,92 @@
// Collator flags
var flags = ["--force-authoring", "--", "--execution=wasm"];

var config = {
relaychain: {
bin: "./bin/polkadot",
chain: "rococo-local",
nodes: [
{
name: "alice",
wsPort: 9944,
port: 30444,
},
{
name: "bob",
wsPort: 9955,
port: 30555,
},
{
name: "charlie",
wsPort: 9966,
port: 30666,
},
{
name: "dave",
wsPort: 9977,
port: 30777,
},
],
genesis: {
runtime: {
runtime_genesis_config: {
configuration: {
config: {
validation_upgrade_frequency: 1,
validation_upgrade_delay: 1,
},
},
},
},
},
},
parachains: [
{
bin: "./bin/polkadot-collator",
id: "200",
balance: "1000000000000000000000",
nodes: [
{
wsPort: 9988,
port: 31200,
name: "alice",
flags,
},
],
},
{
bin: "./bin/polkadot-collator",
id: "300",
balance: "1000000000000000000000",
nodes: [
{
wsPort: 9999,
port: 31300,
name: "alice",
flags,
},
],
},
],
simpleParachains: [
{
bin: "./bin/adder-collator",
id: "400",
port: "31400",
name: "alice",
balance: "1000000000000000000000",
},
],
hrmpChannels: [
{
sender: 200,
recipient: 300,
maxCapacity: 8,
maxMessageSize: 512,
},
],
types: {},
finalization: false,
};

module.exports = config;