Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replica to have the ability for posting writes back to kafka MVP #2

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Correcting posting back to kafka
  • Loading branch information
samuelmjohnston committed Oct 15, 2018
commit df25387b80152c4ab36d1cf26c041a41d2673f31
7 changes: 7 additions & 0 deletions REPLICA_TESTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,10 @@ Create and unlock a default account, as described in manually posting to your ma
This was encountered in geth command line shell

Your unlocked default account needs funds to send transactions. I don't know why, but some reason this happened to me. mine on it for a sec by restarting master, and changing the mining address, as described above


# Running for real:

geth replica --kafka.tx.topic=txtest --kafka.broker=10.142.0.3:32768

geth --kafka.broker=10.142.0.3:32768 --kafka.tx.topic=txtest --rpc --syncmode full --gcmode archive
6 changes: 4 additions & 2 deletions replica/kafak.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ import (
// "log"
"fmt"
"github.com/ethereum/go-ethereum/core/types"
"encoding/json"
"github.com/ethereum/go-ethereum/rlp"
// "encoding/hex"
)

type KafkaTransactionProducer struct {
Expand All @@ -19,7 +20,8 @@ func (producer *KafkaTransactionProducer) Close() {
}

func (producer *KafkaTransactionProducer) Emit(tx *types.Transaction) error {
txBytes, err := json.Marshal(tx)
txBytes, err := rlp.EncodeToBytes(tx)
fmt.Printf("%#x\n", txBytes)
if err != nil {
return err
}
Expand Down