Merge pull request #55 from simple-rules/ricl-github

update for github.com folder structure
pull/56/head
Richard Liu 6 years ago committed by GitHub
commit 3a47491e60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      .travis.yml
  2. 3
      attack/attack.go
  3. 5
      aws-experiment-launch/experiment/commander/main.go
  4. 7
      aws-experiment-launch/experiment/soldier/main.go
  5. 17
      benchmark.go
  6. 3
      blockchain/block.go
  7. 19
      client/btctxgen/main.go
  8. 9
      client/client.go
  9. 17
      client/txgen/main.go
  10. 3
      configr/main.go
  11. 15
      consensus/consensus.go
  12. 13
      consensus/consensus_leader.go
  13. 5
      consensus/consensus_leader_test.go
  14. 3
      consensus/consensus_test.go
  15. 15
      consensus/consensus_validator.go
  16. 5
      consensus/consensus_validator_test.go
  17. 11
      node/node.go
  18. 13
      node/node_handler.go
  19. 5
      node/node_test.go
  20. 3
      node/node_utils.go
  21. 3
      p2p/peer.go
  22. 7
      proto/client/client.go
  23. 3
      proto/consensus/consensus.go
  24. 5
      proto/node/node.go
  25. 3
      utils/utils.go

@ -3,10 +3,8 @@ go:
- master
install:
- export GOPATH=$HOME/gopath
- export TRAVIS_BUILD_DIR=$HOME/gopath/src/harmony-benchmark
- cd $HOME/gopath/src
- mv github.com/simple-rules/harmony-benchmark ./
- cd harmony-benchmark
- cd github.com/simple-rules/harmony-benchmark
- go get ./...
- ./.travis.gofmt.sh
- go build -v ./...

@ -1,11 +1,12 @@
package attack
import (
"harmony-benchmark/log"
"math/rand"
"os"
"sync"
"time"
"github.com/simple-rules/harmony-benchmark/log"
)
const (

@ -4,8 +4,6 @@ import (
"bufio"
"flag"
"fmt"
"harmony-benchmark/aws-experiment-launch/experiment/utils"
"harmony-benchmark/configr"
"io"
"log"
"net"
@ -13,6 +11,9 @@ import (
"os"
"strings"
"time"
"github.com/simple-rules/harmony-benchmark/aws-experiment-launch/experiment/utils"
"github.com/simple-rules/harmony-benchmark/configr"
)
type commanderSetting struct {

@ -5,9 +5,6 @@ import (
"bytes"
"flag"
"fmt"
"harmony-benchmark/aws-experiment-launch/experiment/soldier/s3"
"harmony-benchmark/aws-experiment-launch/experiment/utils"
"harmony-benchmark/configr"
"io"
"io/ioutil"
"log"
@ -19,6 +16,10 @@ import (
"path/filepath"
"runtime"
"strings"
"github.com/simple-rules/harmony-benchmark/aws-experiment-launch/experiment/soldier/s3"
"github.com/simple-rules/harmony-benchmark/aws-experiment-launch/experiment/utils"
"github.com/simple-rules/harmony-benchmark/configr"
)
type soliderSetting struct {

@ -3,19 +3,20 @@ package main
import (
"flag"
"fmt"
"harmony-benchmark/attack"
"harmony-benchmark/configr"
"harmony-benchmark/consensus"
"harmony-benchmark/log"
"harmony-benchmark/node"
"harmony-benchmark/p2p"
"math/rand"
"os"
"time"
"github.com/simple-rules/harmony-benchmark/attack"
"github.com/simple-rules/harmony-benchmark/configr"
"github.com/simple-rules/harmony-benchmark/consensus"
"github.com/simple-rules/harmony-benchmark/log"
"github.com/simple-rules/harmony-benchmark/node"
"github.com/simple-rules/harmony-benchmark/p2p"
"github.com/shirou/gopsutil/process"
"harmony-benchmark/crypto"
"harmony-benchmark/utils"
"github.com/simple-rules/harmony-benchmark/crypto"
"github.com/simple-rules/harmony-benchmark/utils"
)
const (

@ -5,9 +5,10 @@ import (
"crypto/sha256"
"encoding/gob"
"fmt"
"harmony-benchmark/utils"
"log"
"time"
"github.com/simple-rules/harmony-benchmark/utils"
)
// A block in the blockchain that contains block headers, transactions and signature etc.

@ -21,19 +21,20 @@ package main
import (
"flag"
"fmt"
"harmony-benchmark/blockchain"
"harmony-benchmark/client"
"harmony-benchmark/client/btctxiter"
"harmony-benchmark/configr"
"harmony-benchmark/consensus"
"harmony-benchmark/log"
"harmony-benchmark/node"
"harmony-benchmark/p2p"
proto_node "harmony-benchmark/proto/node"
"math"
"sync"
"time"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/client"
"github.com/simple-rules/harmony-benchmark/client/btctxiter"
"github.com/simple-rules/harmony-benchmark/configr"
"github.com/simple-rules/harmony-benchmark/consensus"
"github.com/simple-rules/harmony-benchmark/log"
"github.com/simple-rules/harmony-benchmark/node"
"github.com/simple-rules/harmony-benchmark/p2p"
proto_node "github.com/simple-rules/harmony-benchmark/proto/node"
"github.com/piotrnar/gocoin/lib/btc"
)

@ -3,11 +3,12 @@ package client
import (
"bytes"
"encoding/gob"
"harmony-benchmark/blockchain"
"harmony-benchmark/log"
"harmony-benchmark/p2p"
proto_client "harmony-benchmark/proto/client"
"sync"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/log"
"github.com/simple-rules/harmony-benchmark/p2p"
proto_client "github.com/simple-rules/harmony-benchmark/proto/client"
)
// A client represents a node (e.g. a wallet) which sends transactions and receives responses from the harmony network

@ -4,18 +4,19 @@ import (
"encoding/hex"
"flag"
"fmt"
"harmony-benchmark/blockchain"
"harmony-benchmark/client"
"harmony-benchmark/configr"
"harmony-benchmark/consensus"
"harmony-benchmark/log"
"harmony-benchmark/node"
"harmony-benchmark/p2p"
proto_node "harmony-benchmark/proto/node"
"math/rand"
"strconv"
"sync"
"time"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/client"
"github.com/simple-rules/harmony-benchmark/configr"
"github.com/simple-rules/harmony-benchmark/consensus"
"github.com/simple-rules/harmony-benchmark/log"
"github.com/simple-rules/harmony-benchmark/node"
"github.com/simple-rules/harmony-benchmark/p2p"
proto_node "github.com/simple-rules/harmony-benchmark/proto/node"
)
type txGenSettings struct {

@ -2,11 +2,12 @@ package configr
import (
"bufio"
"harmony-benchmark/p2p"
"log"
"os"
"strconv"
"strings"
"github.com/simple-rules/harmony-benchmark/p2p"
)
// Gets all the validator peers

@ -3,15 +3,16 @@ package consensus // consensus
import (
"fmt"
"github.com/dedis/kyber"
"github.com/dedis/kyber/sign/schnorr"
"harmony-benchmark/blockchain"
"harmony-benchmark/crypto"
"harmony-benchmark/log"
"harmony-benchmark/p2p"
"harmony-benchmark/utils"
"strconv"
"sync"
"github.com/dedis/kyber"
"github.com/dedis/kyber/sign/schnorr"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/crypto"
"github.com/simple-rules/harmony-benchmark/log"
"github.com/simple-rules/harmony-benchmark/p2p"
"github.com/simple-rules/harmony-benchmark/utils"
)
// Consensus data containing all info related to one round of consensus process

@ -4,14 +4,15 @@ import (
"bytes"
"encoding/binary"
"encoding/gob"
"time"
"github.com/dedis/kyber"
"github.com/dedis/kyber/sign/schnorr"
"harmony-benchmark/blockchain"
"harmony-benchmark/crypto"
"harmony-benchmark/log"
"harmony-benchmark/p2p"
proto_consensus "harmony-benchmark/proto/consensus"
"time"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/crypto"
"github.com/simple-rules/harmony-benchmark/log"
"github.com/simple-rules/harmony-benchmark/p2p"
proto_consensus "github.com/simple-rules/harmony-benchmark/proto/consensus"
)
var (

@ -1,9 +1,10 @@
package consensus
import (
"harmony-benchmark/crypto"
"harmony-benchmark/p2p"
"testing"
"github.com/simple-rules/harmony-benchmark/crypto"
"github.com/simple-rules/harmony-benchmark/p2p"
)
func TestConstructAnnounceMessage(test *testing.T) {

@ -1,8 +1,9 @@
package consensus
import (
"harmony-benchmark/p2p"
"testing"
"github.com/simple-rules/harmony-benchmark/p2p"
)
func TestNewConsensus(test *testing.T) {

@ -4,15 +4,16 @@ import (
"bytes"
"encoding/binary"
"encoding/gob"
"github.com/dedis/kyber"
"github.com/dedis/kyber/sign/schnorr"
"harmony-benchmark/attack"
"harmony-benchmark/blockchain"
"harmony-benchmark/crypto"
"harmony-benchmark/log"
"harmony-benchmark/p2p"
proto_consensus "harmony-benchmark/proto/consensus"
"harmony-benchmark/utils"
"github.com/simple-rules/harmony-benchmark/attack"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/crypto"
"github.com/simple-rules/harmony-benchmark/log"
"github.com/simple-rules/harmony-benchmark/p2p"
proto_consensus "github.com/simple-rules/harmony-benchmark/proto/consensus"
"github.com/simple-rules/harmony-benchmark/utils"
)
// Validator's consensus message dispatcher

@ -1,9 +1,10 @@
package consensus
import (
"harmony-benchmark/crypto"
"harmony-benchmark/p2p"
"testing"
"github.com/simple-rules/harmony-benchmark/crypto"
"github.com/simple-rules/harmony-benchmark/p2p"
)
func TestConstructCommitMessage(test *testing.T) {

@ -1,14 +1,15 @@
package node
import (
"harmony-benchmark/blockchain"
"harmony-benchmark/client"
"harmony-benchmark/consensus"
"harmony-benchmark/log"
"harmony-benchmark/p2p"
"net"
"os"
"sync"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/client"
"github.com/simple-rules/harmony-benchmark/consensus"
"github.com/simple-rules/harmony-benchmark/log"
"github.com/simple-rules/harmony-benchmark/p2p"
)
// Node represents a program (machine) participating in the network

@ -3,15 +3,16 @@ package node
import (
"bytes"
"encoding/gob"
"harmony-benchmark/blockchain"
"harmony-benchmark/p2p"
"harmony-benchmark/proto"
"harmony-benchmark/proto/client"
"harmony-benchmark/proto/consensus"
proto_node "harmony-benchmark/proto/node"
"net"
"os"
"time"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/p2p"
"github.com/simple-rules/harmony-benchmark/proto"
"github.com/simple-rules/harmony-benchmark/proto/client"
"github.com/simple-rules/harmony-benchmark/proto/consensus"
proto_node "github.com/simple-rules/harmony-benchmark/proto/node"
)
const (

@ -1,9 +1,10 @@
package node
import (
"harmony-benchmark/consensus"
"harmony-benchmark/p2p"
"testing"
"github.com/simple-rules/harmony-benchmark/consensus"
"github.com/simple-rules/harmony-benchmark/p2p"
)
func TestNewNewNode(test *testing.T) {

@ -1,8 +1,9 @@
package node
import (
"harmony-benchmark/blockchain"
"strconv"
"github.com/simple-rules/harmony-benchmark/blockchain"
)
// AddTestingAddresses creates in genesis block numAddress transactions which assign 1000 token to each address in [0 - numAddress)

@ -3,12 +3,13 @@ package p2p
import (
"bytes"
"encoding/binary"
"harmony-benchmark/attack"
"log"
"net"
"strings"
"sync"
"github.com/simple-rules/harmony-benchmark/attack"
"github.com/dedis/kyber"
)

@ -3,9 +3,10 @@ package client
import (
"bytes"
"encoding/gob"
"harmony-benchmark/blockchain"
"harmony-benchmark/proto"
"harmony-benchmark/proto/node"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/proto"
"github.com/simple-rules/harmony-benchmark/proto/node"
)
// The specific types of message under CLIENT category

@ -3,7 +3,8 @@ package consensus
import (
"bytes"
"errors"
"harmony-benchmark/proto"
"github.com/simple-rules/harmony-benchmark/proto"
)
/*

@ -3,8 +3,9 @@ package node
import (
"bytes"
"encoding/gob"
"harmony-benchmark/blockchain"
"harmony-benchmark/proto"
"github.com/simple-rules/harmony-benchmark/blockchain"
"github.com/simple-rules/harmony-benchmark/proto"
)
// The specific types of message under NODE category

@ -3,11 +3,12 @@ package utils
import (
"bytes"
"encoding/binary"
"harmony-benchmark/p2p"
"log"
"regexp"
"strconv"
"strings"
"github.com/simple-rules/harmony-benchmark/p2p"
)
// ConvertFixedDataIntoByteArray converts an empty interface data to a byte array

Loading…
Cancel
Save