Skip to content

Commit

Permalink
feat: implement testnet setup for parachains
Browse files Browse the repository at this point in the history
  • Loading branch information
shanithkk committed Nov 9, 2023
1 parent d42553d commit a9e5d33
Show file tree
Hide file tree
Showing 7 changed files with 1,234 additions and 45 deletions.
1 change: 1 addition & 0 deletions main.star
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ def run(plan, args):

else:
relay_chain.start_relay_chain(plan, args)
parachain.run_testnet(plan, args, "encointer")

return service_details
1 change: 1 addition & 0 deletions package_io/constant.star
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ EDIT_BUILD_SPEC = "edit-build-spec"
CURL_JQ_IMAGE = "badouralix/curl-jq"
NODE_IMAGE = "node:21.1"
PARA_SLOT_REGISTER_SERVICE_NAME = "para-slot-registration"
TEST_CHAIN = ["manta", "khala", "phala"]
41 changes: 40 additions & 1 deletion parachain/parachain.star
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,43 @@ def start_nodes(plan, args, relay_chain_ip):
for parachain in parachains:
para_id = register_para_slot.register_para_id(plan, relay_chain_ip)
start_local_parachain_node(plan, parachain, para_id)
register_para_slot.onboard_genesis_state_and_wasm(plan, para_id, parachain)
register_para_slot.onboard_genesis_state_and_wasm(plan, para_id, parachain, relay_chain_ip)

def run_testnet_node_with_entrypoint(plan, args, image, chain_name, execute_command):
service_config = ServiceConfig(
image = image,
ports = {
"ws": PortSpec(9944, transport_protocol = "TCP"),
},
files = {
"/app": "configs",
},
entrypoint = execute_command,
)

plan.add_service(name = "{0}".format(chain_name), config = service_config)

def run_testnet_node_with_command(plan, args, image, chain_name, execute_command):
service_config = ServiceConfig(
image = image,
ports = {
"ws": PortSpec(9944, transport_protocol = "TCP"),
},
files = {
"/app": "configs",
},
cmd = execute_command,
)

plan.add_service(name = "{0}".format(chain_name), config = service_config)

def run_testnet(plan, args, parachain):
parachain_details = parachain_list.testnet_chains[parachain]
image = parachain_details["image"]
command = parachain_details["command"]

if parachain in constant.TEST_CHAIN:
run_testnet_node_with_entrypoint(plan, args, image, parachain, command)

else:
run_testnet_node_with_command(plan, args, image, parachain, command)
2 changes: 1 addition & 1 deletion parachain/register-para-id.star
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def register_para_id(plan, alice_ip):

return para_id["output"]

def onboard_genesis_state_and_wasm(plan, para_id, chain_name):
def onboard_genesis_state_and_wasm(plan, para_id, chain_name, alice_ip):
service = plan.add_service(
name = "upload-genesis-file",
config = ServiceConfig(
Expand Down
1,087 changes: 1,087 additions & 0 deletions parachain/static_files/configs/soonsocial.json

Large diffs are not rendered by default.

135 changes: 98 additions & 37 deletions parachain/static_files/images.star
Original file line number Diff line number Diff line change
Expand Up @@ -3,172 +3,233 @@ parachain_images = {
"acala": {
"image": "acala/mandala-node:latest",
"entrypoint": "/usr/local/bin/acala",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"ajuna": {
"image": "ajuna/parachain-ajuna:latest",
"entrypoint": "/usr/local/bin/ajuna",
"base": ["dev","testnet","mainnet"]
"base": ["dev", None, "mainnet"],
},

"bifrost": {
"image": "bifrostnetwork/bifrost:latest",
"entrypoint": "/usr/local/bin/bifrost",
"base": ["bifrost-local","testnet","mainnet"]
"base": ["bifrost-local", "bifrost-kusama-rococo", "bifrost-polkadot"],
},
"centrifuge": {
"image": "centrifugeio/centrifuge-chain:test-main-latest",
"entrypoint": "/usr/local/bin/centrifuge-chain",
"base": ["centrifuge-local","testnet","mainnet"]
"base": ["centrifuge-local", "catalyst", "centrifuge"],
},
"clover": {
"image": "cloverio/clover-para:v0.1.24",
"entrypoint": "/opt/clover/bin/clover",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"frequency": {
"image": "frequencychain/collator-node-local:latest",
"entrypoint": "/frequency/target/release/frequency",
"base": ["frequency-rococo-local","testnet","mainnet"]
"base": ["frequency-rococo-local", "frequency-rococo", "frequency"],
},
"integritee": {
"image": "integritee/parachain",
"entrypoint": "/usr/local/bin/integritee-collator",
"base": ["integritee-rococo","testnet","mainnet"]
"base": ["integritee-rococo", "testnet", "mainnet"],
},
"interlay": {
"image": "interlayhq/interbtc:latest",
"entrypoint": "/usr/local/bin/interbtc-parachain",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "interlay-testnet-latest", "interlay-latest"],
},
"kilt-spiritnet ": {
"image": "kiltprotocol/kilt-node:latest",
"entrypoint": "/usr/local/bin/node-executable",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"kylin": {
"image": "kylinnetworks/kylin-collator:ro-v0.9.30",
"entrypoint": "/usr/local/bin/kylin-collator",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "pichiu-westend", "kylin"],
},
"litentry": {
"image": "litentry/litentry-parachain:latest",
"entrypoint": "/usr/local/bin/litentry-collator",
"base": ["litentry-dev","testnet","mainnet"]
"base": ["litentry-dev", "testnet", "mainnet"],
},
"manta":{
"manta": {
"image": "mantanetwork/manta:latest",
"entrypoint": "/usr/local/bin/manta",
"base": ["manta-local","testnet","mainnet"]
"base": ["manta-local", "manta-testnet", "manta"],
},
"moonbeamfoundation/moonbeam": {
"image": "moonbeamfoundation/moonbeam:sha-32933811",
"entrypoint": "/moonbeam/moonbeam",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"moonsama": {
"image": "moonsama/moonsama-node:latest",
"entrypoint": "/moonsama/moonsama-node",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"nodle": {
"image": "nodlecode/chain:latest",
"entrypoint": "nodle-parachain",
"base": ["local","testnet","mainnet"]
"base": ["local", "testnet", "mainnet"],
},
"parallel": {
"image": "parallelfinance/parallel:latest",
"entrypoint": "/parallel/.entrypoint.sh",
"base": ["kerria-dev","testnet","mainnet"]
"base": ["kerria-dev", "testnet", "parallel"],
},
"pendulum": {
"image": "pendulumchain/pendulum-collator:latest",
"entrypoint": "/usr/local/bin/pendulum-collator",
"base": ["litentry-dev","testnet","mainnet"]
"base": ["litentry-dev", "testnet", "mainnet"],
},
"phala-network": {
"image": "litentry/litentry-parachain:latest",
"entrypoint": "/usr/local/bin/litentry-collator",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "rhala", "phala"],
},
"polkadex": {
"image": "polkadex/parachain:latest",
"entrypoint": "/usr/local/bin/parachain-polkadex-node",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"subsocial": {
"image": "dappforce/subsocial-parachain:latest",
"entrypoint": "/usr/local/bin/subsocial-collator",
"base": ["local-rococo","testnet","mainnet"]
"base": ["local-rococo", None, ""],
},
"zeitgeist": {
"image": "zeitgeistpm/zeitgeist-node-parachain",
"entrypoint": "/usr/local/bin/zeitgeist",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"encointer-network": {
"image": "encointer/parachain:1.5.1",
"entrypoint": "/usr/local/bin/encointer-collator",
"base": ["encointer-rococo-local","testnet","mainnet"]
"base": ["encointer-rococo-local", "encointer-rococo", "mainnet"],
},
"altair": {
"image": "centrifugeio/centrifuge-chain:test-main-latest",
"entrypoint": "/usr/local/bin/centrifuge-chain",
"base": ["altair-local","testnet","mainnet"]
"base": ["altair-local", "testnet", "mainnet"],
},
"bajuna": {
"bajun": {
"image": "ajuna/parachain-bajun:latest",
"entrypoint": "/usr/local/bin/ajuna",
"base": ["local","testnet","mainnet"]
"base": ["local", None, "mainnet"],
},
"calamari": {
"image": "mantanetwork/manta:latest",
"entrypoint": "/usr/local/bin/manta",
"base": ["calamari-local","testnet","mainnet"]
"base": ["calamari-local", "manta-testnet", "manta"],
},
"karura": {
"image": "acala/karura-node:latest",
"entrypoint": "/usr/local/bin/acala",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"khala network": {
"image": "phalanetwork/khala-node:latest",
"entrypoint": "/usr/local/bin/khala-node",
"base": ["khala-dev-2004","testnet","mainnet"]
"base": ["khala-dev-2004", "rhala", "khala"],
},
"kintsugi-btc": {
"image": "interlayhq/interbtc:latest",
"entrypoint": "tini -- /usr/local/bin/interbtc-parachain",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"litmus": {
"image": "litentry/litentry-parachain:latest",
"entrypoint": "/usr/local/bin/litentry-collator",
"base": ["litmus-dev","testnet","mainnet"]
"base": ["litmus-dev", "testnet", "mainnet"],
},
"mangata": {
"image": "mangatasolutions/mangata-node:ci-e2e-jobs-fix-MGX-785-fast",
"entrypoint": "/mangata/node",
"base": ["rococo-local","testnet","mainnet"]
"base": ["rococo-local", "testnet", "mainnet"],
},
"moonriver": {
"image": "moonbeamfoundation/moonbeam:sha-519bd694",
"entrypoint": "/moonbeam/moonbeam",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "alphanet", "moonriver"],
},
"robonomics": {
"image": "robonomics/robonomics:latest",
"entrypoint": "/usr/local/bin/robonomics",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"subzero": {
"image": "playzero/subzero:latest",
"entrypoint": "/usr/local/bin/subzero",
"base": ["dev","testnet","mainnet"]
"base": ["dev", "testnet", "mainnet"],
},
"turing": {
"image": "oaknetwork/turing:latest",
"entrypoint": "./oak-collator",
"base": ["turing-dev","testnet","mainnet"]
"base": ["turing-dev", "testnet", "mainnet"],
},
}

testnet_chains = {
"ajuna": {
"image": "ajuna/parachain-bajun:latest",
"command": ["--chain=/bajun/rococo/bajun-raw.json", "--ws-port=9944", "--rpc-port=9933", "--rpc-cors=all", "--unsafe-ws-external"],
},
"bajun": {
"image": "ajuna/parachain-bajun:latest",
"command": ["--chain=/bajun/rococo/bajun-raw.json", "--ws-port=9944", "--rpc-port=9933", "--rpc-cors=all", "--unsafe-ws-external"],
},
"frequency": {
"image": "frequencychain/parachain-node-rococo",
"command": ["--rpc-port=9944", "--rpc-external", "--rpc-cors=all", "--unsafe-rpc-external"], # No ws ports
},
"centrifuge": {
"image": "centrifugeio/centrifuge-chain:main-latest",
"command": ["--chain=catalyst", "--collator", "--rpc-external", "--rpc-cors=all", "--rpc-methods=unsafe", "--unsafe-ws-external"],
},
"interlay": {
"image": "interlayhq/interbtc:latest",
"command": ["--chain=interlay-testnet-latest", "--force-authoring", "--ws-port=9944", "--rpc-port=9933", "--rpc-external", "--rpc-cors=all", "--rpc-methods=Unsafe", "--unsafe-ws-external", "--", "--chain=rococo"],
},
"kylin": {
"image": "kylinnetworks/kylin-collator:ro-v0.9.30",
"command": ["--base-path=/kylin/data", "--chain=pichiu-westend", "--ws-external", "--rpc-external", "--rpc-cors=all", "--unsafe-ws-external", "--name=parachain-2010-0", "--collator", "--rpc-methods=unsafe", "--force-authoring", "--execution=wasm"],
},
"manta": {
"image": "mantanetwork/manta:latest",
"command": ["/usr/local/bin/manta", "--chain=manta-testnet", "--wasm-execution=compiled", "--force-authoring", "--port=30333", "--rpc-port=9944", "--rpc-external", "--rpc-cors=all", "--rpc-methods=Unsafe", "--", "--chain=rococo"],
},
"khala": {
"image": "phalanetwork/khala-node:latest",
"command": ["/usr/local/bin/khala-node", "--chain=rhala", "--ws-external", "--rpc-external", "--rpc-cors=all", "--name=parachain-2010-0", "--collator", "--rpc-methods=unsafe", "--force-authoring", "--execution=wasm"],
},
"phala": {
"image": "phalanetwork/khala-node:latest",
"command": ["/usr/local/bin/khala-node", "--chain=rhala", "--ws-external", "--rpc-external", "--rpc-cors=all", "--name=parachain-2010-0", "--collator", "--rpc-methods=unsafe", "--force-authoring", "--execution=wasm"],
},
"subsocial": {
"image": "dappforce/subsocial-parachain:latest",
"command": ["--collator", "--chain=/app/soonsocial.json", "--port=40335", "--ws-port=9944", "--unsafe-ws-external"],
},
"litmus": {
"image": "dappforce/subsocial-parachain:latest",
"command": ["--chain=rococo", "--rpc-port=9933", "--rpc-external", "--rpc-cors=all", "--rpc-methods=unsafe", "--execution=wasm", "--unsafe-ws-external"],
},
"moonriver": {
"image": "moonbeamfoundation/moonbeam:sha-519bd694",
"command": ["--chain=alphanet", "--collator", "--rpc-external", "--rpc-cors=all", "--rpc-methods=unsafe", "--tmp", "--unsafe-rpc-external"],
},
"encointer": {
"image": "encointer/parachain:1.5.1",
"command": ["--collator", "--chain=encointer-rococo", "--rpc-port=9944", "--unsafe-rpc-external", "--rpc-cors=all", "--", "--execution=wasm", "--chain=rococo"], # no ws port
},
}

mainnet = {
"subsocial": {
"image": "dappforce/subsocial-parachain:latest",
"command": ["--collator", "--port=40335", "--ws-port=9944", "--unsafe-ws-external"], # we dont need to give --chain,
},
}
12 changes: 6 additions & 6 deletions parachain/testnet-setup/bifrost.star
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
def run_bifrost(plan):
exec_command = [
"--chain /specs/bifrost-testnet.json",
"--port=30333",
"--port=9944",
"--rpc-port=9933",
"--rpc-cors=all",
"--rpc-external"
]
"--rpc-external",
]

service_config = ServiceConfig(
image = "thebifrost/bifrost-node:latest",
ports = {
"rpc": PortSpec(9933, transport_protocol = "TCP"),
"ws": PortSpec(30333, transport_protocol = "TCP"),
"rpc": PortSpec(9944, transport_protocol = "TCP"),
"ws": PortSpec(9933, transport_protocol = "TCP"),
},
entrypoint = exec_command,
)

plan.add_service(name="bifrost-node", service_config = service_config)
plan.add_service(name = "bifrost-node", service_config = service_config)

0 comments on commit a9e5d33

Please sign in to comment.