Skip to content

Commit

Permalink
Update configs and images
Browse files Browse the repository at this point in the history
  • Loading branch information
zjb0807 committed Dec 7, 2023
1 parent f3b6ab5 commit bab4b3d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 35 deletions.
10 changes: 4 additions & 6 deletions config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Relaychain Configuration
relaychain:
image: parity/polkadot:v0.9.31 # the docker image to use
image: parity/polkadot:v1.4.0 # the docker image to use
chain: rococo-local # the chain to use
runtimeGenesisConfig: # additonal genesis override
configuration:
Expand All @@ -15,8 +15,7 @@ relaychain:
- --rpc-methods=unsafe
nodes: # nodes config
- name: alice # the node name and session key, this imply `--alice`
wsPort: 9944 # default ws port number is `9944 + global_node_index`
rpcPort: 9933 # default rpc port number is `9933 + global_node_index`
rpcPort: 9944 # default ws & rpc port number is `9944 + global_node_index`
port: 30333 # default libp2p port number is `30333 + global_node_index`
flags: # additional CLI flags for this node
- --force-authoring
Expand All @@ -28,7 +27,7 @@ relaychain:
# Parachain Configuration
parachains:
# Config for first parachain
- image: acala/karura-node:2.11.0
- image: acala/karura-node:2.21.0
chain: # this could be a string like `dev` or a config object
base: karura-local # the chain to use
collators: # override collators
Expand All @@ -55,8 +54,7 @@ parachains:
RUST_LOG: sc_basic_authorship=trace
volumePath: /acala/data # The path to mount volume and base path, default to /data
nodes: # nodes config
- wsPort: 9947
rpcPort: 9936
- rpcPort: 9947
port: 30336
flags: # additional CLI flags for this node
- --alice
Expand Down
4 changes: 2 additions & 2 deletions configs/acala.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
relaychain:
image: parity/polkadot:v0.9.31
image: parity/polkadot:v1.4.0
chain: rococo-local
runtimeGenesisConfig:
configuration:
Expand All @@ -17,7 +17,7 @@ relaychain:
- name: bob

parachains:
- image: acala/acala-node:2.11.0
- image: acala/acala-node:2.21.0
chain:
base: acala-local
collators:
Expand Down
4 changes: 2 additions & 2 deletions configs/karura.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
relaychain:
image: parity/polkadot:v0.9.31
image: parity/polkadot:v1.4.0
chain: rococo-local
runtimeGenesisConfig:
configuration:
Expand All @@ -17,7 +17,7 @@ relaychain:
- name: bob

parachains:
- image: acala/karura-node:2.11.0
- image: acala/karura-node:2.21.0
chain:
base: karura-local
collators:
Expand Down
18 changes: 6 additions & 12 deletions configs/kusama.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
relaychain:
image: parity/polkadot:v0.9.31
image: parity/polkadot:v1.4.0
chain: rococo-local
runtimeGenesisConfig:
configuration:
Expand All @@ -23,24 +23,20 @@ relaychain:
- --execution=wasm
nodes:
- name: alice
wsPort: 19944
rpcPort: 19933
rpcPort: 19944
port: 31333
- name: bob
wsPort: false
rpcPort: false
port: false
- name: charlie
wsPort: false
rpcPort: false
port: false
- name: dave
wsPort: false
rpcPort: false
port: false

parachains:
- image: acala/karura-node:2.11.0
- image: acala/karura-node:2.21.0
chain:
base: karura-local
collators:
Expand All @@ -60,11 +56,10 @@ parachains:
nodes:
- flags:
- --alice
wsPort: 19946
rpcPort: 19935
rpcPort: 19946
port: 31335

- image: bifrostnetwork/bifrost:bifrost-v0.9.66
- image: bifrostnetwork/bifrost:bifrost-v0.9.88
chain:
base: bifrost-local
sudo: alice
Expand All @@ -81,7 +76,6 @@ parachains:
nodes:
- flags:
- --alice
wsPort: 19947
rpcPort: 1996
rpcPort: 19947
port: 31336

2 changes: 1 addition & 1 deletion configs/relaychain-only.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
relaychain:
image: parity/polkadot:v0.9.31
image: parity/polkadot:v1.4.0
chain: rococo-local
runtimeGenesisConfig:
configuration:
Expand Down
21 changes: 10 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,9 @@ const generateRelaychainGenesisFile = (config: Config, path: string, output: str
const spec = getChainspec(relaychain.image, relaychain.chain);

// clear authorities
const runtime = spec.genesis.runtime;
const runtime = spec.genesis.runtimeGenesis;

const sessionKeys = runtime.runtime_genesis_config?.session?.keys || runtime.session.keys;
const sessionKeys = runtime.patch.session.keys;
sessionKeys.length = 0;

// add authorities from config
Expand Down Expand Up @@ -212,8 +212,8 @@ const generateRelaychainGenesisFile = (config: Config, path: string, output: str
}
});
}
_.merge(runtime.runtime_genesis_config || runtime, config.relaychain.runtimeGenesisConfig);
_.merge(runtime.runtime_genesis_config || runtime, config.relaychain.overrides);
_.merge(runtime.patch, config.relaychain.runtimeGenesisConfig);
_.merge(runtime.patch, config.relaychain.overrides);
}

// genesis parachains
Expand All @@ -230,7 +230,10 @@ const generateRelaychainGenesisFile = (config: Config, path: string, output: str
parachain: parachain.parachain,
},
];
(runtime.runtime_genesis_config || runtime).paras.paras.push(para);
if (runtime.patch && !runtime.patch.paras) {
runtime.patch.paras = { paras: [] };
}
runtime.patch.paras.paras.push(para);
}

const tmpfile = `${shell.tempdir()}/${config.relaychain.chain}.json`;
Expand Down Expand Up @@ -486,8 +489,7 @@ const generate = async (config: Config, { output, yes }: { output: string; yes:
const name = `relaychain-${_.kebabCase(node.name)}`;
const nodeConfig: DockerNode = {
ports: [
...(node.wsPort === false ? [] : [`${node.wsPort || 9944 + idx}:9944`]),
...(node.rpcPort === false ? [] : [`${node.rpcPort || 9933 + idx}:9933`]),
...(node.rpcPort === false ? [] : [`${node.rpcPort || 9944 + idx}:9944`]),
...(node.port === false ? [] : [`${node.port || 30333 + idx}:30333`]),
],
volumes: [`${name}:/data`],
Expand All @@ -499,7 +501,6 @@ const generate = async (config: Config, { output, yes }: { output: string; yes:
'--base-path=/data',
`--chain=/app/${config.relaychain.chain}.json`,
'--validator',
'--ws-external',
'--rpc-external',
'--rpc-cors=all',
`--name=${node.name}`,
Expand Down Expand Up @@ -528,8 +529,7 @@ const generate = async (config: Config, { output, yes }: { output: string; yes:

const nodeConfig: DockerNode = {
ports: [
`${parachainNode.wsPort || 9944 + idx}:9944`,
`${parachainNode.rpcPort || 9933 + idx}:9933`,
`${parachainNode.rpcPort || 9944 + idx}:9944`,
`${parachainNode.port || 30333 + idx}:30333`,
],
volumes: [`${name}:${volumePath}`],
Expand All @@ -540,7 +540,6 @@ const generate = async (config: Config, { output, yes }: { output: string; yes:
command: [
`--base-path=${volumePath}`,
`--chain=/app/${getChainspecName(parachain.chain, parachain.id)}`,
'--ws-external',
'--rpc-external',
'--rpc-cors=all',
`--name=${name}`,
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export interface Node {
name: string;
flags?: string[];
port?: number | false;
wsPort?: number | false;
rpcPort?: number | false;
relaychainFlags?: string[];
}
Expand Down

0 comments on commit bab4b3d

Please sign in to comment.