kopia lustrzana https://github.com/bugout-dev/moonstream
Small fixes, config sample, deployment for contracts configs changes
rodzic
ca61553b1b
commit
022ad8c4c9
|
@ -31,6 +31,7 @@ var (
|
|||
// TODO(kompotkot): Find out why it cuts out the port
|
||||
BUGOUT_BROOD_URL = "https://auth.bugout.dev"
|
||||
// BUGOUT_BROOD_URL = os.Getenv("BUGOUT_BROOD_URL")
|
||||
NB_BUGOUT_TIMEOUT_SECONDS = 10
|
||||
NB_BUGOUT_TIMEOUT_SECONDS_RAW = os.Getenv("NB_BUGOUT_TIMEOUT_SECONDS")
|
||||
|
||||
// Bugout and application configuration
|
||||
|
@ -81,11 +82,14 @@ var (
|
|||
)
|
||||
|
||||
func CreateBugoutClient() (*bugout.BugoutClient, error) {
|
||||
bugoutTimeoutSeconds, err := strconv.Atoi(NB_BUGOUT_TIMEOUT_SECONDS_RAW)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("unable to parse environment variable as integer: %v", err)
|
||||
bugoutTimeoutSeconds, atoiErr := strconv.Atoi(NB_BUGOUT_TIMEOUT_SECONDS_RAW)
|
||||
if atoiErr != nil {
|
||||
log.Printf("Unable to parse environment variable NB_BUGOUT_TIMEOUT_SECONDS as integer and set to default %d, err: %v", NB_BUGOUT_TIMEOUT_SECONDS, atoiErr)
|
||||
} else {
|
||||
NB_BUGOUT_TIMEOUT_SECONDS = bugoutTimeoutSeconds
|
||||
}
|
||||
NB_BUGOUT_TIMEOUT_SECONDS := time.Duration(bugoutTimeoutSeconds) * time.Second
|
||||
|
||||
NB_BUGOUT_TIMEOUT_SECONDS := time.Duration(NB_BUGOUT_TIMEOUT_SECONDS) * time.Second
|
||||
|
||||
bugoutClient := bugout.ClientBrood(BUGOUT_BROOD_URL, NB_BUGOUT_TIMEOUT_SECONDS)
|
||||
return &bugoutClient, nil
|
||||
|
|
Plik binarny nie jest wyświetlany.
|
@ -0,0 +1,18 @@
|
|||
[
|
||||
{
|
||||
"blockchain": "ethereum",
|
||||
"endpoint": "https://mainnet.infura.io",
|
||||
"tags": [
|
||||
"external",
|
||||
"sample"
|
||||
]
|
||||
},
|
||||
{
|
||||
"blockchain": "polygon",
|
||||
"endpoint": "https://polygon-mainnet.infura.io",
|
||||
"tags": [
|
||||
"external",
|
||||
"sample"
|
||||
]
|
||||
}
|
||||
]
|
|
@ -17,6 +17,8 @@ PREFIX_CRIT="${C_RED}[CRIT]${C_RESET} [$(date +%d-%m\ %T)]"
|
|||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION:-us-east-1}"
|
||||
APP_DIR="${APP_DIR:-/home/ubuntu/api}"
|
||||
SECRETS_DIR="${SECRETS_DIR:-/home/ubuntu/nodebalancer-secrets}"
|
||||
CONFIGS_DIR="${CONFIGS_DIR:-/home/ubuntu/.nodebalancer}"
|
||||
NB_CONTRACTS_CONFIG_PATH="${CONFIGS_DIR}/contractsConfig.json"
|
||||
PARAMETERS_ENV_PATH="${SECRETS_DIR}/app.env"
|
||||
SCRIPT_DIR="$(realpath $(dirname $0))"
|
||||
|
||||
|
@ -45,6 +47,11 @@ echo
|
|||
echo -e "${PREFIX_INFO} Retrieving addition deployment parameters"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" /home/ubuntu/go/bin/checkenv show aws_ssm+nodebalancer:true >> "${PARAMETERS_ENV_PATH}"
|
||||
|
||||
echo
|
||||
echo
|
||||
log_handler "Retrieve nodebalancer contracts config"
|
||||
AWS_DEFAULT_REGION="${AWS_DEFAULT_REGION}" aws ssm get-parameter --name "NB_CONTRACTS_CONFIG_JSON" --output text --query Parameter.Value > "${NB_CONTRACTS_CONFIG_PATH}"
|
||||
|
||||
echo
|
||||
echo
|
||||
echo -e "${PREFIX_INFO} Building executable load balancer for nodes script with Go"
|
||||
|
|
|
@ -13,7 +13,8 @@ ExecStart=/home/ubuntu/api/nodebalancer/nodebalancer server \
|
|||
--host "${AWS_LOCAL_IPV4}" \
|
||||
--port 8544 \
|
||||
--healthcheck \
|
||||
--config /home/ubuntu/.nodebalancer/config.json
|
||||
--config /home/ubuntu/.nodebalancer/config.json \
|
||||
--contracts-config /home/ubuntu/.nodebalancer/contractsConfig.json
|
||||
SyslogIdentifier=nodebalancer
|
||||
|
||||
[Install]
|
||||
|
|
Ładowanie…
Reference in New Issue