Update config
Set prod to default (=0) & correction typo
This commit is contained in:
parent
3881c0ae0e
commit
e5d1b705e1
|
@ -3,9 +3,11 @@ package blockchain.configuration;
|
||||||
public class AppConfig {
|
public class AppConfig {
|
||||||
// 0 = Actual & 1 = Back-up
|
// 0 = Actual & 1 = Back-up
|
||||||
private static int ENV = 0;
|
private static int ENV = 0;
|
||||||
// 0 = QA & 1 = PROD & 2 = TEST
|
// 0 = PROD & 1 = QA & 2 = TEST
|
||||||
private static int CHAINCODE_IDX = 0;
|
private static int CHAINCODE_IDX = 0;
|
||||||
|
|
||||||
|
|
||||||
|
// ENVIRONMENT
|
||||||
public static String getCA_URL(){
|
public static String getCA_URL(){
|
||||||
if(ENV==0){
|
if(ENV==0){
|
||||||
return "http://vps577432.ovh.net:7054";
|
return "http://vps577432.ovh.net:7054";
|
||||||
|
@ -13,7 +15,6 @@ public class AppConfig {
|
||||||
return "http://93.30.148.59:7054";
|
return "http://93.30.148.59:7054";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getORDERER_URL(){
|
public static String getORDERER_URL(){
|
||||||
if(ENV==0){
|
if(ENV==0){
|
||||||
return "grpc://vps577432.ovh.net:7050";
|
return "grpc://vps577432.ovh.net:7050";
|
||||||
|
@ -21,7 +22,6 @@ public class AppConfig {
|
||||||
return "grpc://93.30.148.59:7050";
|
return "grpc://93.30.148.59:7050";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String getPEER_0_URL(){
|
public static String getPEER_0_URL(){
|
||||||
if(ENV==0){
|
if(ENV==0){
|
||||||
return "grpc://vps577432.ovh.net:7051";
|
return "grpc://vps577432.ovh.net:7051";
|
||||||
|
@ -30,19 +30,23 @@ public class AppConfig {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// CHAINCODE
|
||||||
public static String getCHAINCODE(){
|
public static String getCHAINCODE(){
|
||||||
if(CHAINCODE_IDX==0 || CHAINCODE_IDX==2){
|
if(CHAINCODE_IDX==0){
|
||||||
return "monnethic_qa";
|
|
||||||
}else {
|
|
||||||
return "monnethic-prod";
|
return "monnethic-prod";
|
||||||
|
}else {
|
||||||
|
return "monnethic_qa";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// DB
|
||||||
public static String getDATABASE(){
|
public static String getDATABASE(){
|
||||||
if(CHAINCODE_IDX==0){
|
if(CHAINCODE_IDX==0){
|
||||||
return "monnethic_qa";
|
|
||||||
}else if(CHAINCODE_IDX==1) {
|
|
||||||
return "monnethic_prod";
|
return "monnethic_prod";
|
||||||
|
}else if(CHAINCODE_IDX==1) {
|
||||||
|
return "monnethic_qa";
|
||||||
}else{
|
}else{
|
||||||
return "monnethic_test";
|
return "monnethic_test";
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,11 +50,11 @@ public class ConfigResource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping(value = "/chaicode", method = RequestMethod.GET, produces = "application/json")
|
@RequestMapping(value = "/chaincode", method = RequestMethod.GET, produces = "application/json")
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
public ResponseEntity getChaincode(){
|
public ResponseEntity getChaincode(){
|
||||||
try{
|
try{
|
||||||
return ResponseEntity.status(HttpStatus.OK).body("{\"chaincode\":"+AppConfig.getCHAINCODE()+"}");
|
return ResponseEntity.status(HttpStatus.OK).body("{\"chaincode\":\""+AppConfig.getCHAINCODE()+"\"}");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
String r = "{\"response\":\""+e.getMessage()+"\"}";
|
String r = "{\"response\":\""+e.getMessage()+"\"}";
|
||||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(r);
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(r);
|
||||||
|
@ -67,7 +67,7 @@ public class ConfigResource {
|
||||||
@ResponseStatus(HttpStatus.OK)
|
@ResponseStatus(HttpStatus.OK)
|
||||||
public ResponseEntity getDb(){
|
public ResponseEntity getDb(){
|
||||||
try{
|
try{
|
||||||
return ResponseEntity.status(HttpStatus.OK).body("{\"db\":"+AppConfig.getDATABASE()+"}");
|
return ResponseEntity.status(HttpStatus.OK).body("{\"db\":\""+AppConfig.getDATABASE()+"\"}");
|
||||||
}catch (Exception e){
|
}catch (Exception e){
|
||||||
String r = "{\"response\":\""+e.getMessage()+"\"}";
|
String r = "{\"response\":\""+e.getMessage()+"\"}";
|
||||||
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(r);
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(r);
|
||||||
|
|
Loading…
Reference in a new issue