Merge pull request #116 from ava-labs/c-chain-next

Some minor improvements for C-Chain.
This commit is contained in:
Stephen Buttolph 2020-06-23 20:15:04 -04:00 committed by GitHub
commit 49a5571758
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 21 additions and 8 deletions

3
go.mod
View File

@ -6,7 +6,7 @@ require (
github.com/AppsFlyer/go-sundheit v0.2.0
github.com/allegro/bigcache v1.2.1 // indirect
github.com/aristanetworks/goarista v0.0.0-20200520141224-0f14e646773f // indirect
github.com/ava-labs/coreth v0.2.4 // Added manually; don't delete
github.com/ava-labs/coreth v0.2.5 // Added manually; don't delete
github.com/ava-labs/go-ethereum v1.9.3 // indirect
github.com/deckarep/golang-set v1.7.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1 v1.0.3
@ -20,6 +20,7 @@ require (
github.com/gorilla/mux v1.7.4
github.com/gorilla/rpc v1.2.0
github.com/gorilla/websocket v1.4.2
github.com/hashicorp/go-hclog v0.0.0-20180709165350-ff2cf002a8dd
github.com/hashicorp/go-plugin v1.3.0
github.com/hashicorp/golang-lru v0.5.4 // indirect
github.com/huin/goupnp v1.0.0

2
go.sum
View File

@ -22,6 +22,8 @@ github.com/aristanetworks/goarista v0.0.0-20200520141224-0f14e646773f/go.mod h1:
github.com/aristanetworks/splunk-hec-go v0.3.3/go.mod h1:1VHO9r17b0K7WmOlLb9nTk/2YanvOEnLMUgsFrxBROc=
github.com/ava-labs/coreth v0.2.4 h1:MhnbuRyMcij7WU4+frayp40quc44AMPc4IrxXhmucWw=
github.com/ava-labs/coreth v0.2.4/go.mod h1:pGolKipwq5vGIY2IBBcBkMYrqniXMsS5SBn+BBi4+Js=
github.com/ava-labs/coreth v0.2.5 h1:2Al753rpPHvvZfcz7w96YbKhGFvrcZzsIZ/sIp0A0Ao=
github.com/ava-labs/coreth v0.2.5/go.mod h1:pGolKipwq5vGIY2IBBcBkMYrqniXMsS5SBn+BBi4+Js=
github.com/ava-labs/go-ethereum v1.9.3 h1:GmnMZ/dlvVAPFmWBzEpRJX49pUAymPfoASLNRJqR0AY=
github.com/ava-labs/go-ethereum v1.9.3/go.mod h1:a+agc6fXfZFsPZCylA3ry4Y8CLCqLKg3Rc23NXZ9aw8=
github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=

View File

@ -15,7 +15,7 @@ GECKO_PATH=$( cd "$( dirname "${BASH_SOURCE[0]}" )"; cd .. && pwd ) # Directory
BUILD_DIR=$GECKO_PATH/build # Where binaries go
PLUGIN_DIR="$BUILD_DIR/plugins" # Where plugin binaries (namely coreth) go
CORETH_VER="0.2.4" # Should match coreth version in go.mod
CORETH_VER="0.2.5" # Should match coreth version in go.mod
CORETH_PATH="$GOPATH/pkg/mod/github.com/ava-labs/coreth@v$CORETH_VER"
# Build Gecko

View File

@ -5,11 +5,12 @@ package rpcchainvm
import (
"errors"
"os/exec"
"github.com/hashicorp/go-plugin"
"github.com/ava-labs/gecko/snow"
"github.com/hashicorp/go-hclog"
"github.com/hashicorp/go-plugin"
"io/ioutil"
"log"
"os/exec"
)
var (
@ -31,9 +32,18 @@ func (f *Factory) New(ctx *snow.Context) (interface{}, error) {
},
}
if ctx != nil {
log.SetOutput(ctx.Log)
config.Stderr = ctx.Log
config.SyncStdout = ctx.Log
config.SyncStderr = ctx.Log
config.Logger = hclog.New(&hclog.LoggerOptions{
Output: ctx.Log,
Level: hclog.Info,
})
} else {
log.SetOutput(ioutil.Discard)
config.Stderr = ioutil.Discard
config.Logger = hclog.New(&hclog.LoggerOptions{
Output: ioutil.Discard,
})
}
client := plugin.NewClient(config)