mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-18 06:01:02 +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() {
|
usage() {
|
||||||
echo Usage:
|
echo Usage:
|
||||||
echo "$0 <url> <seed> <wasm> <genesis> <parachain-id> <tokens> <account>"
|
echo "$0 <url> <seed> <wasm> <genesis> <parachain-id> <types>"
|
||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -11,24 +11,26 @@ seed=$2
|
|||||||
wasm=$3
|
wasm=$3
|
||||||
genesis=$4
|
genesis=$4
|
||||||
parachain_id=$5
|
parachain_id=$5
|
||||||
tokens=$6
|
types=$6 # we can remove this once parachain types are included in polkadot-js-api
|
||||||
account=$7
|
|
||||||
|
|
||||||
[ -z "$url" ] && usage
|
[ -z "$url" ] && usage
|
||||||
[ -z "$seed" ] && usage
|
[ -z "$seed" ] && usage
|
||||||
[ -z "$wasm" ] && usage
|
[ -z "$wasm" ] && usage
|
||||||
|
[ -z "$types" ] && usage
|
||||||
[ -z "$genesis" ] && usage
|
[ -z "$genesis" ] && usage
|
||||||
[ -z "$parachain_id" ] && usage
|
[ -z "$parachain_id" ] && usage
|
||||||
[ -z "$tokens" ] && usage
|
|
||||||
[ -z "$account" ] && usage
|
|
||||||
if ! [ -r "$wasm" ]; then
|
if ! [ -r "$wasm" ]; then
|
||||||
echo "Could not read: $wasm"
|
echo "Could not read: $wasm"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
if ! [ -r "$types" ]; then
|
||||||
|
echo "Could not read: $types"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
if ! which polkadot-js-api &> /dev/null; then
|
if ! which polkadot-js-api &> /dev/null; then
|
||||||
echo 'command `polkadot-js-api` not in PATH'
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@@ -36,21 +38,13 @@ set -e -x
|
|||||||
|
|
||||||
test -f "$seed" && seed="$(cat "$seed")"
|
test -f "$seed" && seed="$(cat "$seed")"
|
||||||
|
|
||||||
polkadot-js-api \
|
wasm=$(cat $wasm)
|
||||||
--ws "${url?}" \
|
|
||||||
--sudo \
|
|
||||||
--seed "${seed?}" \
|
|
||||||
tx.registrar.registerPara \
|
|
||||||
"${parachain_id?}" \
|
|
||||||
'{"scheduling":"Always"}' \
|
|
||||||
@"${wasm?}" \
|
|
||||||
"${genesis?}"
|
|
||||||
|
|
||||||
polkadot-js-api \
|
polkadot-js-api \
|
||||||
--ws "${url?}" \
|
--ws "${url?}" \
|
||||||
--sudo \
|
--sudo \
|
||||||
--seed "${seed?}" \
|
--seed "${seed?}" \
|
||||||
tx.balances.setBalance \
|
--types "${types?}" \
|
||||||
"${account?}" \
|
tx.parasSudoWrapper.sudoScheduleParaInitialize \
|
||||||
$((tokens * 10 ** 12)) \
|
"${parachain_id?}" \
|
||||||
0
|
"{ \"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