Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/soroban-transactions' into sorob…
Browse files Browse the repository at this point in the history
…an-transactions
  • Loading branch information
lucasmagnus committed Oct 23, 2023
2 parents b3f855b + 21fcc3e commit a8dc7b9
Show file tree
Hide file tree
Showing 5 changed files with 36 additions and 27 deletions.
3 changes: 1 addition & 2 deletions backend/docs/docs.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions backend/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -3011,8 +3011,7 @@
"v1.SignedTransactionRequest": {
"type": "object",
"required": [
"envelope",
"wallet_pk"
"envelope"
],
"properties": {
"envelope": {
Expand Down
1 change: 0 additions & 1 deletion backend/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,6 @@ definitions:
type: string
required:
- envelope
- wallet_pk
type: object
v1.SubmitTransactionRequest:
properties:
Expand Down
12 changes: 11 additions & 1 deletion backend/internal/controller/http/v1/soroban.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ func newSorobanRoutes(handler *gin.RouterGroup, w usecase.WalletUseCase, m HTTPC

type SignedTransactionRequest struct {
Envelope string `json:"envelope" binding:"required" example:"KJDSKD..."`
WalletPk string `json:"wallet_pk" binding:"required" example:"GDSKJG..."`
WalletPk string `json:"wallet_pk" example:"GDSKJG..."`
}

type SubmitTransactionRequest struct {
Expand All @@ -52,6 +52,16 @@ func (r *sorobanRoutes) signTransaction(c *gin.Context) {
return
}

if request.WalletPk == "" {
sponsor, err := r.w.Get(_sponsorId)
if err != nil {
errorResponse(c, http.StatusInternalServerError, "database problems", err)
return
}

request.WalletPk = sponsor.Key.PublicKey
}

res, err := r.m.SendMessage(entity.SignChannel, entity.SignTransactionRequest{
PublicKey: request.WalletPk,
Envelope: request.Envelope,
Expand Down
44 changes: 23 additions & 21 deletions dev.docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ services:
KAFKA_CREATE_KP_PRODUCER_TOPIC: ${KMS_KAFKA_PRODUCER_TOPIC:-generatedKeypairs}
KAFKA_SIGN_CONSUMER_TOPICS: ${KAFKA_SIGN_CONSUMER_TOPICS:-signEnvelope}
KAFKA_SIGN_PRODUCER_TOPIC: ${KAFKA_SIGN_PRODUCER_TOPIC:-signedEnvelopes}
KAFKA_SIGN_SOROBAN_CONSUMER_TOPICS: ${KAFKA_SIGN_SOROBAN_CONSUMER_TOPICS:-signSorobanEnvelope}
KAFKA_SIGN_SOROBAN_PRODUCER_TOPIC: ${KAFKA_SIGN_SOROBAN_PRODUCER_TOPIC:-signedSorobanEnvelopes}
PG_HOST: ${PG_HOST:-postgres}
PG_PORT: ${PG_PORT:-5432}
PG_USER: ${PG_USER:-postgres}
Expand Down Expand Up @@ -133,27 +135,27 @@ services:
retries: 20

#Kafka - Schema Registry#
schema_registry:
profiles: ["all", "kafka", "starlabs", "kms"]
image: confluentinc/cp-schema-registry:7.1.2
container_name: schema_registry
ports:
- "8085:8085"
environment:
SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8085
SCHEMA_REGISTRY_HOST_NAME: schema_registry
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zoo1:2181
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_ORIGIN: "*"
SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_METHODS: "GET,POST,PUT,OPTIONS"
SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka1:19092
healthcheck:
start_period: 10s
interval: 10s
retries: 20
test: curl --user superUser:superUser --fail --silent --insecure http://schema_registry:8085/subjects --output /dev/null || exit 1
depends_on:
kafka1:
condition: service_healthy
# schema_registry:
# profiles: ["all", "kafka", "starlabs", "kms"]
# image: confluentinc/cp-schema-registry:7.1.2
# container_name: schema_registry
# ports:
# - "8085:8085"
# environment:
# SCHEMA_REGISTRY_LISTENERS: http://0.0.0.0:8085
# SCHEMA_REGISTRY_HOST_NAME: schema_registry
# SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zoo1:2181
# SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_ORIGIN: "*"
# SCHEMA_REGISTRY_ACCESS_CONTROL_ALLOW_METHODS: "GET,POST,PUT,OPTIONS"
# SCHEMA_REGISTRY_KAFKASTORE_BOOTSTRAP_SERVERS: kafka1:19092
# healthcheck:
# start_period: 10s
# interval: 10s
# retries: 20
# test: curl --user superUser:superUser --fail --silent --insecure http://schema_registry:8085/subjects --output /dev/null || exit 1
# depends_on:
# kafka1:
# condition: service_healthy

#Kafka - Init#
kafka_init:
Expand Down

0 comments on commit a8dc7b9

Please sign in to comment.