Addressed comments

This commit is contained in:
Mark Beamer Jr 2019-08-12 23:20:09 -04:00 committed by Niko Storni
parent e477759395
commit b90e367e82
8 changed files with 13 additions and 88 deletions

View file

@ -1,29 +0,0 @@
job:
image: golang:1.12.7-stretch
variables:
GO111MODULE: "on"
script:
#Fetch master to be used in deploy condition to prevent deploying on old commits.
- whoami && pwd
- USER=$(whoami)
- ./e2e/e2e.sh
cache:
key: "$CI_COMMIT_REF_SLUG"
paths:
- $HOME/.cache/go-build
- $HOME/gopath/pkg/mod
before_script:
- whoami && pwd
- USER=$(whoami)
- apt update -q && apt install -qqy --no-install-recommends locales-all sudo youtube-dl ffmpeg tree curl
- apt install -qqy --no-install-recommends python-pip python-dev libffi-dev libssl-dev gcc libc-dev make
- curl -fsSL https://get.docker.com -o get-docker.sh
- sudo sh get-docker.sh
- sudo usermod -aG docker $USER
- sudo curl -L "https://github.com/docker/compose/releases/download/1.24.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
- sudo chmod +x /usr/local/bin/docker-compose
- sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose

View file

@ -2,7 +2,7 @@ os: linux
dist: bionic
language: go
go:
- 1.12.1
- 1.12.7
- master
install: true
@ -25,6 +25,7 @@ addons:
before_script:
- sudo pip install -U youtube-dl
- sudo add-apt-repository ppa:jonathonf/ffmpeg-4
env:
global:

View file

@ -9,4 +9,4 @@ save_files: false
share_usage_data: false
tcp_port: 3333
udp_port: 4444
use_upnp: true
use_upnp: false

View file

@ -1,15 +1,10 @@
version: "3.5"
networks:
e2e:
external: false
services:
#############
## Lbrycrd ##
#############
lbrycrd:
image: lbry/lbrycrd:v0.12.4.1
networks:
- e2e
restart: always
ports:
- "15201:29246"
@ -27,11 +22,7 @@ services:
###################
walletserver:
image: lbry/wallet-server:v0.38.5
networks:
- e2e
restart: always
#volumes:
# - "./persist/.walletserver:/database"
environment:
- DB_DIRECTORY=/database
- MAX_SEND=1000000000000000000000
@ -50,15 +41,13 @@ services:
nofile:
soft: 90000
hard: 90000
# command: lbry.wallet.server.coin.LBC
#command: lbry.wallet.server.coin.LBC
command: lbry.wallet.server.coin.LBCRegTest
#############
## Lbrynet ##
#############
lbrynet:
image: lbry/lbrynet:v0.38.5
networks:
- e2e
restart: always
ports:
- "15100:5279"
@ -75,19 +64,11 @@ services:
- ".:/etc/lbry" #Put your daemon_settings.yml here
# /private/var/tmp for OSX and /var/tmp for Linux
- "${LOCAL_TMP_DIR}"
# - type: bind
# source: "${LOCAL_TMP_DIR}"
# target: "/tmp"
# bind:
# propagation: rshared
#entrypoint: wait-for-it walletserver:50001 -- start
###########
## MySQL ##
###########
mysql:
image: mysql/mysql-server:5.7.27
networks:
- e2e
restart: "no"
ports:
- "15500:3306"
@ -104,8 +85,6 @@ services:
###################
internalapis:
image: lbry/internal-apis:master
networks:
- e2e
restart: "no"
ports:
- "15400:8080"

View file

@ -2,18 +2,18 @@ package main
import (
"fmt"
"github.com/lbryio/lbry.go/extras/errors"
"math/rand"
"os"
"time"
"github.com/lbryio/lbry.go/extras/errors"
"github.com/lbryio/lbry.go/extras/util"
"github.com/lbryio/ytsync/manager"
"github.com/lbryio/ytsync/sdk"
ytUtils "github.com/lbryio/ytsync/util"
log "github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/lbryio/ytsync/manager"
ytUtils "github.com/lbryio/ytsync/util"
)
var Version string

View file

@ -101,7 +101,7 @@ const (
func (s *SyncManager) Start() error {
if logUtils.IsCleanOnStartup() {
if logUtils.ShouldCleanOnStartup() {
err := logUtils.CleanForStartup()
if err != nil {
return err

View file

@ -6,7 +6,6 @@ import (
"net/http"
"os"
"os/signal"
"path/filepath"
"runtime/debug"
"sort"
"strings"
@ -126,7 +125,6 @@ func (s *Sync) downloadWallet() error {
if err != nil {
return errors.Prefix("error starting session: ", err)
}
test()
downloader := s3manager.NewDownloader(s3Session)
out, err := os.Create(defaultTempWalletDir)
if err != nil {
@ -572,12 +570,11 @@ func (s *Sync) doSync() error {
if err != nil {
return errors.Prefix("error updating remote database", err)
}
if pubsOnWallet == 0 {
if pubsOnWallet == 0 { //Todo - This needs to be done if the cert is nil in internal-apis
cert, err := s.daemon.ChannelExport(s.lbryChannelID, nil, nil)
if err != nil {
return errors.Prefix("error getting channel cert", err)
}
println("lbryChannelID:", s.lbryChannelID)
err = s.APIConfig.SetChannelCert(string(*cert), s.lbryChannelID)
if err != nil {
return errors.Prefix("error setting channel cert", err)
@ -990,23 +987,3 @@ func waitForDaemonProcess(timeout time.Duration) error {
}
return errors.Err("timeout reached")
}
func test() {
var files []string
root, err := os.Getwd()
if err != nil {
log.Error("cant get pwd!")
return
}
root = root + "/persist/.lbrynet"
err = filepath.Walk(root, func(path string, info os.FileInfo, err error) error {
files = append(files, path)
return nil
})
if err != nil {
panic(err)
}
for _, file := range files {
fmt.Println(file)
}
}

View file

@ -2,7 +2,6 @@ package util
import (
"context"
"fmt"
"os"
"os/exec"
"os/user"
@ -68,9 +67,6 @@ func getDockerContainer(name string, all bool) (*types.Container, error) {
if err != nil {
panic(err)
}
for _, container := range containers {
fmt.Printf("%s %s\n", container.ID[:10], container.Image)
}
if len(containers) == 0 {
return nil, nil
}
@ -115,7 +111,7 @@ func GetLbrycrdClient(lbrycrdString string) (*lbrycrd.Client, error) {
return lbrycrdd, nil
}
func IsCleanOnStartup() bool {
func ShouldCleanOnStartup() bool {
shouldClean, err := strconv.ParseBool(os.Getenv("CLEAN_ON_STARTUP"))
if err != nil {
return false
@ -177,7 +173,8 @@ func CleanForStartup() error {
if err != nil {
return errors.Err(err)
}
if height < 110 {
const minBlocksForUTXO = 110
if height < minBlocksForUTXO {
//Start reg test will some credits
txs, err := lbrycrd.Generate(uint32(110) - uint32(height))
if err != nil {