mirror of
https://github.com/fluencelabs/tendermint
synced 2025-05-29 06:01:21 +00:00
Docker run.sh passes seeds and moniker; wire json pretty print
This commit is contained in:
parent
d51741df72
commit
df733fbaa5
@ -1,9 +1,10 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
|
|
||||||
mkdir -p $GOPATH/src/$TMREPO
|
mkdir -p $GOPATH/src/$TMREPO
|
||||||
|
cd $GOPATH/src/$TMREPO
|
||||||
git clone https://$TMREPO.git .
|
git clone https://$TMREPO.git .
|
||||||
git fetch
|
git fetch
|
||||||
git reset --hard $TMHEAD
|
git reset --hard $TMHEAD
|
||||||
go get -d $TMREPO/cmd/tendermint
|
go get -d $TMREPO/cmd/tendermint
|
||||||
make
|
make
|
||||||
tendermint node
|
tendermint node --seeds="$TMSEEDS" --moniker="$TMNAME"
|
||||||
|
17
wire/util.go
17
wire/util.go
@ -3,6 +3,8 @@ package wire
|
|||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
"encoding/json"
|
||||||
|
|
||||||
"github.com/tendermint/tendermint/Godeps/_workspace/src/code.google.com/p/go.crypto/ripemd160"
|
"github.com/tendermint/tendermint/Godeps/_workspace/src/code.google.com/p/go.crypto/ripemd160"
|
||||||
|
|
||||||
. "github.com/tendermint/tendermint/common"
|
. "github.com/tendermint/tendermint/common"
|
||||||
@ -26,6 +28,21 @@ func JSONBytes(o interface{}) []byte {
|
|||||||
return w.Bytes()
|
return w.Bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// NOTE: inefficient
|
||||||
|
func JSONBytesPretty(o interface{}) []byte {
|
||||||
|
jsonBytes := JSONBytes(o)
|
||||||
|
var object interface{}
|
||||||
|
err := json.Unmarshal(jsonBytes, &object)
|
||||||
|
if err != nil {
|
||||||
|
PanicSanity(err)
|
||||||
|
}
|
||||||
|
jsonBytes, err = json.MarshalIndent(object, "", "\t")
|
||||||
|
if err != nil {
|
||||||
|
PanicSanity(err)
|
||||||
|
}
|
||||||
|
return jsonBytes
|
||||||
|
}
|
||||||
|
|
||||||
// NOTE: does not care about the type, only the binary representation.
|
// NOTE: does not care about the type, only the binary representation.
|
||||||
func BinaryEqual(a, b interface{}) bool {
|
func BinaryEqual(a, b interface{}) bool {
|
||||||
aBytes := BinaryBytes(a)
|
aBytes := BinaryBytes(a)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user