Skip to content

Commit

Permalink
Upload the latest code
Browse files Browse the repository at this point in the history
  • Loading branch information
powerpook committed Dec 10, 2021
1 parent 16ab733 commit 606c3e5
Show file tree
Hide file tree
Showing 39 changed files with 3,365 additions and 5,708 deletions.
24 changes: 13 additions & 11 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
language: go

env: GO111MODULE=on

go:
- 1.12.x
- master

go_import_path: github.com/IBAX/go-ibax

install: true
language: go

env: GO111MODULE=on

go:
- 1.12.x
- master

go_import_path: github.com/IBAX/go-ibax

install: true

script: go build github.com/IBAX/go-ibax
52 changes: 0 additions & 52 deletions data/ibax/ibax-startup.sh

This file was deleted.

52 changes: 0 additions & 52 deletions docker-compose.yml

This file was deleted.

41 changes: 16 additions & 25 deletions main.go
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) IBAX. All rights reserved.
* See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
package main

import (
"fmt"
"runtime"

"github.com/IBAX-io/go-ibax/packages/consts"
"github.com/IBAX-io/go-ibax/cmd"
)

var (
buildBranch = ""
buildDate = ""
commitHash = ""
)

func main() {
runtime.LockOSThread()
consts.BuildInfo = fmt.Sprintf("%s-%s %s", buildBranch, commitHash, buildDate)
cmd.Execute()
}
/*---------------------------------------------------------------------------------------------
* Copyright (c) IBAX. All rights reserved.
* See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/
package main

import (
"runtime"

"github.com/IBAX-io/go-ibax/cmd"
)

func main() {
runtime.LockOSThread()
cmd.Execute()
}
Original file line number Diff line number Diff line change
@@ -1,18 +1,17 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) IBAX. All rights reserved.
* See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/

package daemonsctl

import (
"context"

"github.com/IBAX-io/go-ibax/packages/modes"
)

// RunAllDaemons start daemons, load contracts and tcpserver
func RunAllDaemons(ctx context.Context) error {
loader := modes.GetDaemonLoader()

return loader.Load(ctx)
/*---------------------------------------------------------------------------------------------
* Copyright (c) IBAX. All rights reserved.
* See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/

package daemonsctl

import (
"context"

"github.com/IBAX-io/go-ibax/packages/modes"
)

// RunAllDaemons start daemons, load contracts and tcpserver
func RunAllDaemons(ctx context.Context) error {
return modes.GetDaemonLoader().Load(ctx)
}
58 changes: 36 additions & 22 deletions packages/daylight/notandroid.go → packages/chain/notandroid.go
Original file line number Diff line number Diff line change
@@ -1,22 +1,36 @@

log "github.com/sirupsen/logrus"
)

func httpListener(ListenHTTPHost string, route http.Handler) {
l, err := net.Listen("tcp", ListenHTTPHost)
log.WithFields(log.Fields{"host": ListenHTTPHost, "type": consts.NetworkError}).Debug("trying to listen at")
if err == nil {
log.WithFields(log.Fields{"host": ListenHTTPHost}).Info("listening at")
} else {
log.WithFields(log.Fields{"host": ListenHTTPHost, "error": err, "type": consts.NetworkError}).Debug("cannot listen at host")
}

go func() {
srv := &http.Server{Handler: route}
err = srv.Serve(l)
if err != nil {
log.WithFields(log.Fields{"host": ListenHTTPHost, "error": err, "type": consts.NetworkError}).Error("serving http at host")
panic(err)
}
}()
}
//go:build !android && !ios

/*---------------------------------------------------------------------------------------------
* Copyright (c) IBAX. All rights reserved.
* See LICENSE in the project root for license information.
*--------------------------------------------------------------------------------------------*/

package chain

import (
"net"
"net/http"

"github.com/IBAX-io/go-ibax/packages/consts"

log "github.com/sirupsen/logrus"
)

func httpListener(ListenHTTPHost string, route http.Handler) {
l, err := net.Listen("tcp", ListenHTTPHost)
log.WithFields(log.Fields{"host": ListenHTTPHost, "type": consts.NetworkError}).Debug("trying to listen at")
if err == nil {
log.WithFields(log.Fields{"host": ListenHTTPHost}).Info("listening at")
} else {
log.WithFields(log.Fields{"host": ListenHTTPHost, "error": err, "type": consts.NetworkError}).Debug("cannot listen at host")
}

go func() {
srv := &http.Server{Handler: route}
err = srv.Serve(l)
if err != nil {
log.WithFields(log.Fields{"host": ListenHTTPHost, "error": err, "type": consts.NetworkError}).Error("serving http at host")
panic(err)
}
}()
}
Loading

0 comments on commit 606c3e5

Please sign in to comment.