mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-06 17:18:03 +00:00
Update parachain registration script to new extrinsic (#252)
* Update parachain registration script to new extrinsic * Update parachain registration script
This commit is contained in:
committed by
GitHub
parent
ba1fa36411
commit
fbcc76690e
@@ -2,7 +2,7 @@
|
||||
|
||||
usage() {
|
||||
echo Usage:
|
||||
echo "$0 <url> <seed> <wasm> <genesis> <parachain-id> <tokens> <account>"
|
||||
echo "$0 <url> <seed> <wasm> <genesis> <parachain-id> <types>"
|
||||
exit 1
|
||||
}
|
||||
|
||||
@@ -11,24 +11,26 @@ seed=$2
|
||||
wasm=$3
|
||||
genesis=$4
|
||||
parachain_id=$5
|
||||
tokens=$6
|
||||
account=$7
|
||||
types=$6 # we can remove this once parachain types are included in polkadot-js-api
|
||||
|
||||
[ -z "$url" ] && usage
|
||||
[ -z "$seed" ] && usage
|
||||
[ -z "$wasm" ] && usage
|
||||
[ -z "$types" ] && usage
|
||||
[ -z "$genesis" ] && usage
|
||||
[ -z "$parachain_id" ] && usage
|
||||
[ -z "$tokens" ] && usage
|
||||
[ -z "$account" ] && usage
|
||||
if ! [ -r "$wasm" ]; then
|
||||
echo "Could not read: $wasm"
|
||||
exit 1
|
||||
fi
|
||||
if ! [ -r "$types" ]; then
|
||||
echo "Could not read: $types"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if ! which polkadot-js-api &> /dev/null; then
|
||||
echo 'command `polkadot-js-api` not in PATH'
|
||||
echo "npm install -g @polkadot/api-cli"
|
||||
echo "npm install -g @polkadot/api-cli@beta"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -36,21 +38,13 @@ set -e -x
|
||||
|
||||
test -f "$seed" && seed="$(cat "$seed")"
|
||||
|
||||
polkadot-js-api \
|
||||
--ws "${url?}" \
|
||||
--sudo \
|
||||
--seed "${seed?}" \
|
||||
tx.registrar.registerPara \
|
||||
"${parachain_id?}" \
|
||||
'{"scheduling":"Always"}' \
|
||||
@"${wasm?}" \
|
||||
"${genesis?}"
|
||||
wasm=$(cat $wasm)
|
||||
|
||||
polkadot-js-api \
|
||||
--ws "${url?}" \
|
||||
--sudo \
|
||||
--seed "${seed?}" \
|
||||
tx.balances.setBalance \
|
||||
"${account?}" \
|
||||
$((tokens * 10 ** 12)) \
|
||||
0
|
||||
--types "${types?}" \
|
||||
tx.parasSudoWrapper.sudoScheduleParaInitialize \
|
||||
"${parachain_id?}" \
|
||||
"{ \"genesisHead\":\"${genesis?}\", \"validationCode\":\"${wasm?}\", \"parachain\": true }" \
|
||||
|
||||
@@ -0,0 +1,64 @@
|
||||
{
|
||||
"HrmpChannelId": {
|
||||
"sender": "u32",
|
||||
"receiver": "u32"
|
||||
},
|
||||
"SignedAvailabilityBitfield": {
|
||||
"payload": "BitVec",
|
||||
"validator_index": "u32",
|
||||
"signature": "Signature"
|
||||
},
|
||||
"SignedAvailabilityBitfields": "Vec<SignedAvailabilityBitfield>",
|
||||
"ValidatorSignature": "Signature",
|
||||
"HeadData": "Vec<u8>",
|
||||
"CandidateDescriptor": {
|
||||
"para_id": "u32",
|
||||
"relay_parent": "Hash",
|
||||
"collator_id": "Hash",
|
||||
"persisted_validation_data_hash": "Hash",
|
||||
"pov_hash": "Hash",
|
||||
"erasure_root": "Hash",
|
||||
"signature": "Signature"
|
||||
},
|
||||
"CandidateReceipt": {
|
||||
"descriptor": "CandidateDescriptor",
|
||||
"commitments_hash": "Hash"
|
||||
},
|
||||
"UpwardMessage": "Vec<u8>",
|
||||
"OutboundHrmpMessage": {
|
||||
"recipient": "u32",
|
||||
"data": "Vec<u8>"
|
||||
},
|
||||
"ValidationCode": "Vec<u8>",
|
||||
"CandidateCommitments": {
|
||||
"upward_messages": "Vec<UpwardMessage>",
|
||||
"horizontal_messages": "Vec<OutboundHrmpMessage>",
|
||||
"new_validation_code": "Option<ValidationCode>",
|
||||
"head_data": "HeadData",
|
||||
"processed_downward_messages": "u32",
|
||||
"hrmp_watermark": "BlockNumber"
|
||||
},
|
||||
"CommittedCandidateReceipt": {
|
||||
"descriptor": "CandidateDescriptor",
|
||||
"commitments": "CandidateCommitments"
|
||||
},
|
||||
"ValidityAttestation": {
|
||||
"_enum": {
|
||||
"DummyOffsetBy1": "Raw",
|
||||
"Implicit": "ValidatorSignature",
|
||||
"Explicit": "ValidatorSignature"
|
||||
}
|
||||
},
|
||||
"BackedCandidate": {
|
||||
"candidate": "CommittedCandidateReceipt",
|
||||
"validity_votes": "Vec<ValidityAttestation>",
|
||||
"validator_indices": "BitVec"
|
||||
},
|
||||
"CandidatePendingAvailablility": {
|
||||
"core": "u32",
|
||||
"descriptor": "CandidateDescriptor",
|
||||
"availability_votes": "BitVec",
|
||||
"relay_parent_number": "BlockNumber",
|
||||
"backed_in_number": "BlockNumber"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user