Merge branch 'services' into v0.0.7

pull/56/head
Jakub Matys 2018-09-06 13:53:57 +02:00
commit e182554251
4 changed files with 26 additions and 12 deletions

8
Gopkg.lock generated
View File

@ -61,6 +61,12 @@
revision = "1d4478f51bed434f1dadf96dcd9b43aabac66795"
version = "v1.7"
[[projects]]
branch = "master"
name = "github.com/erikdubbelboer/gspt"
packages = ["."]
revision = "e39e726e09cc23d1ccf13b36ce10dbdb4a4510e0"
[[projects]]
name = "github.com/ethereum/go-ethereum"
packages = [".","common","common/hexutil","common/math","core/types","crypto","crypto/secp256k1","crypto/sha3","ethclient","ethdb","log","metrics","params","rlp","rpc","trie"]
@ -250,6 +256,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
inputs-digest = "03817720a4b1b5011cc64018a1344ed3fb4d8228af41c86856069f57851b3819"
inputs-digest = "98fb9a6252acd86d1c0a4b09a42e34673c2ccd6327caf49ed85bcee573601d95"
solver-name = "gps-cdcl"
solver-version = 1

View File

@ -1,10 +1,17 @@
package main
import (
"blockbook/bchain"
"blockbook/bchain/coins"
"blockbook/common"
"blockbook/db"
"blockbook/server"
"context"
"flag"
"log"
"math/rand"
"net/http"
_ "net/http/pprof"
"os"
"os/signal"
"strings"
@ -12,18 +19,9 @@ import (
"syscall"
"time"
"github.com/juju/errors"
"blockbook/bchain"
"blockbook/bchain/coins"
"blockbook/common"
"blockbook/db"
"blockbook/server"
"github.com/erikdubbelboer/gspt"
"github.com/golang/glog"
"net/http"
_ "net/http/pprof"
"github.com/juju/errors"
)
// debounce too close requests for resync
@ -156,6 +154,8 @@ func main() {
glog.Fatal("config: ", err)
}
gspt.SetProcTitle("blockbook-" + normalizeName(coin))
metrics, err := common.GetMetrics(coin)
if err != nil {
glog.Fatal("metrics: ", err)
@ -508,3 +508,9 @@ func printResult(txid string, vout uint32, isOutput bool) error {
glog.Info(txid, vout, isOutput)
return nil
}
func normalizeName(s string) string {
s = strings.ToLower(s)
s = strings.Replace(s, " ", "-", -1)
return s
}

View File

@ -7,6 +7,7 @@ After=network.target
ExecStart={{template "Backend.ExecCommandTemplate" .}}
User={{.Backend.SystemUser}}
Restart=on-failure
TimeoutStopSec=300
WorkingDirectory={{.Env.BackendInstallPath}}/{{.Coin.Alias}}
{{if eq .Backend.ServiceType "forking" -}}
Type=forking

View File

@ -9,6 +9,7 @@ ExecStart={{.Env.BlockbookInstallPath}}/{{.Coin.Alias}}/bin/blockbook -blockchai
User={{.Blockbook.SystemUser}}
Type=simple
Restart=on-failure
TimeoutStopSec=300
WorkingDirectory={{.Env.BlockbookInstallPath}}/{{.Coin.Alias}}
# Resource limits