Skip to content

Instantly share code, notes, and snippets.

@ltfschoen
Last active June 17, 2020 10:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ltfschoen/0e1f760eb79abe9581768f13de082518 to your computer and use it in GitHub Desktop.
Save ltfschoen/0e1f760eb79abe9581768f13de082518 to your computer and use it in GitHub Desktop.
MXC AXS Wallet

Terminal Window 1: Install Node Version Manager (NVM) and run the following:

nvm install v10.16.0 &&
nvm use v10.16.0 &&
yarn install &&
yarn run generate:typedefs &&
yarn run check:code &&
yarn run premigrate &&
npm install -g truffle ganache-cli

Terminal Window 2: Open a second terminal tab and run the following to start Ganache CLI

ganache-cli \
	--account="0x209c205f333b5a65cc428589a51bd9f2621e2fc01de1b02dbf8c0f0b68e4974e, 50471238800000000000" \
	--account="0x0edb559026c8f779be17b4c9d8e4dfc14bead6592241de4d6612f77769327f7f, 100471238800000000000" \
	--unlock "0x209c205f333b5a65cc428589a51bd9f2621e2fc01de1b02dbf8c0f0b68e4974e" \
	--unlock "0x0edb559026c8f779be17b4c9d8e4dfc14bead6592241de4d6612f77769327f7f" \
	--port 8545 \
	--hostname localhost \
	--seed '0x209c205f333b5a65cc428589a51bd9f2621e2fc01de1b02dbf8c0f0b68e4974e' \
	--debug true \
	--mem true \
	--mnemonic 'end sleep vote expire arctic magic crack wrap toddler lizard acoustic owner' \
	--db './db/chain_database' \
	--verbose \
	--networkId=3 \
	--gasLimit=7984452 \
	--gasPrice=20000000000;

Terminal N/A: Modify tsconfig.js file as follows so TypeScript compiles without error:

  • Change value of isolatedModules to false
  • Change to allowJs value to false

Terminal N/A: Modify truffle.js by changing the body of development: { ... } to instead be:

    development: {
      accounts: 5,
      blockTime: 3,
      defaultEtherBalance: 500,
      host: "localhost",
      port: 8545,
      // `default` - Catch-all
      // `*` - Match any network id
      network_id: "*",
      networkCheckTimeout: "10000",
      websockets: true
    },

Terminal 1: Run the following:

truffle migrate --reset --network development

Terminal 1: Run the following to build the code:

yarn run build &&
yarn run postbuild

Note: When you run yarn run build it sets compilerOptions.isolatedModules back to true (implementation limitation), but we had to disable it to migrate it to the development network, just ignore this.

Terminal N/A: Run local server for website

yarn global add serve &&
serve -s build

Terminal N/A: Go to http://localhost:5000 and unlock Metamask by entering your password. By default it might be using Mainnet and you may see your MXC token account balance. We want to be using our local Ethereum Development chain on localhost:8545, so open MetaMask, click where it says "Main Ethereum Network" (top middle of UI) and instead choose "Local Network 8545" Then we want to import the account that created the MXCToken on the chain with private keys (view the logs when you ran truffle migrate...):

  • 0xce31EeD26ff009f1F5e38408571ea174c5d54f20 (~50 Testnet ETH) Click the MetaMask Menu icon (top right of UI), choose Import Private Key > Import, select "Private Key" from selection box, and paste one of the above private keys, and then click "Import". In the AXS Wallet UI it will now show a balance of ~50 Testnet ETH

Import the MXCToken into MetaMask so it shows the account balance in MXC. Menu icon (on left) > Add Token > Custom Token > Token Contract Address > then enter the contract address it was deployed to (i.e. 0x4c6B3e63DbD2933cf0FB820F8C07270a6f3311CE), and it'll pre-populate with the MXC details, then click "Next".

@cgroeschel
Copy link

cgroeschel commented Jun 16, 2020

Adding steps to initially install nvm/yarn and dependencies on ubuntu 18 which may be used to create a Docker based process.

sudo apt-get install make build-essentials
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
command -v nvm

Logout and back in to refresh the environmental variables
Clone the project and start from top on this page
git clone https://github.com/mxc-foundation/mxc-wallet.git
cd mxc-wallet/

If you face an issue with 'serve -s build' command not found try adding yarn upfront

yarn serve -s build

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment