Skip to content

Commit da92171

Browse files
committed
fix testnet support
1 parent a3773b1 commit da92171

File tree

5 files changed

+16
-21
lines changed

5 files changed

+16
-21
lines changed

boilerplate/config/blockchain.yml

Lines changed: 9 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,38 @@
11
development:
22
rpc_host: localhost
33
rpc_port: 8101
4-
mine: false
5-
rpc_whitelist: localhost
4+
rpc_whitelist: "*"
65
minerthreads: 1
76
genesis_block: config/genesis/dev_genesis.json
87
datadir: /tmp/embark
98
chains: config/chains/development.json
109
mine_when_needed: true
11-
max_peers: 0
1210
gas_limit: 500000
1311
gas_price: 10000000000000
12+
console: false
1413
account:
1514
init: true
1615
password: config/password
17-
num: 1
1816
staging:
17+
testnet: true
1918
rpc_host: localhost
2019
rpc_port: 8101
21-
rpc_whitelist: localhost
20+
rpc_whitelist: "*"
2221
datadir: default
23-
mine: false
2422
network_id: 0
25-
max_peers: 4
26-
bootnodes:
27-
boot: false
28-
enodes: [] #insert enode urls here.
29-
nat: any #NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)
30-
port: 30303
23+
deploy_timeout: 45
24+
console: true
3125
account:
3226
init: false
3327
address:
3428
production:
3529
rpc_host: localhost
3630
rpc_port: 8101
37-
rpc_whitelist: localhost
31+
rpc_whitelist: "*"
3832
datadir: default
3933
network_id: 1
40-
mine: false
41-
max_peers: 4
42-
bootnodes:
43-
boot: false
44-
enodes: []
45-
nat: any #NAT port mapping mechanism (any|none|upnp|pmp|extip:<IP>)
46-
port: 30303
34+
console: true
4735
account:
4836
init: false
4937
address:
38+

demo/config/blockchain.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ development:
1414
init: true
1515
password: config/password
1616
staging:
17+
testnet: true
1718
rpc_host: localhost
1819
rpc_port: 8101
1920
rpc_whitelist: "*"

lib/blockchain.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ Blockchain.prototype.generate_basic_command = function() {
4747
cmd += "--datadir=\"" + config.datadir + "\" ";
4848
}
4949

50+
if (config.testnet) {
51+
cmd += "--testnet ";
52+
}
53+
5054
if (config.account.password !== void 0) {
5155
cmd += "--password " + config.account.password + " ";
5256
}

lib/config/blockchain.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ BlockchainConfig.prototype.config = function(env) {
3333

3434

3535
config = {
36+
testnet: false,
3637
rpcHost: config.rpc_host,
3738
rpcPort: config.rpc_port,
3839
gasLimit: config.gas_limit || 500000,

test/deploy.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ describe('embark.deploy', function() {
9696
result += deploy.generate_provider_file();
9797
result += deploy.generate_abi_file();
9898

99-
assert.strictEqual(result, "var web3 = new Web3();web3.setProvider(new web3.providers.HttpProvider('http://localhost:8101'));web3.eth.defaultAccount = web3.eth.accounts[0];blockchain = {\"rpcHost\":\"localhost\",\"rpcPort\":8101,\"gasLimit\":1000000,\"gasPrice\":10000000000000,\"rpcWhitelist\":\"*\",\"nat\":[],\"minerthreads\":1,\"genesisBlock\":\"config/genesis.json\",\"datadir\":\"/tmp/embark\",\"bootNodes\":[],\"deployTimeout\":20,\"networkId\":"+deploy.blockchainConfig.networkId+",\"maxPeers\":4,\"mine\":false,\"port\":\"30303\",\"console_toggle\":false,\"mine_when_needed\":true,\"whisper\":false,\"account\":{\"init\":true,\"password\":\"config/password\"},\"geth_extra_opts\":[],\"testnet\":false,\"deploy_synchronously\":false};SimpleStorageAbi = 123;SimpleStorageContract = web3.eth.contract(SimpleStorageAbi);SimpleStorage = SimpleStorageContract.at('0x123');AnotherStorageAbi = 234;AnotherStorageContract = web3.eth.contract(AnotherStorageAbi);AnotherStorage = AnotherStorageContract.at('0x234');contractDB = {\"SimpleStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":123}}},\"AnotherStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":234}}}};");
99+
assert.strictEqual(result, "var web3 = new Web3();web3.setProvider(new web3.providers.HttpProvider('http://localhost:8101'));web3.eth.defaultAccount = web3.eth.accounts[0];blockchain = {\"testnet\":false,\"rpcHost\":\"localhost\",\"rpcPort\":8101,\"gasLimit\":1000000,\"gasPrice\":10000000000000,\"rpcWhitelist\":\"*\",\"nat\":[],\"minerthreads\":1,\"genesisBlock\":\"config/genesis.json\",\"datadir\":\"/tmp/embark\",\"bootNodes\":[],\"deployTimeout\":20,\"networkId\":"+deploy.blockchainConfig.networkId+",\"maxPeers\":4,\"mine\":false,\"port\":\"30303\",\"console_toggle\":false,\"mine_when_needed\":true,\"whisper\":false,\"account\":{\"init\":true,\"password\":\"config/password\"},\"geth_extra_opts\":[],\"deploy_synchronously\":false};SimpleStorageAbi = 123;SimpleStorageContract = web3.eth.contract(SimpleStorageAbi);SimpleStorage = SimpleStorageContract.at('0x123');AnotherStorageAbi = 234;AnotherStorageContract = web3.eth.contract(AnotherStorageAbi);AnotherStorage = AnotherStorageContract.at('0x234');contractDB = {\"SimpleStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":123}}},\"AnotherStorage\":{\"compiled\":{\"info\":{\"abiDefinition\":234}}}};");
100100
});
101101
});
102102
});

0 commit comments

Comments
 (0)