Configuration update

This commit is contained in:
viktor 2017-07-21 16:20:25 +03:00
parent 4cad317bfc
commit 7a52f8bf54
2 changed files with 19 additions and 28 deletions

View File

@ -3,13 +3,13 @@ var Web3 = require('web3');
var web3;
var config = JSON.parse(fs.readFileSync('./config.json', 'utf8'));
var contractABI = config.smartContract.abi;
var contractABI = config.Ethereum.contracts.ProofOfPhone.abi;
if (typeof web3 !== 'undefined') {
web3 = new Web3(web3.currentProvider);
} else {
web3 = new Web3(new Web3.providers.HttpProvider(config.Ethereum[config.environment].rpc));
}
var contractAddress = config.smartContract.contractAddress[config.environment];
var contractAddress = config.Ethereum[config.environment].contractAddress;
var wallet = "";
var phone = "";

View File

@ -1,32 +1,23 @@
{
"environment": "live/dev",
"globalToken": "globalToken_for_using_proof_of_phone_api",
"salt": "salt_for_message_with_hash_creating",
"mongodbConnectionString": "mongodb://user:password@path_to_database",
"sendSMS": {
"twilio": {
"phoneNumberTest": "+12345678900",
"phoneNumberLive": "+12345678900",
"accountSIDTest": "twilio_account_SID_test",
"authTokenTest": "twilio_auth_token_test",
"accountSIDLive": "twilio_account_SID_live",
"authTokenLive": "twilio_auth_token_live"
}
},
"smartContract": {
"bin": "0x6060604052341561000f57600080fd5b5b6104568061001f6000396000f300606060405236156100805763ffffffff7c01000000000000000000000000000000000000000000000000000000006000350416630367966681146100855780633404fe32146100b75780635fb3f3b5146100d257806371d01c73146100ea578063b958a5e11461011b578063ceaecc841461014c578063fe97ee881461017e575b600080fd5b341561009057600080fd5b61009b6004356101b1565b604051600160a060020a03909116815260200160405180910390f35b34156100c257600080fd5b6100d06004356024356101cf565b005b34156100dd57600080fd5b6100d060043561023b565b005b34156100f557600080fd5b610109600160a060020a03600435166103aa565b60405190815260200160405180910390f35b341561012657600080fd5b610109600160a060020a03600435166103bc565b60405190815260200160405180910390f35b341561015757600080fd5b61009b6004356103db565b604051600160a060020a03909116815260200160405180910390f35b341561018957600080fd5b61019d600160a060020a03600435166103f6565b604051901515815260200160405180910390f35b600081815260016020526040902054600160a060020a03165b919050565b604080519081016040908152838252600160a060020a0333166020808401919091526000848152600290915220815181556020820151600191909101805473ffffffffffffffffffffffffffffffffffffffff1916600160a060020a03909216919091179055505b5050565b33600160a060020a031660026000836040519081526020016040519081900390208152602081019190915260400160002060010154600160a060020a03161461028357600080fd5b600260008260405190815260200160405180910390206000191660001916815260200190815260200160002060010160009054906101000a9004600160a060020a031660016000600260008560405190815260200160405180910390206000191660001916815260200190815260200160002060000154815260200190815260200160002060006101000a815481600160a060020a030219169083600160a060020a03160217905550600260008260405190815260200160405180910390206000191660001916815260200190815260200160002060000154600080600260008560405190815260200160405190819003902081526020808201929092526040908101600090812060010154600160a060020a031684529183019390935291019020555b50565b60006020819052908152604090205481565b600160a060020a0381166000908152602081905260409020545b919050565b600160205260009081526040902054600160a060020a031681565b600160a060020a0381166000908152602081905260408120541561041c575060016101ca565b5060006101ca565b5b9190505600a165627a7a7230582050345f78bdbfe2e76a3da18b5175077fc8d6cb5466ba9b133bec3e02d2ee22450029",
"ABI": [{"constant":true,"inputs":[{"name":"phone","type":"uint256"}],"name":"getAddressByPhone","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"phone","type":"uint256"},{"name":"token","type":"bytes32"}],"name":"newToken","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"code","type":"uint256"}],"name":"activatePair","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"address"}],"name":"addressPhonePair","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"getPhoneByAddress","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"","type":"uint256"}],"name":"phoneAddressPair","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"addr","type":"address"}],"name":"hasPhone","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"}],
"wallet": {
"test": "0x0000000000000000000000000000000000000000",
"live": "0x0000000000000000000000000000000000000000"
},
"contractAddress": {
"test": "0x0000000000000000000000000000000000000000",
"live": "0x0000000000000000000000000000000000000000"
},
"rpc": {
"test": "http://host:port",
"live": "http://host:port"
"sendSMS" : {
"twilio": {
"dev": {
"phoneNumber": "+12345678900",
"accountSID": "twilio_account_SID_dev",
"authToken": "twilio_auth_token_dev"
},
"live": {
"phoneNumber": "+12345678900",
"accountSID": "twilio_account_SID_live",
"authToken": "twilio_auth_token_live"
}
}
},
"Ethereum": {
"live": {
"rpc": "http://host:port"
}
}
}