implement dApp

fix detection of status
This commit is contained in:
StevenJNPearce 2019-01-28 00:39:09 +08:00
parent 944713e5f2
commit 79e77e8cd0
No known key found for this signature in database
GPG Key ID: 054E6D2DB272D1A1
22 changed files with 763 additions and 0 deletions

5
.gitignore vendored Normal file
View File

@ -0,0 +1,5 @@
.embark/
node_modules/
dist/
config/production/password
config/livenet/password

View File

@ -0,0 +1,39 @@
import React from 'react'
import Header from './Header'
export default class ChannelList extends React.Component {
constructor(props) {
super(props)
}
getLink(channel) {
const userAgent = navigator.userAgent
if (this.props.isStatus) {
return `https://get.status.im/chat/public/${channel.substring(1)}`
} else if (/Android/.test(userAgent)) {
return 'https://play.google.com/store/apps/details?id=im.status.ethereum'
} else if (/iPad|iPhone|iPod/.test(userAgent)) {
return 'https://testflight.apple.com/join/J8EuJmey';
} else if (/Macintosh|Windows|Linux/.test(userAgent)) {
return 'https://status.im/get_desktop/'
} else {
return 'https://status.im/'
}
}
render() {
return(<>
<Header/>
<ul className="list pl0 ml0 center mw7 w6 br3 bg-white">
{
this.props.channels.map((channel, index) => {
return(
<a key={index} className="link black" href={this.getLink(channel)}>
<li className={`pa4 tc dim db ${index === this.props.channels.length -1 ? '' : 'bb b--black-20'}`}>{channel}</li>
</a>)
})
}
</ul>
</>)
}
}

16
app/components/Header.js Normal file
View File

@ -0,0 +1,16 @@
import React from 'react'
export default class ChannelList extends React.Component {
constructor(props) {
super(props)
}
render() {
return(
<header className="tc pa2">
<img src="https://status.im/img/status-logo.svg" className="pt3" />
<h1 className="f1 black-70">Trending Channels</h1>
<h2 className="f2 black-70">Chat securly in open source communities</h2>
</header>
)
}
}

36
app/dapp.js Normal file
View File

@ -0,0 +1,36 @@
import React from 'react';
import ReactDOM from 'react-dom';
import EmbarkJS from 'Embark/EmbarkJS';
import ChannelList from './components/ChannelList';
import './tachyons.min.css';
import './style.css';
import { getChannels } from './utils';
class App extends React.Component {
constructor(props) {
super(props);
this.state = {
isStatus: false
};
this.channels = getChannels();
}
componentWillMount() {
if (window.ethereum && window.ethereum.isStatus) {
this.setState({isStatus: true});
}
}
render() {
return (<div>
<ChannelList isStatus={this.state.isStatus} channels={this.channels} />
</div>);
}
}
ReactDOM.render(<App></App>, document.getElementById('app'));

View File

@ -0,0 +1,10 @@
<svg width="147" height="56" viewBox="0 0 147 56" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M28 0C12.536 0 0 12.5362 0 28C0 43.464 12.536 56 28 56C43.464 56 56 43.464 56 28C56 12.5362 43.464 0 28 0Z" fill="#4360DF"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M28.9403 26.7727C30.3463 26.9191 31.7523 27.0654 33.4809 26.9691C38.1643 26.708 41.0013 24.3042 40.8 20.7111C40.5948 17.0553 36.8205 14.803 33.0441 15.0136C26.8898 15.3565 22.3642 20.7597 21.8545 26.9353C22.6903 26.7395 23.57 26.6226 24.3996 26.5764C26.1283 26.4801 27.5343 26.6264 28.9403 26.7727ZM16.8758 34.7648C17.07 38.116 20.6457 40.1806 24.2235 39.9875C30.0538 39.6731 34.3414 34.7202 34.8241 29.0592C34.0323 29.2387 33.199 29.346 32.413 29.3883C30.7753 29.4766 29.4432 29.3425 28.1111 29.2083C26.7791 29.0742 25.447 28.9401 23.8094 29.0284C19.3727 29.2677 16.6848 31.4711 16.8758 34.7648Z" fill="white"/>
<path d="M66.8965 32.6494H70.9438C70.9438 33.335 71.1372 33.8271 71.5239 34.126C71.9106 34.4248 72.4072 34.5742 73.0137 34.5742C73.5146 34.5742 73.9233 34.4819 74.2397 34.2974C74.5649 34.104 74.7275 33.792 74.7275 33.3613C74.7275 33.1064 74.6572 32.8999 74.5166 32.7417C74.3848 32.5747 74.1782 32.4297 73.897 32.3066C73.6157 32.1748 73.2554 32.043 72.8159 31.9111C72.3765 31.7793 71.8491 31.6123 71.2339 31.4102C70.6802 31.2344 70.1572 31.0542 69.665 30.8696C69.1816 30.6763 68.7554 30.439 68.3862 30.1577C68.0171 29.8765 67.7271 29.5337 67.5161 29.1294C67.314 28.7251 67.2129 28.2241 67.2129 27.6265C67.2129 26.9409 67.3491 26.3477 67.6216 25.8467C67.894 25.3457 68.2764 24.9326 68.7686 24.6074C69.2607 24.2822 69.8496 24.0405 70.5352 23.8823C71.2207 23.7153 71.9766 23.6318 72.8027 23.6318C73.8135 23.6318 74.6836 23.7461 75.4131 23.9746C76.1426 24.2031 76.7402 24.5151 77.2061 24.9106C77.6719 25.3062 78.0146 25.772 78.2344 26.3081C78.4629 26.8442 78.5771 27.4199 78.5771 28.0352H74.5034C74.5034 27.499 74.3628 27.0815 74.0815 26.7827C73.8091 26.4839 73.3916 26.3345 72.8291 26.3345C72.3984 26.3345 72.0293 26.4312 71.7217 26.6245C71.4141 26.8091 71.2603 27.0903 71.2603 27.4683C71.2603 27.7231 71.3306 27.9297 71.4712 28.0879C71.6206 28.2373 71.8359 28.3735 72.1172 28.4966C72.3984 28.6196 72.7456 28.7471 73.1587 28.8789C73.5718 29.002 74.0464 29.1514 74.5825 29.3271C75.1626 29.4854 75.7031 29.6611 76.2041 29.8545C76.7051 30.0479 77.1445 30.2852 77.5225 30.5664C77.9092 30.8389 78.2124 31.186 78.4321 31.6079C78.6606 32.021 78.7749 32.5483 78.7749 33.1899C78.7749 33.9458 78.6167 34.5918 78.3003 35.1279C77.9839 35.6553 77.5576 36.0859 77.0215 36.4199C76.4941 36.7539 75.8789 36.9912 75.1758 37.1318C74.4727 37.2812 73.7344 37.356 72.9609 37.356C71.0361 37.356 69.542 36.9561 68.4785 36.1562C67.4238 35.3477 66.8965 34.1787 66.8965 32.6494Z" fill="black"/>
<path d="M79.8032 27.0596V23.9878H81.8467V20.125H85.96V23.9878H88.9263V27.0596H85.96V31.7134C85.96 32.1968 86.0039 32.5835 86.0918 32.8735C86.1797 33.1548 86.3027 33.3789 86.4609 33.5459C86.6279 33.7041 86.8257 33.8096 87.0542 33.8623C87.2915 33.9062 87.5552 33.9282 87.8452 33.9282C88.021 33.9282 88.2451 33.9238 88.5176 33.915C88.79 33.8975 89.0273 33.8711 89.2295 33.8359V37C88.9219 37.0527 88.5352 37.1011 88.0693 37.145C87.6123 37.189 87.0718 37.2109 86.4478 37.2109C85.9644 37.2109 85.4546 37.1758 84.9185 37.1055C84.3823 37.0352 83.8857 36.8506 83.4287 36.5518C82.9717 36.2529 82.5938 35.7959 82.2949 35.1807C81.9961 34.5566 81.8467 33.7041 81.8467 32.623V27.0596H79.8032Z" fill="black"/>
<path d="M90.416 30.4873C90.416 29.5117 90.5698 28.6064 90.8774 27.7715C91.1938 26.9365 91.6289 26.2202 92.1826 25.6226C92.7451 25.0161 93.3999 24.5371 94.147 24.1855C94.894 23.834 95.7026 23.6582 96.5728 23.6582C97.5483 23.6582 98.3921 23.8647 99.104 24.2778C99.8247 24.6909 100.365 25.2139 100.726 25.8467V23.9878H104.852V37H100.726V35.1675C100.4 35.7651 99.8774 36.2749 99.1567 36.6968C98.436 37.1187 97.5747 37.3296 96.5728 37.3296C95.7114 37.3296 94.9028 37.1538 94.147 36.8022C93.3999 36.4507 92.7451 35.9717 92.1826 35.3652C91.6289 34.7588 91.1938 34.0381 90.8774 33.2031C90.5698 32.3682 90.416 31.4629 90.416 30.4873ZM94.5161 30.4873C94.5161 30.9355 94.5908 31.3662 94.7402 31.7793C94.8984 32.1836 95.1094 32.5352 95.373 32.834C95.6455 33.124 95.9707 33.3613 96.3486 33.5459C96.7266 33.7217 97.1484 33.8096 97.6143 33.8096C98.0801 33.8096 98.502 33.7217 98.8799 33.5459C99.2666 33.3613 99.5918 33.124 99.8555 32.834C100.128 32.5352 100.339 32.1836 100.488 31.7793C100.646 31.375 100.726 30.9443 100.726 30.4873C100.726 30.0391 100.646 29.6172 100.488 29.2217C100.339 28.8262 100.128 28.4746 99.8555 28.167C99.5918 27.8594 99.271 27.6177 98.8931 27.4419C98.5151 27.2661 98.0889 27.1782 97.6143 27.1782C97.1484 27.1782 96.7266 27.2661 96.3486 27.4419C95.9707 27.6177 95.6455 27.8594 95.373 28.167C95.1094 28.4746 94.8984 28.8262 94.7402 29.2217C94.5908 29.6172 94.5161 30.0391 94.5161 30.4873Z" fill="black"/>
<path d="M107.067 27.0596V23.9878H109.11V20.125H113.224V23.9878H116.19V27.0596H113.224V31.7134C113.224 32.1968 113.268 32.5835 113.355 32.8735C113.443 33.1548 113.566 33.3789 113.725 33.5459C113.892 33.7041 114.089 33.8096 114.318 33.8623C114.555 33.9062 114.819 33.9282 115.109 33.9282C115.285 33.9282 115.509 33.9238 115.781 33.915C116.054 33.8975 116.291 33.8711 116.493 33.8359V37C116.186 37.0527 115.799 37.1011 115.333 37.145C114.876 37.189 114.335 37.2109 113.711 37.2109C113.228 37.2109 112.718 37.1758 112.182 37.1055C111.646 37.0352 111.149 36.8506 110.692 36.5518C110.235 36.2529 109.857 35.7959 109.559 35.1807C109.26 34.5566 109.11 33.7041 109.11 32.623V27.0596H107.067Z" fill="black"/>
<path d="M118.537 31.7134V23.9878H122.637V30.6587C122.637 31.5903 122.804 32.3506 123.138 32.9395C123.472 33.5195 124.069 33.8096 124.931 33.8096C125.792 33.8096 126.425 33.5151 126.829 32.9263C127.242 32.3286 127.449 31.5244 127.449 30.5137V23.9878H131.575V37H127.449V35.1411C127.088 35.8267 126.539 36.3628 125.801 36.7495C125.062 37.1362 124.179 37.3296 123.151 37.3296C122.254 37.3296 121.516 37.189 120.936 36.9077C120.365 36.6265 119.899 36.2705 119.539 35.8398C119.125 35.3389 118.853 34.7588 118.721 34.0996C118.598 33.4404 118.537 32.645 118.537 31.7134Z" fill="black"/>
<path d="M134.238 32.6494H138.286C138.286 33.335 138.479 33.8271 138.866 34.126C139.252 34.4248 139.749 34.5742 140.355 34.5742C140.856 34.5742 141.265 34.4819 141.582 34.2974C141.907 34.104 142.069 33.792 142.069 33.3613C142.069 33.1064 141.999 32.8999 141.858 32.7417C141.727 32.5747 141.52 32.4297 141.239 32.3066C140.958 32.1748 140.597 32.043 140.158 31.9111C139.718 31.7793 139.191 31.6123 138.576 31.4102C138.022 31.2344 137.499 31.0542 137.007 30.8696C136.523 30.6763 136.097 30.439 135.728 30.1577C135.359 29.8765 135.069 29.5337 134.858 29.1294C134.656 28.7251 134.555 28.2241 134.555 27.6265C134.555 26.9409 134.691 26.3477 134.963 25.8467C135.236 25.3457 135.618 24.9326 136.11 24.6074C136.603 24.2822 137.191 24.0405 137.877 23.8823C138.562 23.7153 139.318 23.6318 140.145 23.6318C141.155 23.6318 142.025 23.7461 142.755 23.9746C143.484 24.2031 144.082 24.5151 144.548 24.9106C145.014 25.3062 145.356 25.772 145.576 26.3081C145.805 26.8442 145.919 27.4199 145.919 28.0352H141.845C141.845 27.499 141.705 27.0815 141.423 26.7827C141.151 26.4839 140.733 26.3345 140.171 26.3345C139.74 26.3345 139.371 26.4312 139.063 26.6245C138.756 26.8091 138.602 27.0903 138.602 27.4683C138.602 27.7231 138.672 27.9297 138.813 28.0879C138.962 28.2373 139.178 28.3735 139.459 28.4966C139.74 28.6196 140.087 28.7471 140.5 28.8789C140.914 29.002 141.388 29.1514 141.924 29.3271C142.504 29.4854 143.045 29.6611 143.546 29.8545C144.047 30.0479 144.486 30.2852 144.864 30.5664C145.251 30.8389 145.554 31.186 145.774 31.6079C146.002 32.021 146.117 32.5483 146.117 33.1899C146.117 33.9458 145.958 34.5918 145.642 35.1279C145.326 35.6553 144.899 36.0859 144.363 36.4199C143.836 36.7539 143.221 36.9912 142.518 37.1318C141.814 37.2812 141.076 37.356 140.303 37.356C138.378 37.356 136.884 36.9561 135.82 36.1562C134.766 35.3477 134.238 34.1787 134.238 32.6494Z" fill="black"/>
</svg>

After

Width:  |  Height:  |  Size: 7.9 KiB

11
app/index.html Normal file
View File

@ -0,0 +1,11 @@
<html>
<head>
<title>Status Channels</title>
<link href="https://rsms.me/inter/inter-ui.css" rel="stylesheet">
</head>
<body class="container">
<div id="app">
</div>
<script src="js/dapp.js"></script>
</body>
</html>

7
app/style.css Normal file
View File

@ -0,0 +1,7 @@
body {
font-family: 'inter-ui', sans-serif;
font-size: 2em;
font-weight: bold;
background-color: #eef2f5;
}

2
app/tachyons.min.css vendored Normal file

File diff suppressed because one or more lines are too long

22
app/utils.js Normal file
View File

@ -0,0 +1,22 @@
export const getChannels = () => {
return ['#ethereum',
'#status',
'#status-bounties',
'#status-core-devs',
'#status-desktop',
'#status-core-dapps',
'#status-peopleops',
'#status-marketing',
'#status-core-chat',
'#status-desktop',
'#statusphere',
'#watercooler',
'#ethdenver',
'#teambuilding',
'#project-coworkers',
'#316-core-network-incentives',
'#313-sticker-market',
'#314-tribute-to-talk',
'#317-dapp-store',
'#321-teller-network']
}

1
chains.json Normal file
View File

@ -0,0 +1 @@
{}

99
config/blockchain.js Normal file
View File

@ -0,0 +1,99 @@
module.exports = {
// applies to all environments
default: {
enabled: false,
rpcHost: "localhost", // HTTP-RPC server listening interface (default: "localhost")
rpcPort: 8545, // HTTP-RPC server listening port (default: 8545)
rpcCorsDomain: "auto", // Comma separated list of domains from which to accept cross origin requests (browser enforced)
// When set to "auto", Embark will automatically set the cors to the address of the webserver
wsRPC: true, // Enable the WS-RPC server
wsOrigins: "auto", // Origins from which to accept websockets requests
// When set to "auto", Embark will automatically set the cors to the address of the webserver
wsHost: "localhost", // WS-RPC server listening interface (default: "localhost")
wsPort: 8546 // WS-RPC server listening port (default: 8546)
},
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run` and `embark blockchain`
development: {
networkType: "custom", // Can be: testnet, rinkeby, livenet or custom, in which case, it will use the specified networkId
networkId: "1337", // Network id used when networkType is custom
isDev: true, // Uses and ephemeral proof-of-authority network with a pre-funded developer account, mining enabled
datadir: ".embark/development/datadir", // Data directory for the databases and keystore
mineWhenNeeded: true, // Uses our custom script (if isDev is false) to mine only when needed
nodiscover: true, // Disables the peer discovery mechanism (manual peer addition)
maxpeers: 0, // Maximum number of network peers (network disabled if set to 0) (default: 25)
proxy: true, // Proxy is used to present meaningful information about transactions
targetGasLimit: 8000000, // Target gas limit sets the artificial target gas floor for the blocks to mine
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm", // Mnemonic used by the simulator to generate a wallet
simulatorBlocktime: 0, // Specify blockTime in seconds for automatic mining. Default is 0 and no auto-mining.
account: {
// numAccounts: 3, // When specified, creates accounts for use in the dapp. This option only works in the development environment, and can be used as a quick start option that bypasses the need for MetaMask in development. These accounts are unlocked and funded with the below settings.
// password: "config/development/password", // Password for the created accounts (as specified in the `numAccounts` setting). If `mineWhenNeeded` is enabled (and isDev is not), this password is used to create a development account controlled by the node.
// balance: "5 ether" // Balance to be given to the created accounts (as specified in the `numAccounts` setting)
}
},
// merges with the settings in default
// used with "embark run privatenet" and/or "embark blockchain privatenet"
privatenet: {
networkType: "custom",
networkId: "1337",
isDev: false,
datadir: ".embark/privatenet/datadir",
// -- mineWhenNeeded --
// This options is only valid when isDev is false.
// Enabling this option uses our custom script to mine only when needed.
// Embark creates a development account for you (using `geth account new`) and funds the account. This account can be used for
// development (and even imported in to MetaMask). To enable correct usage, a password for this account must be specified
// in the `account > password` setting below.
// NOTE: once `mineWhenNeeded` is enabled, you must run an `embark reset` on your dApp before running
// `embark blockchain` or `embark run` for the first time.
mineWhenNeeded: true,
// -- genesisBlock --
// This option is only valid when mineWhenNeeded is true (which is only valid if isDev is false).
// When enabled, geth uses POW to mine transactions as it would normally, instead of using POA as it does in --dev mode.
// On the first `embark blockchain or embark run` after this option is enabled, geth will create a new chain with a
// genesis block, which can be configured using the `genesisBlock` configuration option below.
genesisBlock: "config/privatenet/genesis.json", // Genesis block to initiate on first creation of a development node
nodiscover: true,
maxpeers: 0,
proxy: true,
account: {
// "address": "", // When specified, uses that address instead of the default one for the network
password: "config/privatenet/password" // Password to unlock the account
},
targetGasLimit: 8000000,
wsHost: "localhost",
wsPort: 8546,
simulatorMnemonic: "example exile argue silk regular smile grass bomb merge arm assist farm",
simulatorBlocktime: 0
},
// merges with the settings in default
// used with "embark run testnet" and/or "embark blockchain testnet"
testnet: {
networkType: "testnet",
syncMode: "light",
account: {
password: "config/testnet/password"
}
},
// merges with the settings in default
// used with "embark run livenet" and/or "embark blockchain livenet"
livenet: {
networkType: "livenet",
syncMode: "light",
rpcCorsDomain: "http://localhost:8000",
wsOrigins: "http://localhost:8000",
account: {
password: "config/livenet/password"
}
},
// you can name an environment with specific settings and then specify with
// "embark run custom_name" or "embark blockchain custom_name"
//custom_name: {
//}
};

39
config/communication.js Normal file
View File

@ -0,0 +1,39 @@
module.exports = {
// default applies to all environments
default: {
enabled: false,
provider: "whisper", // Communication provider. Currently, Embark only supports whisper
available_providers: ["whisper"], // Array of available providers
},
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run`
development: {
connection: {
host: "localhost", // Host of the blockchain node
port: 8546, // Port of the blockchain node
type: "ws" // Type of connection (ws or rpc)
}
},
// merges with the settings in default
// used with "embark run privatenet"
privatenet: {
},
// merges with the settings in default
// used with "embark run testnet"
testnet: {
},
// merges with the settings in default
// used with "embark run livenet"
livenet: {
},
// you can name an environment with specific settings and then specify with
// "embark run custom_name"
//custom_name: {
//}
};

66
config/contracts.js Normal file
View File

@ -0,0 +1,66 @@
module.exports = {
// default applies to all environments
default: {
// Blockchain node to deploy the contracts
deployment: {
host: "localhost", // Host of the blockchain node
port: 8545, // Port of the blockchain node
type: "rpc" // Type of connection (ws or rpc),
// Accounts to use instead of the default account to populate your wallet
/*,accounts: [
{
privateKey: "your_private_key",
balance: "5 ether" // You can set the balance of the account in the dev environment
// Balances are in Wei, but you can specify the unit with its name
},
{
privateKeyFile: "path/to/file", // Either a keystore or a list of keys, separated by , or ;
password: "passwordForTheKeystore" // Needed to decrypt the keystore file
},
{
mnemonic: "12 word mnemonic",
addressIndex: "0", // Optionnal. The index to start getting the address
numAddresses: "1", // Optionnal. The number of addresses to get
hdpath: "m/44'/60'/0'/0/" // Optionnal. HD derivation path
}
]*/
},
// order of connections the dapp should connect to
dappConnection: [
"$WEB3", // uses pre existing web3 object if available (e.g in Mist)
"ws://localhost:8546",
"http://localhost:8545"
],
gas: "auto"
},
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run`
development: {
dappConnection: [
"ws://localhost:8546",
"http://localhost:8545",
"$WEB3" // uses pre existing web3 object if available (e.g in Mist)
]
},
// merges with the settings in default
// used with "embark run privatenet"
privatenet: {
},
// merges with the settings in default
// used with "embark run testnet"
testnet: {
},
// merges with the settings in default
// used with "embark run livenet"
livenet: {
},
// you can name an environment with specific settings and then specify with
// "embark run custom_name" or "embark blockchain custom_name"
//custom_name: {
//}
};

39
config/namesystem.js Normal file
View File

@ -0,0 +1,39 @@
module.exports = {
// default applies to all environments
default: {
enabled: false,
available_providers: ["ens"],
provider: "ens"
},
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run`
development: {
register: {
rootDomain: "eth",
subdomains: {
'embark': '0x1a2f3b98e434c02363f3dac3174af93c1d690914'
}
}
},
// merges with the settings in default
// used with "embark run privatenet"
privatenet: {
},
// merges with the settings in default
// used with "embark run testnet"
testnet: {
},
// merges with the settings in default
// used with "embark run livenet"
livenet: {
},
// you can name an environment with specific settings and then specify with
// "embark run custom_name" or "embark blockchain custom_name"
//custom_name: {
//}
};

View File

@ -0,0 +1,18 @@
{
"config": {
"homesteadBlock": 0,
"byzantiumBlock": 0,
"daoForkSupport": true
},
"nonce": "0x0000000000000042",
"difficulty": "0x0",
"alloc": {
"0x3333333333333333333333333333333333333333": {"balance": "15000000000000000000"}
},
"mixhash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"coinbase": "0x3333333333333333333333333333333333333333",
"timestamp": "0x00",
"parentHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
"extraData": "0x",
"gasLimit": "0x7a1200"
}

View File

@ -0,0 +1 @@
dev_password

93
config/storage.js Normal file
View File

@ -0,0 +1,93 @@
module.exports = {
// default applies to all environments
default: {
enabled: true,
ipfs_bin: "ipfs",
provider: "ipfs",
available_providers: ["ipfs"],
upload: {
host: "localhost",
port: 5001
},
dappConnection: [
{
provider: "ipfs",
host: "localhost",
port: 5001,
getUrl: "http://localhost:8080/ipfs/"
}
]
// Configuration to start Swarm in the same terminal as `embark run`
/*,account: {
address: "YOUR_ACCOUNT_ADDRESS", // Address of account accessing Swarm
password: "PATH/TO/PASSWORD/FILE" // File containing the password of the account
},
swarmPath: "PATH/TO/SWARM/EXECUTABLE" // Path to swarm executable (default: swarm)*/
},
// default environment, merges with the settings in default
// assumed to be the intended environment by `embark run`
development: {
enabled: true,
provider: "ipfs",
upload: {
host: "localhost",
port: 5001,
getUrl: "http://localhost:8080/ipfs/"
}
},
// merges with the settings in default
// used with "embark run privatenet"
privatenet: {
},
// merges with the settings in default
// used with "embark run testnet"
testnet: {
enabled: true,
ipfs_bin: "ipfs",
provider: "ipfs",
available_providers: ["ipfs"],
upload: {
host: "localhost",
port: 5001
},
dappConnection: [
{
provider: "ipfs",
protocol: "https",
host: "ipfs.infura.io",
port: 5001,
getUrl: "https://ipfs.infura.io/ipfs/"
}
]
},
// merges with the settings in default
// used with "embark run livenet"
livenet: {
enabled: true,
ipfs_bin: "ipfs",
provider: "ipfs",
available_providers: ["ipfs"],
upload: {
host: "localhost",
port: 5001
},
dappConnection: [
{
provider: "ipfs",
protocol: "https",
host: "ipfs.infura.io",
port: 5001,
getUrl: "https://ipfs.infura.io/ipfs/"
}
]
},
// you can name an environment with specific settings and then specify with
// "embark run custom_name"
//custom_name: {
//}
};

1
config/testnet/password Normal file
View File

@ -0,0 +1 @@
test_password

6
config/webserver.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = {
enabled: true,
host: "localhost",
openBrowser: true,
port: 8000
};

23
embark.json Normal file
View File

@ -0,0 +1,23 @@
{
"contracts": ["contracts/**"],
"app": {
"js/dapp.js": ["app/dapp.js"],
"index.html": "app/index.html",
"images/": ["app/images/**"]
},
"buildDir": "dist/",
"config": "config/",
"versions": {
"web3": "1.0.0-beta",
"solc": "0.4.25",
"ipfs-api": "17.2.4"
},
"plugins": {
},
"options": {
"solc": {
"optimize": true,
"optimize-runs": 200
}
}
}

212
package-lock.json generated Normal file
View File

@ -0,0 +1,212 @@
{
"name": "app_name",
"version": "0.0.1",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
"@babel/runtime": {
"version": "7.3.1",
"resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.3.1.tgz",
"integrity": "sha512-7jGW8ppV0ant637pIqAcFfQDDH1orEPGJb8aXfUozuCU3QqX7rX4DA8iwrbPrR1hcH0FTTHz47yQnk+bl5xHQA==",
"requires": {
"regenerator-runtime": "^0.12.0"
},
"dependencies": {
"regenerator-runtime": {
"version": "0.12.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.12.1.tgz",
"integrity": "sha512-odxIc1/vDlo4iZcfXqRYFj0vpXFNoGdKMAUieAlFYO6m/nl5e9KR/beGf41z4a1FI+aQgtjhuaSlDxQ0hmkrHg=="
}
}
},
"babel-runtime": {
"version": "6.26.0",
"resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz",
"integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=",
"requires": {
"core-js": "^2.4.0",
"regenerator-runtime": "^0.11.0"
}
},
"classnames": {
"version": "2.2.6",
"resolved": "https://registry.npmjs.org/classnames/-/classnames-2.2.6.tgz",
"integrity": "sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q=="
},
"core-js": {
"version": "2.6.3",
"resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.3.tgz",
"integrity": "sha512-l00tmFFZOBHtYhN4Cz7k32VM7vTn3rE2ANjQDxdEN6zmXZ/xq1jQuutnmHvMG1ZJ7xd72+TA5YpUK8wz3rWsfQ=="
},
"dom-helpers": {
"version": "3.4.0",
"resolved": "https://registry.npmjs.org/dom-helpers/-/dom-helpers-3.4.0.tgz",
"integrity": "sha512-LnuPJ+dwqKDIyotW1VzmOZ5TONUN7CwkCR5hrgawTUbkBGYdeoNLZo6nNfGkCrjtE1nXXaj7iMMpDa8/d9WoIA==",
"requires": {
"@babel/runtime": "^7.1.2"
}
},
"invariant": {
"version": "2.2.4",
"resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz",
"integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==",
"requires": {
"loose-envify": "^1.0.0"
}
},
"js-tokens": {
"version": "4.0.0",
"resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz",
"integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ=="
},
"keycode": {
"version": "2.2.0",
"resolved": "https://registry.npmjs.org/keycode/-/keycode-2.2.0.tgz",
"integrity": "sha1-PQr1bce4uOXLqNCpfxByBO7CKwQ="
},
"loose-envify": {
"version": "1.4.0",
"resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz",
"integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==",
"requires": {
"js-tokens": "^3.0.0 || ^4.0.0"
}
},
"object-assign": {
"version": "4.1.1",
"resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz",
"integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM="
},
"prop-types": {
"version": "15.6.2",
"resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.6.2.tgz",
"integrity": "sha512-3pboPvLiWD7dkI3qf3KbUe6hKFKa52w+AE0VCqECtf+QHAKgOL37tTaNCnuX1nAAQ4ZhyP+kYVKf8rLmJ/feDQ==",
"requires": {
"loose-envify": "^1.3.1",
"object-assign": "^4.1.1"
}
},
"prop-types-extra": {
"version": "1.1.0",
"resolved": "https://registry.npmjs.org/prop-types-extra/-/prop-types-extra-1.1.0.tgz",
"integrity": "sha512-QFyuDxvMipmIVKD2TwxLVPzMnO4e5oOf1vr3tJIomL8E7d0lr6phTHd5nkPhFIzTD1idBLLEPeylL9g+rrTzRg==",
"requires": {
"react-is": "^16.3.2",
"warning": "^3.0.0"
}
},
"react": {
"version": "16.7.0",
"resolved": "https://registry.npmjs.org/react/-/react-16.7.0.tgz",
"integrity": "sha512-StCz3QY8lxTb5cl2HJxjwLFOXPIFQp+p+hxQfc8WE0QiLfCtIlKj8/+5tjjKm8uSTlAW+fCPaavGFS06V9Ar3A==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"scheduler": "^0.12.0"
}
},
"react-bootstrap": {
"version": "0.32.1",
"resolved": "https://registry.npmjs.org/react-bootstrap/-/react-bootstrap-0.32.1.tgz",
"integrity": "sha512-RbfzKUbsukWsToWqGHfCCyMFq9QQI0TznutdyxyJw6dih2NvIne25Mrssg8LZsprqtPpyQi8bN0L0Fx3fUsL8Q==",
"requires": {
"babel-runtime": "^6.11.6",
"classnames": "^2.2.5",
"dom-helpers": "^3.2.0",
"invariant": "^2.2.1",
"keycode": "^2.1.2",
"prop-types": "^15.5.10",
"prop-types-extra": "^1.0.1",
"react-overlays": "^0.8.0",
"react-prop-types": "^0.4.0",
"react-transition-group": "^2.0.0",
"uncontrollable": "^4.1.0",
"warning": "^3.0.0"
}
},
"react-dom": {
"version": "16.7.0",
"resolved": "https://registry.npmjs.org/react-dom/-/react-dom-16.7.0.tgz",
"integrity": "sha512-D0Ufv1ExCAmF38P2Uh1lwpminZFRXEINJe53zRAbm4KPwSyd6DY/uDoS0Blj9jvPpn1+wivKpZYc8aAAN/nAkg==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1",
"prop-types": "^15.6.2",
"scheduler": "^0.12.0"
}
},
"react-is": {
"version": "16.7.0",
"resolved": "https://registry.npmjs.org/react-is/-/react-is-16.7.0.tgz",
"integrity": "sha512-Z0VRQdF4NPDoI0tsXVMLkJLiwEBa+RP66g0xDHxgxysxSoCUccSten4RTF/UFvZF1dZvZ9Zu1sx+MDXwcOR34g=="
},
"react-lifecycles-compat": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz",
"integrity": "sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA=="
},
"react-overlays": {
"version": "0.8.3",
"resolved": "https://registry.npmjs.org/react-overlays/-/react-overlays-0.8.3.tgz",
"integrity": "sha512-h6GT3jgy90PgctleP39Yu3eK1v9vaJAW73GOA/UbN9dJ7aAN4BTZD6793eI1D5U+ukMk17qiqN/wl3diK1Z5LA==",
"requires": {
"classnames": "^2.2.5",
"dom-helpers": "^3.2.1",
"prop-types": "^15.5.10",
"prop-types-extra": "^1.0.1",
"react-transition-group": "^2.2.0",
"warning": "^3.0.0"
}
},
"react-prop-types": {
"version": "0.4.0",
"resolved": "https://registry.npmjs.org/react-prop-types/-/react-prop-types-0.4.0.tgz",
"integrity": "sha1-+ZsL+0AGkpya8gUefBQUpcdbk9A=",
"requires": {
"warning": "^3.0.0"
}
},
"react-transition-group": {
"version": "2.5.3",
"resolved": "https://registry.npmjs.org/react-transition-group/-/react-transition-group-2.5.3.tgz",
"integrity": "sha512-2DGFck6h99kLNr8pOFk+z4Soq3iISydwOFeeEVPjTN6+Y01CmvbWmnN02VuTWyFdnRtIDPe+wy2q6Ui8snBPZg==",
"requires": {
"dom-helpers": "^3.3.1",
"loose-envify": "^1.4.0",
"prop-types": "^15.6.2",
"react-lifecycles-compat": "^3.0.4"
}
},
"regenerator-runtime": {
"version": "0.11.1",
"resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz",
"integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg=="
},
"scheduler": {
"version": "0.12.0",
"resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.12.0.tgz",
"integrity": "sha512-t7MBR28Akcp4Jm+QoR63XgAi9YgCUmgvDHqf5otgAj4QvdoBE4ImCX0ffehefePPG+aitiYHp0g/mW6s4Tp+dw==",
"requires": {
"loose-envify": "^1.1.0",
"object-assign": "^4.1.1"
}
},
"uncontrollable": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/uncontrollable/-/uncontrollable-4.1.0.tgz",
"integrity": "sha1-4DWCkSUuGGUiLZCTmxny9J+Bwak=",
"requires": {
"invariant": "^2.1.0"
}
},
"warning": {
"version": "3.0.0",
"resolved": "https://registry.npmjs.org/warning/-/warning-3.0.0.tgz",
"integrity": "sha1-MuU3fLVy3kqwR1O9+IIcAe1gW3w=",
"requires": {
"loose-envify": "^1.0.0"
}
}
}
}

17
package.json Normal file
View File

@ -0,0 +1,17 @@
{
"name": "app_name",
"version": "0.0.1",
"description": "",
"main": "Gruntfile.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"homepage": "",
"dependencies": {
"react": "^16.3.2",
"react-bootstrap": "0.32.1",
"react-dom": "^16.3.2"
}
}