-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
Binary file added
BIN
+54 KB
docs/_static/images/remix-metamask/after-submit-reverse-transaction.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
Integrate CyberMiles Remix & MetaMask | ||
===================================== | ||
|
||
.. _integrate-cybermiles-remix-metamask: | ||
|
||
Install CyberMiles MetaMask Chrome extension | ||
-------------------------------------------- | ||
|
||
- Download chrome.crx from https://github.com/CyberMiles/travis-extension/blob/travis/builds/chrome.crx | ||
- Install chrome.crx (Go to chrome://extensions/ and drag the chrome.crx extension file to extension page) | ||
- Open MetaMask to initialize CMT account | ||
- Switch to **Test Network** | ||
|
||
.. image:: _static/images/remix-metamask/test-network.png | ||
:align: center | ||
|
||
- Get some CMT at http://travis-faucet.cybermiles.io/cn/ | ||
|
||
Run Remix IDE | ||
------------- | ||
|
||
.. code:: bash | ||
git clone https://github.com/CyberMiles/remix-ide.git | ||
cd remix-ide | ||
npm install | ||
npm run setupremix | ||
npm start | ||
- It will run Remix IDE on default port 8080 | ||
|
||
Using MetaMask in Remix IDE | ||
--------------------------- | ||
|
||
- Check Remix IDE at http://localhost:8080 | ||
- Check compiler version at right panel. It should be `Current version:0.4.25+commit.3c75442c.Emscripten.clang` (`3c75442c` is commit hash of [lity-v1.2.1 release](https://github.com/CyberMiles/lity/releases/tag/v1.2.1)) | ||
- Turn on `Auto compile` option | ||
|
||
.. image:: _static/images/remix-metamask/compile-panel.png | ||
:align: center | ||
|
||
- Go to run tab at right panel and select `Injected Web3` as Environment) | ||
- Use `StringReverse.sol` as example | ||
|
||
.. code:: bash | ||
pragma solidity ^0.4.0; | ||
contract StringReverse { | ||
event log(string s); | ||
function test() public returns (string) { | ||
string memory ret; | ||
ret = eni("reverse", "Hello, world"); | ||
emit log(ret); | ||
return ret; | ||
} | ||
function reverse(string src) public returns (string) { | ||
string memory ret; | ||
ret = eni("reverse", src); | ||
emit log(ret); | ||
return ret; | ||
} | ||
} | ||
- Click red `Deploy` button to deploy contract | ||
|
||
.. image:: _static/images/remix-metamask/deploy-button.png | ||
:align: center | ||
|
||
- Submit create contract transaction in MetaMask | ||
|
||
.. image:: _static/images/remix-metamask/submit-create-transaction.png | ||
:align: center | ||
|
||
- Now we try to submit `reverse("ABCDE")` function call (click red `reverse` button to submit) | ||
|
||
.. image:: _static/images/remix-metamask/reverse-button.png | ||
:align: center | ||
|
||
- Submit reverse call transaction in MetaMask | ||
|
||
.. image:: _static/images/remix-metamask/submit-reverse-transaction.png | ||
:align: center | ||
|
||
.. image:: _static/images/remix-metamask/after-submit-reverse-transaction.png | ||
:align: center | ||
|
||
- Check result in Remix IDE console | ||
|
||
.. image:: _static/images/remix-metamask/remix-console-1.png | ||
:align: center | ||
|
||
.. image:: _static/images/remix-metamask/remix-console-2.png | ||
:align: center |