Skip to content

Commit

Permalink
fix for Karura
Browse files Browse the repository at this point in the history
  • Loading branch information
xlc authored Sep 2, 2021
1 parent f12f849 commit 0eab4d7
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ relaychain:
flags: # additional CLI flags for this node
- --force-authoring
env:
RUST_LOG: debug # environment varitables for this node
RUST_LOG: babe=debug # environment varitables for this node
- name: bob
- name: charlie

Expand All @@ -46,6 +46,7 @@ parachains:
- --no-beefy
env: # environment variables for this parachain nodes
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
Expand All @@ -55,7 +56,7 @@ parachains:
relaychainFlags: # additional CLI flags for relaychian part
- --name=relaychain-alice
env:
RUST_LOG: debug # environment varitables for this node
RUST_LOG: aura=debug # environment varitables for this node
- flags:
- --bob
- flags:
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"scripts": {
"build": "tsc --build tsconfig.json",
"lint": "polkadot-dev-run-lint",
"start": "node lib/index.js"
"start": "ts-node src/index.ts"
},
"dependencies": {
"@polkadot/api": "^5.6.1",
Expand Down
5 changes: 3 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -440,6 +440,7 @@ const generate = async (config: Config, { output, yes }: { output: string; yes:
let nodeIdx = 0;

const { key: nodeKey, address: nodeAddress } = generateNodeKey(parachain.image);
const volumePath = parachain.volumePath || '/data';

for (const parachainNode of parachain.nodes) {
const name = `parachain-${parachain.id}-${nodeIdx}`;
Expand All @@ -450,13 +451,13 @@ const generate = async (config: Config, { output, yes }: { output: string; yes:
`${parachainNode.rpcPort || 9933 + idx}:9933`,
`${parachainNode.port || 30333 + idx}:30333`,
],
volumes: [`${name}:/data`],
volumes: [`${name}:${volumePath}`],
build: {
context: '.',
dockerfile: `parachain-${parachain.id}.Dockerfile`,
},
command: [
'--base-path=/data',
`--base-path=${volumePath}`,
`--chain=/app/${typeof parachain.chain === 'string' ? parachain.chain : parachain.chain.base}-${
parachain.id
}.json`,
Expand Down
7 changes: 4 additions & 3 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ export interface Parachain {
image: string;
chain: Chain | string;
parachain: boolean;
flags: string[];
relaychainFlags: string[];
env: Env;
flags?: string[];
relaychainFlags?: string[];
env?: Env;
volumePath?: string;
nodes: Node[];
}

Expand Down

0 comments on commit 0eab4d7

Please sign in to comment.