-
Notifications
You must be signed in to change notification settings - Fork 9
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
Docker file #45
Docker file #45
Changes from all commits
56879c9
d01b36b
d47f861
38dc2a9
472e3fc
929027f
5d22705
8fa33ed
429c349
63d70ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
|
||
# BUILD BIN | ||
|
||
FROM golang:1.22.0 as builder | ||
# Install go modules | ||
WORKDIR /flow-evm-gateway | ||
COPY go.* ./ | ||
COPY . ./ | ||
RUN go mod download | ||
RUN go mod verify | ||
RUN CGO_ENABLED=0 go build -o evm-gateway ./cmd/server/main.go | ||
RUN chmod a+x evm-gateway | ||
RUN chmod a+x ./scripts/run.sh | ||
|
||
RUN wget https://github.com/m-Peter/flow-cli-custom-builds/raw/main/flow-x86_64-linux- | ||
RUN chmod a+x flow-x86_64-linux- | ||
|
||
# RUN APP | ||
FROM debian:latest | ||
WORKDIR /flow-evm-gateway | ||
COPY --from=builder /flow-evm-gateway/evm-gateway /flow-evm-gateway/evm-gateway | ||
COPY --from=builder /flow-evm-gateway/flow-x86_64-linux- /flow-evm-gateway/flow-x86_64-linux- | ||
COPY --from=builder /flow-evm-gateway/flow.json /flow-evm-gateway/flow.json | ||
COPY --from=builder /flow-evm-gateway/api/cadence/transactions/create_bridged_account.cdc /flow-evm-gateway/create_bridged_account.cdc | ||
COPY --from=builder /flow-evm-gateway/scripts/run.sh /flow-evm-gateway/run.sh | ||
EXPOSE 8545 | ||
CMD cd /flow-evm-gateway && ./run.sh |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ func TestServerJSONRPCOveHTTPHandler(t *testing.T) { | |
blockchainAPI := api.NewBlockChainAPI(config, store, mockFlowClient) | ||
supportedAPIs := api.SupportedAPIs(blockchainAPI) | ||
srv.EnableRPC(supportedAPIs) | ||
srv.SetListenAddr("localhost", 8545) | ||
srv.SetListenAddr("", 8545) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious, did you encounter a problem with There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes, there was an issue in cloud run
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar comment as above about the port needing to be an injected variable |
||
err := srv.Start() | ||
defer srv.Stop() | ||
if err != nil { | ||
|
@@ -460,7 +460,7 @@ func TestServerJSONRPCOveWebSocketHandler(t *testing.T) { | |
blockchainAPI := api.NewBlockChainAPI(config, store, flowClient) | ||
supportedAPIs := api.SupportedAPIs(blockchainAPI) | ||
srv.EnableWS(supportedAPIs) | ||
srv.SetListenAddr("localhost", 8545) | ||
srv.SetListenAddr("", 8545) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same comment |
||
err = srv.Start() | ||
defer srv.Stop() | ||
if err != nil { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -182,7 +182,7 @@ func runServer(config *api.Config, store *storage.Store, logger zerolog.Logger) | |
srv.EnableRPC(supportedAPIs) | ||
srv.EnableWS(supportedAPIs) | ||
|
||
srv.SetListenAddr("localhost", 8545) | ||
srv.SetListenAddr("", 8545) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same again |
||
|
||
err = srv.Start() | ||
if err != nil { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#!/bin/bash | ||
|
||
# Start the first process & redirect output to a temporary file | ||
./flow-x86_64-linux- emulator --evm-enabled > temp_output.txt & | ||
|
||
# PID of the first process | ||
FIRST_PROCESS_PID=$! | ||
|
||
# Monitor the temporary file for a specific output | ||
PATTERN="3569" | ||
while ! grep -q "$PATTERN" temp_output.txt; do | ||
sleep 1 | ||
done | ||
|
||
# Once the pattern is found, you can kill the first process if needed | ||
# kill $FIRST_PROCESS_PID | ||
|
||
# Run the second process | ||
|
||
./flow-x86_64-linux- transactions send /flow-evm-gateway/create_bridged_account.cdc 1500.0 --network=emulator --signer=emulator-account && ./evm-gateway | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We will need to be able to pass in the network to be used, whether emulator or other network |
||
|
||
# Clean up temporary file | ||
rm temp_output.txt |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We'll need to expose this so it can be templated and set externally