github.com/vchain-us/vcn@v0.9.11-0.20210921212052-a2484d23c0b3/pkg/meta/config.go (about)

     1  /*
     2   * Copyright (c) 2018-2020 vChain, Inc. All Rights Reserved.
     3   * This software is released under GPL3.
     4   * The full license information can be found under:
     5   * https://www.gnu.org/licenses/gpl-3.0.en.html
     6   *
     7   */
     8  
     9  package meta
    10  
    11  import (
    12  	"math/big"
    13  	"os"
    14  	"time"
    15  )
    16  
    17  // DashboardURL returns the CodeNotary's dashboard URL.
    18  func DashboardURL() string {
    19  	switch StageEnvironment() {
    20  	case StageTest:
    21  		return os.Getenv("VCN_TEST_DASHBOARD")
    22  	case StageStaging:
    23  		return "https://dashboard.staging.codenotary.io"
    24  	case StageProduction:
    25  		fallthrough
    26  	default:
    27  		return "https://dashboard.codenotary.io"
    28  	}
    29  }
    30  
    31  // MainNet returns the CodeNotary mainnet URL.
    32  func MainNet() string {
    33  	switch StageEnvironment() {
    34  	case StageTest:
    35  		return os.Getenv("VCN_TEST_NET")
    36  	case StageStaging:
    37  		return "https://main.staging.codenotary.io"
    38  	case StageProduction:
    39  		fallthrough
    40  	default:
    41  		return "https://main.codenotary.io"
    42  	}
    43  }
    44  
    45  // APIEndpoint returns the API's endpoint URL for a given resource.
    46  func APIEndpoint(resource string) string {
    47  	base := ""
    48  	switch StageEnvironment() {
    49  	case StageTest:
    50  		base = os.Getenv("VCN_TEST_API")
    51  	case StageStaging:
    52  		base = "https://api.staging.codenotary.io/foundation"
    53  	case StageProduction:
    54  		fallthrough
    55  	default:
    56  		base = "https://api.codenotary.io/foundation"
    57  	}
    58  
    59  	return base + "/v1/" + resource
    60  }
    61  
    62  // AssetsRelayContractAddress returns the AssetsRelay smart contract public address.
    63  func AssetsRelayContractAddress() string {
    64  	switch StageEnvironment() {
    65  	case StageTest:
    66  		return os.Getenv("VCN_TEST_CONTRACT")
    67  	case StageStaging:
    68  		return "0x4eb8d2866da4341796ce64a983786a01b1072939"
    69  	case StageProduction:
    70  		fallthrough
    71  	default:
    72  		return "0x41a749a79a78b388607df06c25adbc73dbbf1e87"
    73  	}
    74  }
    75  
    76  // OrganisationsRelayContractAddress returns the OrganisationsRelay smart contract public address.
    77  func OrganisationsRelayContractAddress() string {
    78  	switch StageEnvironment() {
    79  	case StageTest:
    80  		return os.Getenv("VCN_TEST_CONTRACT_ORG")
    81  	case StageStaging:
    82  		return "0x4a9a0547949ec55ecbf06738e8c2bad747f410bb"
    83  	case StageProduction:
    84  		fallthrough
    85  	default:
    86  		return "0x258e39ff07e6e3a2430aa951f387cfbd808835bc"
    87  	}
    88  }
    89  
    90  // TxVerificationRounds returns the maximum number of rounds to try before considering a pending transaction failed.
    91  // The duration of each round is returned by PollInterval()
    92  func TxVerificationRounds() uint64 {
    93  	return 30
    94  }
    95  
    96  // PollInterval returns the waiting time between each round.
    97  // See TxVerificationRounds().
    98  func PollInterval() time.Duration {
    99  	return 2 * time.Second
   100  }
   101  
   102  // GasPrice for transactions.
   103  func GasPrice() *big.Int {
   104  	return big.NewInt(0)
   105  }
   106  
   107  // GasLimit for transactions.
   108  func GasLimit() uint64 {
   109  	return 20000000
   110  }
   111  
   112  // WildcardMaxFileNumber wildcard max file number for a single notarization
   113  func WildcardMaxFileNumber() int {
   114  	return 100
   115  }