Add .env parameters for test-wallet
This commit is contained in:
parent
f4d844efd2
commit
b13757c6c7
11
README.md
11
README.md
|
@ -31,9 +31,18 @@ yarn build
|
|||
### Test plugin and resources in testnets
|
||||
The project includes a burner wallet instance where you can test the implementation of the plugin in testnet. For that, you have to make sure that the build step was performed and that the plugin resources you modified are correctly imported and used in the `src/index.tsx` file of the `test-wallet` folder.
|
||||
|
||||
1. Create `.env` file in `test-wallet` folder and set:
|
||||
1. Create `.env` file in `test-wallet` folder from `.env.example` and set the required parameters for the ERC677 to ERC677 bridge extension:
|
||||
```
|
||||
REACT_APP_INFURA_KEY=<your key from infura.com>
|
||||
REACT_APP_HOME_NETWORK=
|
||||
REACT_APP_HOME_TOKEN_NAME=
|
||||
REACT_APP_HOME_TOKEN_ADDRESS=
|
||||
REACT_APP_HOME_MEDIATOR_ADDRESS=
|
||||
|
||||
REACT_APP_FOREIGN_NETWORK=
|
||||
REACT_APP_FOREIGN_TOKEN_NAME=
|
||||
REACT_APP_FOREIGN_TOKEN_ADDRESS=
|
||||
REACT_APP_FOREIGN_MEDIATOR_ADDRESS=
|
||||
```
|
||||
|
||||
2. To start the burner wallet instance run:
|
||||
|
|
|
@ -1,2 +1,12 @@
|
|||
REACT_APP_INFURA_KEY=
|
||||
REACT_APP_PK=0x
|
||||
|
||||
REACT_APP_HOME_NETWORK=77
|
||||
REACT_APP_HOME_TOKEN_NAME=sStake
|
||||
REACT_APP_HOME_TOKEN_ADDRESS=
|
||||
REACT_APP_HOME_MEDIATOR_ADDRESS=
|
||||
|
||||
REACT_APP_FOREIGN_NETWORK=42
|
||||
REACT_APP_FOREIGN_TOKEN_NAME=kStake
|
||||
REACT_APP_FOREIGN_TOKEN_ADDRESS=
|
||||
REACT_APP_FOREIGN_MEDIATOR_ADDRESS=
|
||||
|
|
|
@ -9,24 +9,32 @@ import MetamaskPlugin from '@burner-wallet/metamask-plugin'
|
|||
import { ERC677Asset, Mediator, TokenBridgeGateway } from '@poanet/tokenbridge-bw-exchange'
|
||||
|
||||
const sStake = new ERC677Asset({
|
||||
id: 'sstake',
|
||||
name: 'sStake',
|
||||
network: '77',
|
||||
address: '0x' // TODO set address
|
||||
id: 'assetAtHome',
|
||||
// @ts-ignore
|
||||
name: process.env.REACT_APP_HOME_TOKEN_NAME,
|
||||
// @ts-ignore
|
||||
network: process.env.REACT_APP_HOME_NETWORK,
|
||||
// @ts-ignore
|
||||
address: process.env.REACT_APP_HOME_TOKEN_ADDRESS
|
||||
})
|
||||
|
||||
const kStake = new ERC677Asset({
|
||||
id: 'kstake',
|
||||
name: 'kStake',
|
||||
network: '42',
|
||||
address: '0x' // TODO set address
|
||||
id: 'assetAtForeign',
|
||||
// @ts-ignore
|
||||
name: process.env.REACT_APP_FOREIGN_TOKEN_NAME,
|
||||
// @ts-ignore
|
||||
network: process.env.REACT_APP_FOREIGN_NETWORK,
|
||||
// @ts-ignore
|
||||
address: process.env.REACT_APP_FOREIGN_TOKEN_ADDRESS
|
||||
})
|
||||
|
||||
const StakeBridgePair = new Mediator({
|
||||
assetA: sStake.id,
|
||||
assetABridge: '0x', // TODO set address
|
||||
// @ts-ignore
|
||||
assetABridge: process.env.REACT_APP_HOME_MEDIATOR_ADDRESS,
|
||||
assetB: kStake.id,
|
||||
assetBBridge: '0x' // TODO set address
|
||||
// @ts-ignore
|
||||
assetBBridge: process.env.REACT_APP_FOREIGN_MEDIATOR_ADDRESS
|
||||
})
|
||||
|
||||
const core = new BurnerCore({
|
||||
|
|
Loading…
Reference in New Issue