Skip to content

Commit

Permalink
Deployment: Fix Ethereum path, adapt oracleservice
Browse files Browse the repository at this point in the history
  • Loading branch information
kaythxbye committed Mar 4, 2020
1 parent d7fa349 commit 0950a2a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 29 deletions.
29 changes: 1 addition & 28 deletions cmd/blockchain/ethereum/oracleService/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ func main() {
/*
* Update Oracle periodically with top coins
*/
ticker := time.NewTicker(4 * time.Hour)
ticker := time.NewTicker(24 * time.Hour)
go func() {
for {
select {
Expand Down Expand Up @@ -106,33 +106,6 @@ func periodicOracleUpdateHelper(topCoins *int, auth *bind.TransactOpts, contract
})
topCoinSlice := cleanedCoins[:*topCoins]

// Get EUR and CAD exchange rates
eurRate, err := getECBRatesFromDia("EUR")
if err != nil {
log.Fatalf("Failed to retrieve currency %s from DIA: %v", "EUR", err)
return err
}
cadRate, err := getECBRatesFromDia("CAD")
if err != nil {
log.Fatalf("Failed to retrieve currency %s from DIA: %v", "CAD", err)
return err
}

ecbRates := []models.Quotation{*eurRate, *cadRate}

err = updateECBRates(ecbRates, auth, contract)
if err != nil {
log.Fatalf("Failed to update Oracle: %v", err)
return err
}

// Search for NEU tokens
neumarkData, err := getCoinDetailsFromDia("NEU")
if err != nil {
log.Printf("Failed to retrieve NEU token from DIA: %v", err)
return nil //TODO: return err insteal of nil, log.fatal
}
topCoinSlice = append(topCoinSlice, *neumarkData)
err = updateTopCoins(topCoinSlice, auth, contract)
if err != nil {
log.Fatalf("Failed to update Oracle: %v", err)
Expand Down
2 changes: 1 addition & 1 deletion deployments/docker-compose.ethereum.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ version: '3.2'
services:
geth:
image:
ethereum/client-go:alpine
ethereum/client-go:stable
volumes:
- /home/srv/geth:/root/.ethereum
command: --rpcvhosts geth --rpc --rpcaddr "0.0.0.0" --cache 1024 --rpc --syncmode "fast"
Expand Down

0 comments on commit 0950a2a

Please sign in to comment.