Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6,110 changes: 4,098 additions & 2,012 deletions parachain/Cargo.lock

Large diffs are not rendered by default.

6 changes: 5 additions & 1 deletion parachain/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
cargo-features = ["resolver"]

[profile.release]
panic = "unwind"

Expand All @@ -6,13 +8,15 @@ members = [
"primitives/core",
"primitives/ethereum",
"primitives/testutils",
"primitives/xcm-support",
"pallets/bridge",
"pallets/assets",
"pallets/verifier",
"pallets/verifier-lightclient",
"pallets/eth-app",
"pallets/erc20-app",
"pallets/commitments",
"pallets/token-dealer",
"node",
"runtime",
]
resolver = "2"
34 changes: 19 additions & 15 deletions parachain/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,9 @@ Edit the generated spec file and replace the following addresses:
}
```

#### Relayer Key

_It is not required to change anything here for local development and testing._

The parachain depends on a external relayer service to forward messages to and from Ethereum. The relayer service is trusted by the parachain. Its identity should be injected into the [GenesisConfig](https://snowfork.github.io/artemis-rust-docs/pallet_verifier/struct.GenesisConfig.html#structfield.key) for the [Verifier](https://snowfork.github.io/artemis-rust-docs/pallet_verifier/index.html) pallet.

The node's baked-in chain spec uses `//Relay` as the relayer's account seed. For reference, see [chain_spec.rs](https://github.com/Snowfork/polkadot-ethereum/blob/main/parachain/node/src/chain_spec.rs#L50).

### Build

Once the development environment is set up, build the node template. This command will build the
Once the development environment is set up, build the parachain. This command will build the
[Wasm](https://substrate.dev/docs/en/knowledgebase/advanced/executor#wasm-execution) and
[native](https://substrate.dev/docs/en/knowledgebase/advanced/executor#native-execution) code:

Expand All @@ -104,24 +96,36 @@ cargo build --release

### Run

Purge any existing dev chain state:

Install `polkadot-launch`:

```bash
target/release/artemis-node purge-chain --dev
git clone https://github.com/paritytech/polkadot-launch.git
cd polkadot-launch
yarn global add file:.
```

Start a dev chain:
Build polkadot:

```bash
target/release/artemis-node --tmp --dev
git clone https://github.com/paritytech/polkadot.git
cd polkadot
cargo build --release --features=real-overseer
```

Or, start a dev chain with a custom chain spec:
Create a configuration for polkadot-launch by editing `config.json`:

```bash
target/release/artemis-node --tmp --spec spec.json
vim config.json
```

Launch polkadot and parachain:

```bash
polkadot-launch config.json
```


## Interacting with the chain

You can interact with a development chain using our [webapp](https://polkaeth-substrate.netlify.app). Its an instance of the Polkadot-JS webapp with the necessary configuration to interact with our development chain.
Expand Down
298 changes: 298 additions & 0 deletions parachain/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,298 @@
{
"relaychain": {
"bin": "<POLKADOT_DIR>/target/release/polkadot",
"chain": "rococo-local",
"nodes": [
{
"name": "alice",
"wsPort": 9944,
"port": 30444
},
{
"name": "bob",
"wsPort": 9955,
"port": 30555
}
]
},
"parachains": [
{
"bin": "target/release/artemis",
"id": "200",
"wsPort": 9988,
"port": 31200,
"balance": "1000000000000000000000",
"flags": ["--discover-local", "--", "--execution=wasm"]
}
],
"simpleParachains": [],
"types": {
"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",
"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>",
"erasure_root": "Hash",
"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"
},
"OriginKind": {
"_enum": {
"Native": null,
"SovereignAccount": null,
"Superuser": null
}
},
"NetworkId": {
"_enum": {
"Any": null,
"Named": "Vec<u8>",
"Polkadot": null,
"Kusama": null
}
},
"MultiLocation": {
"_enum": {
"Null": null,
"X1": "Junction",
"X2": "(Junction, Junction)",
"X3": "(Junction, Junction, Junction)",
"X4": "(Junction, Junction, Junction, Junction)"
}
},
"AccountId32Junction": {
"network": "NetworkId",
"id": "AccountId"
},
"AccountIndex64Junction": {
"network": "NetworkId",
"index": "Compact<u64>"
},
"AccountKey20Junction": {
"network": "NetworkId",
"index": "[u8; 20]"
},
"Junction": {
"_enum": {
"Parent": null,
"Parachain": "Compact<u32>",
"AccountId32": "AccountId32Junction",
"AccountIndex64": "AccountIndex64Junction",
"AccountKey20": "AccountKey20Junction",
"PalletInstance": "u8",
"GeneralIndex": "Compact<u128>",
"GeneralKey": "Vec<u8>",
"OnlyChild": null
}
},
"VersionedMultiLocation": {
"_enum": {
"V0": "MultiLocation"
}
},
"AssetInstance": {
"_enum": {
"Undefined": null,
"Index8": "u8",
"Index16": "Compact<u16>",
"Index32": "Compact<u32>",
"Index64": "Compact<u64>",
"Index128": "Compact<u128>",
"Array4": "[u8; 4]",
"Array8": "[u8; 8]",
"Array16": "[u8; 16]",
"Array32": "[u8; 32]",
"Blob": "Vec<u8>"
}
},
"AbstractFungible": {
"id": "Vec<u8>",
"instance": "Compact<u128>"
},
"AbstractNonFungible": {
"class": "Vec<u8>",
"instance": "AssetInstance"
},
"ConcreteFungible": {
"id": "MultiLocation",
"amount": "Compact<u128>"
},
"ConcreteNonFungible": {
"class": "MultiLocation",
"instance": "AssetInstance"
},
"MultiAsset": {
"_enum": {
"None": null,
"All": null,
"AllFungible": null,
"AllNonFungible": null,
"AllAbstractFungible": "Vec<u8>",
"AllAbstractNonFungible": "Vec<u8>",
"AllConcreteFungible": "MultiLocation",
"AllConcreteNonFungible": "MultiLocation",
"AbstractFungible": "AbstractFungible",
"AbstractNonFungible": "AbstractNonFungible",
"ConcreteFungible": "ConcreteFungible",
"ConcreteNonFungible": "ConcreteNonFungible"
}
},
"VersionedMultiAsset": {
"_enum": {
"V0": "MultiAsset"
}
},
"DepositAsset": {
"assets": "Vec<MultiAsset>",
"dest": "MultiLocation"
},
"DepositReserveAsset": {
"assets": "Vec<MultiAsset>",
"dest": "MultiLocation",
"effects": "Vec<Order>"
},
"ExchangeAsset": {
"give": "Vec<MultiAsset>",
"receive": "Vec<MultiAsset>"
},
"InitiateReserveWithdraw": {
"assets": "Vec<MultiAsset>",
"reserve": "MultiLocation",
"effects": "Vec<Order>"
},
"InitiateTeleport": {
"assets": "Vec<MultiAsset>",
"dest": "MultiLocation",
"effects": "Vec<Order>"
},
"QueryHolding": {
"query_id": "Compact<u64>",
"dest": "MultiLocation",
"assets": "Vec<MultiAsset>"
},
"Order": {
"_enum": {
"Null": null,
"DepositAsset": "DepositAsset",
"DepositReserveAsset": "DepositReserveAsset",
"ExchangeAsset": "ExchangeAsset",
"InitiateReserveWithdraw": "InitiateReserveWithdraw",
"InitiateTeleport": "InitiateTeleport",
"QueryHolding": "QueryHolding"
}
},
"WithdrawAsset": {
"assets": "Vec<MultiAsset>",
"effects": "Vec<Order>"
},
"ReserveAssetDeposit": {
"assets": "Vec<MultiAsset>",
"effects": "Vec<Order>"
},
"TeleportAsset": {
"assets": "Vec<MultiAsset>",
"effects": "Vec<Order>"
},
"Balances": {
"query_id": "Compact<u64>",
"assets": "Vec<MultiAsset>"
},
"Transact": {
"origin_type": "OriginKind",
"call": "Vec<u8>"
},
"RelayTo": {
"dest": "MultiLocation",
"inner": "VersionedXcm"
},
"RelayedFrom": {
"superorigin": "MultiLocation",
"inner": "VersionedXcm"
},
"Xcm": {
"_enum": {
"WithdrawAsset": "WithdrawAsset",
"ReserveAssetDeposit": "ReserveAssetDeposit",
"TeleportAsset": "TeleportAsset",
"Balances": "Balances",
"Transact": "Transact",
"RelayTo": "RelayTo",
"RelayedFrom": "RelayedFrom"
}
},
"VersionedXcm": {
"_enum": {
"V0": "Xcm"
}
},
"XcmError": {
"_enum": [
"Undefined",
"Unimplemented",
"UnhandledXcmVersion",
"UnhandledXcmMessage",
"UnhandledEffect",
"EscalationOfPrivilege",
"UntrustedReserveLocation",
"UntrustedTeleportLocation",
"DestinationBufferOverflow",
"CannotReachDestination",
"MultiLocationFull",
"FailedToDecode",
"BadOrigin"
]
},
"XcmResult": {
"_enum": {
"Ok": "()",
"Err": "XcmError"
}
}
}
}
Loading