You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+44-12Lines changed: 44 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -37,23 +37,28 @@ For running a local instance use the command:
37
37
yarn start
38
38
```
39
39
40
+
The codebase is configured to be run against the Geth <> Substrate node that can be set up by following the guide [here](https://chainbridge.chainsafe.io/local/) or executing:
41
+
42
+
-`yarn start:substrate` to start,
43
+
-`yarn setup:example` to initialize
44
+
45
+
Should the substrate chain you are targetting require different type definitions, the type definitions file should be added to `src/Contexts/Adaptors/SubstrateApis/` and the file name for the types set in the substrate bridge configs.
46
+
40
47
### Build
41
48
42
49
Update the configs for the bridge in `src/chainbridgeContext.ts`. There should be at least 2 chains configured for correct functioning of the bridge. Each chain accepts the following configuration parameters:
43
50
44
51
```
45
-
type BridgeConfig = {
46
-
chainId: number // The bridge's chainId.
47
-
networkId: number // The networkId of this chain.
48
-
name: string // The human readable name of this chain.
49
-
bridgeAddress: string // The address on the brdige contract deployed on this chain.
50
-
erc20HandlerAddress: string // The ERC20 handler address.
51
-
rpcUrl: string // An RPC URL for this chain.
52
-
type: "Ethereum" | "Substrate" // The type of chain.
53
-
tokens: TokenConfig[] // An object to configure the tokens this bridge can transfer. See the TokenConfig object below.
54
-
nativeTokenSymbol: string // The native token symbol of this chain.
55
-
blockExplorer?: string //This should be the full path to display a tx hash, without the trailing slash, ie. https://etherscan.io/tx
56
-
}
52
+
export type BridgeConfig = {
53
+
networkId?: number; // The networkId of this chain.
54
+
chainId: number; // The bridge's chainId.
55
+
name: string; // The human readable name of this chain.
56
+
rpcUrl: string; // An RPC URL for this chain.
57
+
type: ChainType; // The type of chain.
58
+
tokens: TokenConfig[]; // An object to configure the tokens (see below)
59
+
nativeTokenSymbol: string; // The native token symbol of this chain.
60
+
decimals: number;
61
+
};
57
62
```
58
63
59
64
```
@@ -67,6 +72,33 @@ type TokenConfig = {
67
72
};
68
73
```
69
74
75
+
EVM Chains should additionally be configured with the following params
76
+
77
+
```
78
+
export type EvmBridgeConfig = BridgeConfig & {
79
+
bridgeAddress: string;
80
+
erc20HandlerAddress: string;
81
+
type: "Ethereum";
82
+
nativeTokenSymbol: string;
83
+
// This should be the full path to display a tx hash, without the trailing slash, ie. https://etherscan.io/tx
84
+
blockExplorer?: string;
85
+
defaultGasPrice?: number;
86
+
deployedBlockNumber?: number;
87
+
};
88
+
```
89
+
90
+
Substrate chains should be configured with the following
91
+
92
+
```
93
+
export type SubstrateBridgeConfig = BridgeConfig & {
94
+
type: "Substrate";
95
+
chainbridgePalletName: string; // The name of the chainbridge palette
96
+
transferPalletName: string; // The name of the pallet that should initiate transfers
97
+
transferFunctionName: string; // The name of the method to call to initiate a transfer
98
+
typesFileName: string; // The name of the Substrate types file. The file should be located in `src/Contexts/Adaptors/SubstrateApis`
99
+
};
100
+
```
101
+
70
102
Run `yarn build`.
71
103
72
104
Deploy the contents of the `/build` folder to any static website host (eg. S3, Azure storage) or IPFS.
0 commit comments