diff --git a/README.md b/README.md index ce3e278..71cccc8 100644 --- a/README.md +++ b/README.md @@ -15,5 +15,5 @@ Gas relayer mplementation for economic abstraction. This project consists of two ## Deployment Details | Contract | Ropsten Address | Mainnet Address | | ---------------------------|------------------------------------------- | ------------------------------------------ | -| status/SNTController | 0xA77A1014F55157c3119FB3f53E653E42f8fa634c | - | -| identity/IdentityFactory | 0x7F106A1Bc637AC4AAed3DC72582749c4562D4323 | - | +| status/SNTController | 0x1f42B87b375b8ac6C77A8CAd8E78319c18695E75 | - | +| identity/IdentityFactory | 0xCf3473C2A50F7A94D3D7Dcc2BeBbeE989dAA014E | - | diff --git a/gas-relayer/config/config.testnet.js b/gas-relayer/config/config.testnet.js index e536038..8feaf97 100644 --- a/gas-relayer/config/config.testnet.js +++ b/gas-relayer/config/config.testnet.js @@ -11,7 +11,7 @@ module.exports = { "port": 8545 }, "blockchain": { - "account": "0xb8d851486d1c953e31a44374aca11151d49b8bb3" + privateKey: "0x......" // }, "whisper": { "symKey": "0xd0d905c1c62b810b787141430417caf2b3f54cffadb395b7bb39fdeb8f17266b", @@ -28,8 +28,8 @@ module.exports = { "minAcceptedRate": 1, "refreshPricePeriod": 60000 }, - "0x91a3473a3e1e3D61C29fa2fAcDf17fa0Db922a08": { - "name": "Status Gas Relayer Test Token", + "0x139724523662E54447B70d043b711b2A00c5EF49": { + "name": "Status Test Token", "symbol": "SNT", "minAcceptedRate": 150000000000000, "refreshPricePeriod": 60000, @@ -41,7 +41,7 @@ module.exports = { "IdentityGasRelay": { "abiFile": "../abi/IdentityGasRelay.json", "isIdentity": true, - "factoryAddress": "0xC83a746c3B73457FF51eCE216bfBFb524aa4fDD0", + "factoryAddress": "0xCf3473C2A50F7A94D3D7Dcc2BeBbeE989dAA014E", "kernelVerification": "isKernel(bytes32)", "allowedFunctions": [ { @@ -58,7 +58,7 @@ module.exports = { "SNTController": { "abiFile": "../abi/SNTController.json", "isIdentity": false, - "address": "0x39bFD424c2A83ca56FD557b373C01A27475bB314", + "address": "0x1f42B87b375b8ac6C77A8CAd8E78319c18695E75", "allowedFunctions": [ { "function":"transferSNT(address,uint256,uint256,uint256,bytes)" diff --git a/gas-relayer/launch-geth-testnet.sh b/gas-relayer/launch-geth-testnet.sh index 181e80b..2f5f0fb 100755 --- a/gas-relayer/launch-geth-testnet.sh +++ b/gas-relayer/launch-geth-testnet.sh @@ -1,2 +1,4 @@ #!/bin/bash -geth --testnet --syncmode=light --port=30303 --rpc --rpcport=8545 --rpcaddr=localhost --rpccorsdomain=http://localhost:8000 --ws --wsport=8546 --wsaddr=localhost --wsorigins="gas-relayer" --shh --shh.pow=0.002 --rpcapi=eth,web3,net,shh --wsapi=eth,web3,net,shh +#!/bin/bash +geth --testnet --syncmode=light --port=30303 --ws --wsport=8546 --wsaddr=localhost --wsorigins=http://localhost:8000,embark,gas-relayer --maxpeers=25 --shh --shh.pow=0.002 --wsapi=eth,web3,net,shh + diff --git a/gas-relayer/src/service.js b/gas-relayer/src/service.js index 9136d75..b94395c 100644 --- a/gas-relayer/src/service.js +++ b/gas-relayer/src/service.js @@ -29,7 +29,7 @@ const events = new EventEmitter(); // Web3 Connection const connectionURL = `${config.node.local.protocol}://${config.node.local.host}:${config.node.local.port}`; -const wsProvider = new Web3.providers.WebsocketProvider(connectionURL, {headers: {Origin: "embark"}}); +const wsProvider = new Web3.providers.WebsocketProvider(connectionURL, {headers: {Origin: "gas-relayer"}}); const web3 = new Web3(wsProvider); let account; diff --git a/test-dapp/app/index.html b/test-dapp/app/index.html index 142a9a2..d75f99b 100644 --- a/test-dapp/app/index.html +++ b/test-dapp/app/index.html @@ -13,7 +13,7 @@

The following demos are available:

diff --git a/test-dapp/app/status-gas-relayer.js b/test-dapp/app/status-gas-relayer.js index a706ad1..4d67a88 100644 --- a/test-dapp/app/status-gas-relayer.js +++ b/test-dapp/app/status-gas-relayer.js @@ -74,9 +74,9 @@ class StatusGasRelayer { web3.shh.subscribe('messages', { "privateKeyID": options.privateKeyID, - "ttl": options.ttl || 1000, + "ttl": options.ttl || 10, "minPow": options.minPow || 0.002, - "powTime": options.powTime || 1000 + "powTime": options.powTime || 1 }, (error, message) => { if(error){ cb(error); diff --git a/test-dapp/config/blockchain.js b/test-dapp/config/blockchain.js index f699003..88d4d4d 100644 --- a/test-dapp/config/blockchain.js +++ b/test-dapp/config/blockchain.js @@ -7,7 +7,7 @@ module.exports = { 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 + wsOrigins: "http://localhost:8000,gas-relayer", // 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) diff --git a/test-dapp/config/contracts.js b/test-dapp/config/contracts.js index 0ba85fe..e80daac 100644 --- a/test-dapp/config/contracts.js +++ b/test-dapp/config/contracts.js @@ -1,5 +1,6 @@ module.exports = { // default applies to all environments + default: { // Blockchain node to deploy the contracts deployment: { @@ -98,6 +99,68 @@ module.exports = { // merges with the settings in default // used with "embark run testnet" testnet: { + deployment: { + accounts: [ + { + privateKey: '5AC0FF313884BC134DC5B8D92C40360BFB9FC16F8552B60587D27C942564201E', + } + ], + host: "ropsten.infura.io/v3/e62b6ada19b042ee9c6d68746b965ccf", + port: false, + protocol: 'https', // <=== must be specified for infura, can also be http, or ws + type: "rpc" + }, + contracts: { + // Reuse contracts on testnet + "MiniMeTokenFactory": { + "address": "0x6bfa86a71a7dbc68566d5c741f416e3009804279" + }, + "STT": { + "instanceOf": "TestMiniMeToken", + "address": "0x139724523662E54447B70d043b711b2A00c5EF49" + }, + "SNTController": { + "address": "0x1f42B87b375b8ac6C77A8CAd8E78319c18695E75" + }, + "IdentityGasRelay": { + "deploy": false + }, + "IdentityFactory": { + "address": "0xCf3473C2A50F7A94D3D7Dcc2BeBbeE989dAA014E" + }, + "TestContract": { + "address": "0x19fbEE3C3eB0070Df1ab9ba4cB8ab24F0efEBdF8" + } + + // Deploy new contracts to testnet + /* + "MiniMeTokenFactory": { + "address": "0x6bfa86a71a7dbc68566d5c741f416e3009804279" + }, + "STT": { + "instanceOf": "TestMiniMeToken", + "args":["$MiniMeTokenFactory", "0x0", "0x0", "Status Gas Relayer Test Token", 18, "SGasT", true], + "gasLimit": 4000000 + }, + "SNTController": { + "args": ["$accounts[0]", "$STT"], + }, + "IdentityGasRelay": { + "deploy": true, + "args": [[], [], [], 1, 1, "0x0000000000000000000000000000000000000000"] + }, + "IdentityFactory": { + "args":[], + "gasLimit": 5000000 + }, + "TestContract": { + "args": ["$STT"] + }*/ + }, + "afterDeploy": [ + "STT.methods.changeController(SNTController.options.address).send()", + "SNTController.methods.enablePublicExecution(TestContract.options.address, true).send()" + ] }, // merges with the settings in default diff --git a/test-dapp/launch-geth-testnet.sh b/test-dapp/launch-geth-testnet.sh index 4c6627d..39123df 100755 --- a/test-dapp/launch-geth-testnet.sh +++ b/test-dapp/launch-geth-testnet.sh @@ -1,3 +1,3 @@ #!/bin/bash -geth --testnet --syncmode=light --password=config/testnet/password --port=30303 --rpc --rpcport=8545 --rpcaddr=localhost --rpccorsdomain=http://localhost:8000 --ws --wsport=8546 --wsaddr=localhost --wsorigins=http://localhost:8000,http://localhost:8080 --maxpeers=25 --shh --shh.pow=0.002 --rpcapi=eth,web3,net,debug,shh --wsapi=eth,web3,net,shh,debug --unlock=7c13ad39c6c2b2ee9ada21482751be478df7fac7 +geth --testnet --syncmode=light --port=30303 --ws --wsport=8546 --wsaddr=localhost --wsorigins=http://localhost:8000,embark,gas-relayer --maxpeers=25 --shh --shh.pow=0.002 --wsapi=eth,web3,net,shh