Permalink
Browse files

Rename: keytransparency-signer to keytransparency-sequencer (#764)

*  gomvpkg -from github.com/google/keytransparency/core/signer -to github.com/google/keytransprency/core/sequencer

* rename

* GoRename Signer -> Sequencer

* keytransparency-signer -> keytransparency-sequencer

* Removed binary the slipped in
  • Loading branch information...
gdbelvin committed Aug 18, 2017
1 parent 08ef412 commit 8eb3a9af4a8f06bfd4c316a2ed1b8c77a73cb336
View
@@ -3,7 +3,7 @@
*~
/keytransparency-server
/keytransparency-signer
/keytransparency-sequencer
/keytransparency-client
infra*.etcd
View
@@ -22,10 +22,10 @@
# TODO: Makefile will be deleted once the repo is public. Check issue #411.
main:
go build ./cmd/keytransparency-server ./cmd/keytransparency-signer ./cmd/keytransparency-client
go build ./cmd/keytransparency-server ./cmd/keytransparency-sequencer ./cmd/keytransparency-client
mysql:
go build -tags mysql ./cmd/keytransparency-server ./cmd/keytransparency-signer ./cmd/keytransparency-client
go build -tags mysql ./cmd/keytransparency-server ./cmd/keytransparency-sequencer ./cmd/keytransparency-client
client:
go build ./cmd/keytransparency-client
@@ -47,5 +47,5 @@ proto:
go generate ./...
clean:
rm -f srv keytransparency-server keytransparency-signer keytransparency-client
rm -f srv keytransparency-server keytransparency-sequencer keytransparency-client
rm -rf infra*
@@ -4,8 +4,8 @@ ADD ./keytransparency /go/src/github.com/google/keytransparency
ADD ./trillian /go/src/github.com/google/trillian
WORKDIR /go/src/github.com/google/keytransparency
RUN go get -tags="mysql" ./cmd/keytransparency-signer
RUN go get -tags="mysql" ./cmd/keytransparency-sequencer
# Specify mandatory flags via the docker command-line or using docker-compose.
# See the README.md file on how to use docker-compose.
ENTRYPOINT ["/go/bin/keytransparency-signer"]
ENTRYPOINT ["/go/bin/keytransparency-sequencer"]
@@ -21,7 +21,7 @@ import (
"time"
"github.com/google/keytransparency/core/mutator/entry"
"github.com/google/keytransparency/core/signer"
"github.com/google/keytransparency/core/sequencer"
"github.com/google/keytransparency/impl/sql/engine"
"github.com/google/keytransparency/impl/sql/mutations"
@@ -100,7 +100,7 @@ func main() {
}
}()
signer := signer.New(*mapID, tmap, *logID, tlog, mutator, mutations, factory)
signer := sequencer.New(*mapID, tmap, *logID, tlog, mutator, mutations, factory)
glog.Infof("Signer starting")
signer.StartSigning(context.Background(), *minEpochDuration, *maxEpochDuration)
glog.Errorf("Signer exiting")
@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// limitations under the License.
package signer
package sequencer
import (
"crypto/sha256"
@@ -62,8 +62,8 @@ func init() {
prometheus.MustRegister(createEpochHist)
}
// Signer processes mutations and sends them to the trillian map.
type Signer struct {
// Sequencer processes mutations and sends them to the trillian map.
type Sequencer struct {
mapID int64
tmap trillian.TrillianMapClient
logID int64
@@ -80,8 +80,8 @@ func New(mapID int64,
tlog trillian.TrillianLogClient,
mutator mutator.Mutator,
mutations mutator.Mutation,
factory transaction.Factory) *Signer {
return &Signer{
factory transaction.Factory) *Sequencer {
return &Sequencer{
mapID: mapID,
tmap: tmap,
logID: logID,
@@ -95,7 +95,7 @@ func New(mapID int64,
// Initialize inserts the object hash of an empty struct into the log if it is empty.
// This keeps the log leaves in-sync with the map which starts off with an
// empty log root at map revision 0.
func (s *Signer) Initialize(ctx context.Context) error {
func (s *Sequencer) Initialize(ctx context.Context) error {
logRoot, err := s.tlog.GetLatestSignedLogRoot(ctx, &trillian.GetLatestSignedLogRootRequest{
LogId: s.logID,
})
@@ -123,7 +123,7 @@ func (s *Signer) Initialize(ctx context.Context) error {
// StartSigning advance epochs once per minInterval, if there were mutations,
// and at least once per maxElapsed minIntervals.
func (s *Signer) StartSigning(ctx context.Context, minInterval, maxInterval time.Duration) {
func (s *Sequencer) StartSigning(ctx context.Context, minInterval, maxInterval time.Duration) {
if err := s.Initialize(ctx); err != nil {
glog.Errorf("Initialize() failed: %v", err)
}
@@ -190,7 +190,7 @@ func genEpochTicks(t util.TimeSource, last time.Time, minTick <-chan time.Time,
// newMutations returns a list of mutations to process and highest sequence
// number returned.
func (s *Signer) newMutations(ctx context.Context, startSequence int64) ([]*tpb.SignedKV, int64, error) {
func (s *Sequencer) newMutations(ctx context.Context, startSequence int64) ([]*tpb.SignedKV, int64, error) {
txn, err := s.factory.NewTxn(ctx)
if err != nil {
return nil, 0, fmt.Errorf("NewDBTxn(): %v", err)
@@ -222,7 +222,7 @@ func toArray(b []byte) [32]byte {
// Multiple mutations for the same leaf will be applied to provided leaf.
// The last valid mutation for each leaf is included in the output.
// Returns a list of map leaves that should be updated.
func (s *Signer) applyMutations(mutations []*tpb.SignedKV, leaves []*trillian.MapLeaf) ([]*trillian.MapLeaf, error) {
func (s *Sequencer) applyMutations(mutations []*tpb.SignedKV, leaves []*trillian.MapLeaf) ([]*trillian.MapLeaf, error) {
// Put leaves in a map from index to leaf value.
leafMap := make(map[[32]byte]*trillian.MapLeaf)
for _, l := range leaves {
@@ -262,7 +262,7 @@ func (s *Signer) applyMutations(mutations []*tpb.SignedKV, leaves []*trillian.Ma
}
// CreateEpoch signs the current map head.
func (s *Signer) CreateEpoch(ctx context.Context, forceNewEpoch bool) error {
func (s *Sequencer) CreateEpoch(ctx context.Context, forceNewEpoch bool) error {
glog.V(2).Infof("CreateEpoch: starting sequencing run")
start := time.Now()
// Get the current root.
@@ -14,7 +14,7 @@
// Package mutation implements the monitor service. This package contains the
// core functionality.
package signer
package sequencer
import (
"testing"
@@ -90,7 +90,7 @@ spec:
spec:
containers:
- name: kt-signer
image: us.gcr.io/key-transparency/keytransparency-signer
image: us.gcr.io/key-transparency/keytransparency-sequencer
imagePullPolicy: Always
ports:
- containerPort: 8080
View
@@ -135,8 +135,8 @@ services:
- trillian-map
build:
context: ..
dockerfile: ./keytransparency/cmd/keytransparency-signer/Dockerfile
image: us.gcr.io/key-transparency/keytransparency-signer
dockerfile: ./keytransparency/cmd/keytransparency-sequencer/Dockerfile
image: us.gcr.io/key-transparency/keytransparency-sequencer
restart: always
entrypoint:
- /go/bin/keytransparency-signer
View
@@ -28,7 +28,7 @@ import (
"github.com/google/keytransparency/core/fake"
"github.com/google/keytransparency/core/keyserver"
"github.com/google/keytransparency/core/mutator/entry"
"github.com/google/keytransparency/core/signer"
"github.com/google/keytransparency/core/sequencer"
"github.com/google/keytransparency/core/testutil/ctutil"
"github.com/google/keytransparency/impl/authorization"
"github.com/google/keytransparency/impl/sql/commitments"
@@ -83,7 +83,7 @@ type Env struct {
V2Server *keyserver.Server
Conn *grpc.ClientConn
Client *grpcc.Client
Signer *signer.Signer
Signer *sequencer.Sequencer
db *sql.DB
Factory *transaction.Factory
VrfPriv vrf.PrivateKey
@@ -167,7 +167,7 @@ func NewEnv(t *testing.T) *Env {
pb.RegisterKeyTransparencyServiceServer(s, server)
// Signer
signer := signer.New(mapID, mapEnv.MapClient, logID, tlog, mutator, mutations, factory)
signer := sequencer.New(mapID, mapEnv.MapClient, logID, tlog, mutator, mutations, factory)
addr, lis := Listen(t)
go s.Serve(lis)
View
@@ -44,7 +44,7 @@ function main()
# Need to (re)build kt-signer after writing the public-keys
docker-compose build kt-signer
gcloud docker -- push us.gcr.io/key-transparency/keytransparency-signer
gcloud docker -- push us.gcr.io/key-transparency/keytransparency-sequencer
# Deploy all keytransparency related services (server and signer):
kubectl apply -f deploy/kubernetes/keytransparency-deployment.yml

0 comments on commit 8eb3a9a

Please sign in to comment.