forked from IBAX-io/go-ibax
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
39 changed files
with
3,365 additions
and
5,708 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() | ||
} |
35 changes: 17 additions & 18 deletions
35
packages/daylight/daemonsctl/daemonsctl.go → packages/chain/daemonsctl/daemonsctl.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
58
packages/daylight/notandroid.go → packages/chain/notandroid.go
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
}() | ||
} |
Oops, something went wrong.