Skip to content

Commit

Permalink
Merge branch 'master' into 3405-extend-LoggingMiddleware
Browse files Browse the repository at this point in the history
  • Loading branch information
Zagan202 authored Mar 10, 2021
2 parents 4243b1e + 37db31b commit 5f72b89
Show file tree
Hide file tree
Showing 11 changed files with 38 additions and 42 deletions.
4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ webauth:
recoverysigner:
$(MAKE) -C exp/services/recoverysigner/ docker-build

regulated-assets-approval-server-demo:
$(MAKE) -C services/regulated-assets-approval-server-demo/ docker-build
regulated-assets-approval-server:
$(MAKE) -C services/regulated-assets-approval-server/ docker-build
14 changes: 0 additions & 14 deletions services/regulated-assets-approval-server-demo/docker/Dockerfile

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
SUDO := $(shell docker version >/dev/null 2>&1 || echo "sudo")

# If TAG is not provided set default value
TAG ?= stellar/regulated-assets-approval-server-demo:$(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n))
TAG ?= stellar/regulated-assets-approval-server:$(shell git rev-parse --short HEAD)$(and $(shell git status -s),-dirty-$(shell id -u -n))
# https://github.com/opencontainers/image-spec/blob/master/annotations.md
BUILD_DATE := $(shell date --utc --rfc-3339=seconds)

docker-build:
cd ../../ && \
$(SUDO) docker build --pull --label org.opencontainers.image.created="$(BUILD_DATE)" \
-f services/regulated-assets-approval-server-demo/docker/Dockerfile -t $(TAG) .
-f services/regulated-assets-approval-server/docker/Dockerfile -t $(TAG) .

docker-push:
cd ../../ && \
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# regulated-assets-approval-server-demo
# regulated-assets-approval-server

```
Varsion: v0.0.1
Expand All @@ -13,41 +13,37 @@ intended for **testing only**. It is being concieved to:
2. Serve as a demo server where wallets can test and validate their SEP-8
implementation.

Please be aware this is a demo and its code is not mean to be used in a
production application.

## Usage

```
```sh
$ go install
$ regulated-assets-approval-server-demo --help
SEP-8 Approval Server Demo
$ regulated-assets-approval-server --help
SEP-8 Approval Server

Usage:
regulated-assets-approval-server-demo [command] [flags]
regulated-assets-approval-server-demo [command]
regulated-assets-approval-server [command] [flags]
regulated-assets-approval-server [command]

Available Commands:
serve Run the SEP-8 Approval Server Demo
serve Serve the SEP-8 Approval Server

Use "regulated-assets-approval-server-demo [command] --help" for more information about a command.
Use "regulated-assets-approval-server [command] --help" for more information about a command.
```

## Usage: Serve

```
```sh
$ go install
$ regulated-assets-approval-server-demo serve --help
Run the SEP-8 Approval Server Demo
$ regulated-assets-approval-server serve --help
Serve the SEP-8 Approval Server

Usage:
regulated-assets-approval-server-demo serve [flags]
regulated-assets-approval-server serve [flags]

Flags:
--horizon-url string Horizon URL used for looking up account details (HORIZON_URL) (default "https://horizon-testnet.stellar.org/")
--network-passphrase string Network passphrase of the Stellar network transactions should be signed for (NETWORK_PASSPHRASE) (default "Test SDF Network ; September 2015")
--port int Port to listen and serve on (PORT) (default 8000)
```


[SEP-8]: https://github.com/stellar/stellar-protocol/blob/7c795bb9abc606cd1e34764c4ba07900d58fe26e/ecosystem/sep-0008.md
[SEP-8]: https://github.com/stellar/stellar-protocol/blob/7c795bb9abc606cd1e34764c4ba07900d58fe26e/ecosystem/sep-0008.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"github.com/spf13/cobra"
"github.com/stellar/go/clients/horizonclient"
"github.com/stellar/go/network"
"github.com/stellar/go/services/regulated-assets-approval-server-demo/serve"
"github.com/stellar/go/services/regulated-assets-approval-server/serve"
"github.com/stellar/go/support/config"
)

Expand Down Expand Up @@ -42,7 +42,7 @@ func (c *ServeCommand) Command() *cobra.Command {
}
cmd := &cobra.Command{
Use: "serve",
Short: "Run the SEP-8 Approval Server Demo",
Short: "Serve the SEP-8 Approval Server",
Run: func(_ *cobra.Command, _ []string) {
configOpts.Require()
configOpts.SetValues()
Expand Down
14 changes: 14 additions & 0 deletions services/regulated-assets-approval-server/docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang:1.16 as build

ADD . /src/regulated-assets-approval-server
WORKDIR /src/regulated-assets-approval-server
RUN go build -o /bin/regulated-assets-approval-server ./services/regulated-assets-approval-server


FROM ubuntu:20.04

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates
COPY --from=build /bin/regulated-assets-approval-server /app/
EXPOSE 8000
ENTRYPOINT ["/app/regulated-assets-approval-server"]
CMD ["serve"]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package main
import (
"github.com/sirupsen/logrus"
"github.com/spf13/cobra"
"github.com/stellar/go/services/regulated-assets-approval-server-demo/cmd"
"github.com/stellar/go/services/regulated-assets-approval-server/cmd"
"github.com/stellar/go/support/log"
)

Expand All @@ -12,8 +12,8 @@ func main() {
log.DefaultLogger.Logger.Level = logrus.TraceLevel

rootCmd := &cobra.Command{
Use: "regulated-assets-approval-server-demo [command]",
Short: "SEP-8 Approval Server Demo",
Use: "regulated-assets-approval-server [command]",
Short: "SEP-8 Approval Server",
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ func Serve(opts Options) {
WriteTimeout: time.Second * 35,
IdleTimeout: time.Minute * 2,
OnStarting: func() {
log.Info("Starting SEP-8 Approval Server Demo")
log.Info("Starting SEP-8 Approval Server")
log.Infof("Listening on %s", listenAddr)
},
OnStopping: func() {
log.Info("Stopping SEP-8 Approval Server Demo")
log.Info("Stopping SEP-8 Approval Server")
},
}
supporthttp.Run(serverConfig)
Expand Down

0 comments on commit 5f72b89

Please sign in to comment.