Skip to content

Commit

Permalink
Specify the versions of OAK-blockchain, polkadot-sdk and Moonbase (#114)
Browse files Browse the repository at this point in the history
We need to pass the `scheduleAs` parameter to schedule task in
OAK-blockchain v2.0.0.
the `scheduleAs` parameter is optional in OAK-blockchain v2.1.4. The
xcm-demo matches the new version.

Test

```
npm run moonbase-local

1. Transfer TUR to the derivative account on turing-local: 
status.type Ready
status.type InBlock
status.type Finalized

2. One-time proxy setup on moonbase-local

a) Add a proxy for Alice If there is none setup on moonbase-local

oakChainData.paraId:  2114
Add a proxy of moonbase-local (paraId:1000) and proxyType: Any on Turing ...
 Proxy address: 0xfde409e557153fceffd60db438375b2247df3418

status.type Ready
status.type InBlock
status.type Finalized

b) Topping up the proxy account on moonbase-local with DEV ...

status.type Ready
status.type InBlock
status.type Finalized

User Alice turing-local address: 6AwtFW6sYcQ8RcuAJeXdDKuFtUVXj4xW57ghjYQ5xyciT1yd, moonbase-local address: 0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac

3. Execute an XCM from moonbase-local to turing-local ...

a). Create a payload to store in Turing’s task ...

b). Send extrinsic from moonbase-local to turing-local to schedule task. Listen to TaskScheduled event on turing-local chain ...
Listen XCMP task events
Send extrinsic from moonbase-local to schedule task. extrinsic: 0x21060301010009210103010100092101042c527f000000000000000000000000e1023c010004000000000000000003010100a10f03010100092103010200a10f040300141354778000000000000000000000c9012601f24ff3a9cf04c71dbc94d0b566f7a27b94566cac01581501000000000000000000000000000000000000000000000000000000000000a72f549a1a12b9b49f30a7f3aeb1f4e96389c5d8000000000000000000000000000000000000000000000000000000000000000010d09de08a0003404ac76c5a15010003401462a85a860300010003f737a4434a3801000107f75f0f32014a38010000
status.type Ready
        automationTime:TaskScheduled:: (phase={"applyExtrinsic":0})
                        AccountId32: 6AubHEyP5NhszkySgTAznkkQpiBjnBRkh2EidUQFv8k7kaPK
                        Bytes: 0x31372d302d31
                        Option<AccountId32>: 
Found the event and retrieved TaskId, 17-0-1

Keep Listening automationTime.TaskExecuted until 2024-05-09 21:41:11(1715262071) to verify that the task(taskId: 17-0-1) will be successfully triggered ...
status.type InBlock
status.type Finalized
        automationTime:TaskExecuted:: (phase=Initialization)
                        AccountId32: 6AubHEyP5NhszkySgTAznkkQpiBjnBRkh2EidUQFv8k7kaPK
                        Bytes: 0x31372d302d31
XcmpMessageSent event:  {
  phase: 'Initialization',
  event: {
    method: 'XcmpMessageSent',
    section: 'xcmpQueue',
    index: '0x2804',
    data: {
      messageHash: '0x03c026ccf147d5277559da361e7d6ddc28709f002fcf240cfa35ee816ca0a51a'
    }
  },
  topics: []
}
messageHash:  0x03c026ccf147d5277559da361e7d6ddc28709f002fcf240cfa35ee816ca0a51a

4. Listen xcmpQueue.Success event with messageHash(0x03c026ccf147d5277559da361e7d6ddc28709f002fcf240cfa35ee816ca0a51a) and find ethereum.Executed event on Parachain...
        xcmpQueue:Success:: (phase={"applyExtrinsic":1})
                        Option<[u8;32]>: 0x03c026ccf147d5277559da361e7d6ddc28709f002fcf240cfa35ee816ca0a51a
                        {"refTime":"Compact<u64>","proofSize":"Compact<u64>"}: {"refTime":813047000,"proofSize":28373}
ethereum.Executed event:  {"from":"0xf24ff3a9cf04c71dbc94d0b566f7a27b94566cac","to":"0xa72f549a1a12b9b49f30a7f3aeb1f4e96389c5d8","transactionHash":"0xe8d1b7bf8ae46af6b1a31f10d50f2e39f0cab13905c0361770c2a64b50f606a8","exitReason":{"Succeed":"Stopped"},"extraData":""}
Reached the end of main() ...
```
  • Loading branch information
imstar15 authored May 13, 2024
1 parent de25c6f commit 81bffce
Showing 1 changed file with 24 additions and 5 deletions.
29 changes: 24 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -368,9 +368,9 @@ MessageHash: 0xff304ed6aeab3e174ec667e9f69a18ebe23506836c4f53bd35aeb78503193453
### Pre-requisites
| Chain | Version |
| :--- | :----: |
| Kusama | [v0.9.43](https://github.com/paritytech/polkadot/releases/tag/v0.9.43) |
| Turing Network | [v2.0.0](https://github.com/OAK-Foundation/OAK-blockchain/releases/tag/v2.0.0) |
| Moonriver | [runtime-2403](https://github.com/moonbeam-foundation/moonbeam/releases/tag/runtime-2403) |
| Kusama | [v1.11.0](https://github.com/paritytech/polkadot-sdk/releases/tag/polkadot-v1.11.0) |
| Turing Network | [v2.1.4](https://github.com/OAK-Foundation/OAK-blockchain/releases/tag/v2.1.4) |
| Moonriver | [runtime-2500](https://github.com/moonbeam-foundation/moonbeam/releases/tag/runtime-2500) |

### Steps & Logs

Expand All @@ -380,18 +380,37 @@ MessageHash: 0xff304ed6aeab3e174ec667e9f69a18ebe23506836c4f53bd35aeb78503193453

The local environment of Moonbeam is named Moonbase Local in its chain config.

1. Launch OAK-blockchain, Rococo and Moonriver.

- Compile oak-collator v2.1.4

https://github.com/OAK-Foundation/OAK-blockchain/releases/tag/v2.1.4

```
cargo build --release --features turing-node --features dev-queue
```


- Compile moonbase

https://github.com/moonbeam-foundation/moonbeam/releases/tag/runtime-2500

```
cargo build --release
```

1. Launch Rococo Local, Turing Dev and Moonbase Local with zombienet. The zombienet config file is located at [OAK-blockchain repo](https://github.com/OAK-Foundation/OAK-blockchain/blob/master/zombienets/turing/moonbase.toml). Assuming you are at OAK-blockchain’s root folder, run the below command to spin up the networks.

```
zombienet spawn zombienets/turing/moonbase.toml
```

2. Run this program to schedule automation and wait for cross-chain execution
1. Run this program to schedule automation and wait for cross-chain execution
```
npm run moonbase-local
```

3. The above step outlines the process of XCM automation with Moonbase Local. Upon completing the program, an 'ethereum.executed' event from Moonbase Local will be emitted. However, the event will exit with an EvmCoreErrorExitReason, which occurs because a smart contract has not been deployed yet. To successfully demonstrate smart contract automation, please follow the subsequent steps to set up a test smart contract.
1. The above step outlines the process of XCM automation with Moonbase Local. Upon completing the program, an 'ethereum.executed' event from Moonbase Local will be emitted. However, the event will exit with an EvmCoreErrorExitReason, which occurs because a smart contract has not been deployed yet. To successfully demonstrate smart contract automation, please follow the subsequent steps to set up a test smart contract.

The default sudo wallet of Moonbase Local Alith is used to deploy a smart contract. Run the below commands to deploy a smart contract to Moonbase Local.

Expand Down

0 comments on commit 81bffce

Please sign in to comment.