-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'DIVE-216-Testnet-setup-for-Integritee-Shell-Polkadot' of …
…https://github.com/HugoByte/polakadot-kurtosis-package into DIVE-216-Testnet-setup-for-Integritee-Shell-Polkadot
- Loading branch information
Showing
7 changed files
with
161 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
const { ApiPromise, WsProvider, Keyring } = require("@polkadot/api"); | ||
const fs = require("fs"); | ||
|
||
const run = async () => { | ||
try { | ||
console.log("Parsing Args ..."); | ||
// 0 & 1 are command context | ||
const endpoint = process.argv[2]; | ||
const seed = process.argv[3]; | ||
const id = process.argv[4]; | ||
const header = process.argv[5]; | ||
const wasmFile = process.argv[6]; | ||
|
||
const wsProvider = new WsProvider(endpoint); | ||
|
||
const api = await ApiPromise.create({ | ||
provider: wsProvider, | ||
}); | ||
|
||
const keyring = new Keyring({ type: "sr25519" }); | ||
const alice = keyring.addFromUri(seed); | ||
|
||
let wasm; | ||
try { | ||
wasm = fs.readFileSync(wasmFile, "utf8"); | ||
} catch (err) { | ||
console.error(err); | ||
throw err; | ||
} | ||
|
||
let paraGenesisArgs = { | ||
genesis_head: header, | ||
validation_code: wasm, | ||
parachain: true, | ||
}; | ||
|
||
let genesis = api.createType("ParaGenesisArgs", paraGenesisArgs); | ||
|
||
const nonce = Number((await api.query.system.account(alice.address)).nonce); | ||
|
||
console.log( | ||
`--- Submitting extrinsic to register parachain ${id}. (nonce: ${nonce}) ---` | ||
); | ||
const sudoCall = await api.tx.sudo | ||
.sudo(api.tx.parasSudoWrapper.sudoScheduleParaInitialize(id, genesis)) | ||
.signAndSend(alice, { nonce: nonce, era: 0 }, (result) => { | ||
console.log(`Current status is ${result.status}`); | ||
if (result.status.isInBlock) { | ||
console.log( | ||
`Transaction included at blockHash ${result.status.asInBlock}` | ||
); | ||
console.log("Waiting for finalization..."); | ||
} else if (result.status.isFinalized) { | ||
console.log( | ||
`Transaction finalized at blockHash ${result.status.asFinalized}` | ||
); | ||
sudoCall(); | ||
process.exit(); | ||
} else if (result.isError) { | ||
console.log(`Transaction Error`); | ||
process.exit(); | ||
} | ||
}); | ||
} catch (error) { | ||
console.log("error:", error); | ||
} | ||
}; | ||
|
||
run(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
def run_acala(plan): | ||
|
||
exec_command = [ | ||
"--chain=mandala-latest", | ||
"--collator", | ||
"--rpc-cors=all", | ||
"--rpc-port=9933", | ||
"--rpc-methods=unsafe", | ||
"--unsafe-rpc-external", | ||
"--unsafe-ws-external", | ||
"--tmp", | ||
"--execution=wasm" | ||
] | ||
|
||
acala_service_config = ServiceConfig( | ||
image = "acala/mandala-node:latest", | ||
files = { | ||
"/app": "configs", | ||
}, | ||
ports = { | ||
"ws": PortSpec(9944, transport_protocol = "TCP"), | ||
"rpc": PortSpec(9933, transport_protocol = "TCP"), | ||
}, | ||
cmd = exec_command, | ||
entrypoint= ["/usr/local/bin/acala"] | ||
) | ||
plan.add_service(name = "acala-node", config = acala_service_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
def run_bifrost(plan): | ||
exec_command = [ | ||
"--chain /specs/bifrost-testnet.json", | ||
"--port=30333", | ||
"--rpc-port=9933", | ||
"--rpc-cors=all", | ||
"--rpc-external" | ||
] | ||
|
||
service_config = ServiceConfig( | ||
image = "thebifrost/bifrost-node:latest", | ||
ports = { | ||
"rpc": PortSpec(9933, transport_protocol = "TCP"), | ||
"ws": PortSpec(30333, transport_protocol = "TCP"), | ||
}, | ||
entrypoint = exec_command, | ||
) | ||
|
||
plan.add_service(name="bifrost-node", service_config = service_config) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
def run_clover(plan): | ||
exec_command = [ | ||
"--base-path=/opt/chaindata", | ||
"--chain=/opt/specs/clover-preview-iris.json", | ||
"--port=30333", | ||
"--ws-port=9944", | ||
"--rpc-port=9933", | ||
"--rpc-cors=all", | ||
"--validator", | ||
"--unsafe-ws-external", | ||
"--unsafe-rpc-external", | ||
"--rpc-methods=Unsafe" | ||
] | ||
|
||
service_config = ServiceConfig( | ||
image = "cloverio/clover-iris:0.1.15", | ||
ports = { | ||
"ws": PortSpec(9944, transport_protocol="TCP"), | ||
"tcp": PortSpec(9933, transport_protocol="TCP") | ||
}, | ||
cmd = exec_command, | ||
entrypoint = ["/bin/sh", "-c", "/opt/clover/bin/clover"] | ||
) | ||
|
||
plan.add_service(name= "clover-node", config= service_config) | ||
|