Skip to content

Commit 59b698f

Browse files
Kailai-WangBillyWooo
authored andcommitted
Cherry-Pick: 4738643
Use rococo as dev network (#918) * add rococo staging * cargo update * update README * fix bad english
1 parent 4890717 commit 59b698f

File tree

5 files changed

+36
-18
lines changed

5 files changed

+36
-18
lines changed

README.md

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The Litentry parachain.
99
Similar to polkadot, different chain-specs/runtimes are compiled into one single binary: in our case it's:
1010
- litentry-parachain-runtime (on polkadot)
1111
- litmus-parachain-runtime (on kusama)
12+
- rococo-parachain-runtime (on rococo)
1213

1314
Therefore, when building node binary or docker image, no distinction is required. But when building runtime/starting binary/running tests, the chain type must be explicitly given. See the examples below.
1415
## Lists of make targets
@@ -39,28 +40,29 @@ make build-runtime-litentry
3940
```
4041
The wasms should be located under `target/release/wbuild/litentry-parachain-runtime/`
4142

42-
Similarly, use `make build-runtime-litmus` to build the litmus-parachain-runtime.
43+
Similarly, use `make build-runtime-litmus` and `make build-runtime-rococo` to build the litmus-parachain-runtime and rococo-parachain-runtime, respectively.
4344

4445
## launch of local network
4546

47+
The following steps take rococo-parachain for example, because `sudo` will be removed for litentry-parachain and [was removed](https://github.com/litentry/litentry-parachain/issues/775) for litmus-parachain. But generally speaking, lauching a local network works with either of the three chain-settings.
48+
4649
To start a local network with 2 relaychain nodes and 1 parachain node, there're two ways:
4750

48-
### 1. use docker images for both polkadot and litentry-parachain (preferred)
49-
Take the litentry-parachain for example:
51+
### 1. use docker images for both polkadot and parachain (preferred)
5052
```
51-
make launch-docker-litentry
53+
make launch-docker-rococo
5254
```
5355
[parachain-launch](https://github.com/open-web3-stack/parachain-launch) will be installed and used to generate chain-specs and docker-compose files.
5456

55-
The generated files will be under `docker/generated-litentry/`.
57+
The generated files will be under `docker/generated-rococo/`.
5658

5759
When finished with the network, run
5860
```
59-
make clean-docker-litentry
61+
make clean-docker-rococo
6062
```
6163
to stop the processes and tidy things up.
6264

63-
### 2. use raw binaries for both polkadot and litentry-parachain
65+
### 2. use raw binaries for both polkadot and parachain
6466

6567
Only when option 1 doesn't work and you suspect the docker-image went wrong.
6668

@@ -69,34 +71,34 @@ In this case we could try to launch the network with raw binaries.
6971
**On Linux host:**
7072

7173
- you should have the locally compiled `./target/release/litentry-collator` binary.
72-
- run `make launch-binary-litentry`
74+
- run `make launch-binary-rococo`
7375

7476
**On Non-Linux host:**
7577

7678
- you should have locally compiled binaries, for both `polkadot` and `litentry-collator`
77-
- run `./scripts/launch-local-binary.sh litentry path-to-polkadot-bin path-to-litentry-parachain-bin`
79+
- run `./scripts/launch-local-binary.sh rococo path-to-polkadot-bin path-to-litentry-parachain-bin`
7880

7981
When finished with the network, run
8082
```
8183
make clean-binary
8284
```
8385
to stop the processes and tidy things up.
84-
Note this command should work for both litentry and litmus (you don't have to differentiate them).
86+
Note this command should work for all parachain types (you don't have to differentiate them).
8587

8688
## run ts tests locally
8789

8890
To run the ts tests locally, similar to launching the networks, it's possible to run them in either docker or binary mode:
8991
```
90-
make test-ts-docker-litentry
92+
make test-ts-docker-rococo
9193
```
9294
or
9395
```
9496
# if on Linux
95-
make test-ts-binary-litentry
97+
make test-ts-binary-rococo
9698
9799
# otherwise
98-
./scripts/launch-local-binary.sh litentry path-to-polkadot-bin path-to-litentry-parachain-bin
99-
./scripts/run-ts-test.sh litentry
100+
./scripts/launch-local-binary.sh rococo path-to-polkadot-bin path-to-litentry-parachain-bin
101+
./scripts/run-ts-test.sh rococo
100102
```
101103
Remember to run the clean-up afterwards.
102104

node/src/chain_specs/litmus.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ pub fn get_chain_spec_dev() -> ChainSpec {
100100
)
101101
}
102102

103-
// FIXME Remove this for Litmus?
104103
pub fn get_chain_spec_staging() -> ChainSpec {
105104
// Staging keys are derivative keys based on a single master secret phrase:
106105
//

node/src/chain_specs/rococo.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,22 @@ pub fn get_chain_spec_dev() -> ChainSpec {
9898
)
9999
}
100100

101+
pub fn get_chain_spec_staging() -> ChainSpec {
102+
// Staging keys are derivative keys based on a single master secret phrase:
103+
//
104+
// root: $SECRET
105+
// account: $SECRET//collator//<id>
106+
// aura: $SECRET//collator//<id>//aura
107+
get_chain_spec_from_genesis_info(
108+
include_bytes!("../../res/genesis_info/staging.json"),
109+
"Litentry-rococo-staging",
110+
"litentry-rococo-staging",
111+
ChainType::Local,
112+
"rococo-local".into(),
113+
DEFAULT_PARA_ID.into(),
114+
)
115+
}
116+
101117
pub fn get_chain_spec_prod() -> ChainSpec {
102118
get_chain_spec_from_genesis_info(
103119
include_bytes!("../../res/genesis_info/rococo.json"),

node/src/command.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ fn load_spec(id: &str) -> std::result::Result<Box<dyn sc_service::ChainSpec>, St
9898
)?),
9999
// Rococo
100100
"rococo-dev" => Box::new(chain_specs::rococo::get_chain_spec_dev()),
101+
"rococo-staging" => Box::new(chain_specs::rococo::get_chain_spec_staging()),
101102
"rococo" => Box::new(chain_specs::rococo::ChainSpec::from_json_bytes(
102103
&include_bytes!("../res/chain_specs/rococo-170000.json")[..],
103104
)?),

runtime/rococo/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -782,8 +782,8 @@ parameter_types! {
782782
pub const NativeTokenResourceId: [u8; 32] = hex!("00000000000000000000000000000063a7e2be78898ba83824b0c0cc8dfb6001");
783783
}
784784

785-
pub struct TechnicalCommitteeProvider;
786-
impl SortedMembers<AccountId> for TechnicalCommitteeProvider {
785+
pub struct TransferNativeAnyone;
786+
impl SortedMembers<AccountId> for TransferNativeAnyone {
787787
fn sorted_members() -> Vec<AccountId> {
788788
vec![]
789789
}
@@ -801,7 +801,7 @@ impl SortedMembers<AccountId> for TechnicalCommitteeProvider {
801801
impl pallet_bridge_transfer::Config for Runtime {
802802
type Event = Event;
803803
type BridgeOrigin = pallet_bridge::EnsureBridge<Runtime>;
804-
type TransferNativeMembers = TechnicalCommitteeProvider;
804+
type TransferNativeMembers = TransferNativeAnyone;
805805
type SetMaximumIssuanceOrigin = EnsureRootOrHalfCouncil;
806806
type NativeTokenResourceId = NativeTokenResourceId;
807807
type DefaultMaximumIssuance = MaximumIssuance;

0 commit comments

Comments
 (0)