Added index and documentation

This commit is contained in:
Richard Ramos 2018-08-10 14:37:50 -04:00
parent 7355f73de8
commit fbe2bc0b3b
7 changed files with 39 additions and 2 deletions

View File

@ -37,7 +37,7 @@ nodemon src/service.js
``` ```
## Test DApp ## Test DApp
To run the test dapp, use `embark run` and then browse `http://localhost:8000/identity.html`. To run the test dapp, use `embark run` and then browse `http://localhost:8000/index.html`.
The gas relayer service needs to be running, and configured correctly to process the transactions. Things to take in account are: the account used in embark, and the contract addresses. The gas relayer service needs to be running, and configured correctly to process the transactions. Things to take in account are: the account used in embark, and the contract addresses.

View File

@ -15,6 +15,7 @@ import TextField from '@material-ui/core/TextField';
import config from '../config'; import config from '../config';
import web3 from 'Embark/web3'; import web3 from 'Embark/web3';
import {withStyles} from '@material-ui/core/styles'; import {withStyles} from '@material-ui/core/styles';
import { Typography } from '@material-ui/core';
const styles = theme => ({ const styles = theme => ({
root: { root: {
width: '100%', width: '100%',
@ -155,6 +156,11 @@ class ApproveAndCallGasRelayed extends Component {
render(){ render(){
const {classes} = this.props; const {classes} = this.props;
return <div> return <div>
<Card className={classes.card}>
<CardContent>
<b>This functionality is used when a Identity will invoke a contract function that requires a transfer of Tokens</b>
</CardContent>
</Card>
{ this.state.transactionError && <MySnackbarContentWrapper variant="error" message={this.state.transactionError} /> } { this.state.transactionError && <MySnackbarContentWrapper variant="error" message={this.state.transactionError} /> }
<Card className={classes.card}> <Card className={classes.card}>
<CardHeader title="1. Transaction Data" /> <CardHeader title="1. Transaction Data" />

View File

@ -94,7 +94,7 @@ class Body extends Component {
return <Fragment> return <Fragment>
<Tabs value={tab} onChange={this.handleChange}> <Tabs value={tab} onChange={this.handleChange}>
<Tab label="Transfer SNT" /> <Tab label="Transfer SNT" />
<Tab label="????" /> <Tab label="Execute" />
</Tabs> </Tabs>
{tab === 0 && <Container><TransferSNT clearMessages={this.clearMessages} web3={web3js} kid={kid} skid={skid} nonce={nonce} /></Container>} {tab === 0 && <Container><TransferSNT clearMessages={this.clearMessages} web3={web3js} kid={kid} skid={skid} nonce={nonce} /></Container>}
{tab === 1 && <Container>TODO</Container>} {tab === 1 && <Container>TODO</Container>}

View File

@ -157,6 +157,11 @@ class CallGasRelayed extends Component {
render(){ render(){
const {classes} = this.props; const {classes} = this.props;
return <div> return <div>
<Card className={classes.card}>
<CardContent>
<b>This functionality is used when a Identity will invoke a contract function or transfer ether without paying fees </b>
</CardContent>
</Card>
{ this.state.transactionError && <MySnackbarContentWrapper variant="error" message={this.state.transactionError} /> } { this.state.transactionError && <MySnackbarContentWrapper variant="error" message={this.state.transactionError} /> }
<Card className={classes.card}> <Card className={classes.card}>
<CardHeader title="1. Transaction Data" /> <CardHeader title="1. Transaction Data" />

View File

@ -144,6 +144,11 @@ class TransferSNT extends Component {
render(){ render(){
const {classes} = this.props; const {classes} = this.props;
return <div> return <div>
<Card className={classes.card}>
<CardContent>
<b>This functionality is used for SNT transfers without paying eth fees</b>
</CardContent>
</Card>
{ this.state.transactionError && <MySnackbarContentWrapper variant="error" message={this.state.transactionError} /> } { this.state.transactionError && <MySnackbarContentWrapper variant="error" message={this.state.transactionError} /> }
<Card className={classes.card}> <Card className={classes.card}>
<CardHeader title="1. Transaction Data" /> <CardHeader title="1. Transaction Data" />

20
test-dapp/app/index.html Normal file
View File

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1,shrink-to-fit=no">
<link rel="manifest" href="/manifest.json">
<link rel="shortcut icon" href="/favicon.ico">
</head>
<body>
<h3>Gas Relayer Demos</h3>
<p>The following demos are available:</p>
<ul>
<li><a href="./identity.html">identity.html</a></li>
<li><a href="./sntcontroller.html">sntcontroller.html</a></li>
</ul>
</body>
</html>

View File

@ -1,6 +1,7 @@
{ {
"contracts": ["contracts/**"], "contracts": ["contracts/**"],
"app": { "app": {
"index.html": "app/index.html",
"js/identity.js": ["app/identity.js"], "js/identity.js": ["app/identity.js"],
"identity.html": "app/identity.html", "identity.html": "app/identity.html",
"js/sntcontroller.js": ["app/sntcontroller.js"], "js/sntcontroller.js": ["app/sntcontroller.js"],