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

fix dockerfile, pkgs #214

Merged
merged 1 commit into from
Aug 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
13 changes: 7 additions & 6 deletions .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,21 @@ jobs:

- name: Install dependencies
run: |
cd ../ && git clone -b development_process https://github.com/freeflowuniverse/crystallib.git
mkdir -p ~/code/github/freeflowuniverse
cd ~/code/github/freeflowuniverse
git clone https://github.com/freeflowuniverse/webcomponents.git
git clone https://github.com/freeflowuniverse/crystallib.git
cd crystallib && bash install.sh
cd ../

- name: Check out repository code
uses: actions/checkout@v3

- name: Build V Client
run: |
bash install.sh
for main in $(ls web3gw/examples/**/*.v); do
v $main
done
bash manual/install.sh

- name: Build Server
run: |
cd web3gw/server
cd web3gw
go build
7 changes: 3 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
FROM docker.io/golang:1.20-alpine as builder

FROM golang:1.21-alpine as builder

WORKDIR /src

ADD . /src

RUN apk add build-base

RUN cd web3gw/server &&\
RUN cd web3gw &&\
GOOS=linux CGO_ENABLED=1 go build -o webproxy &&\
chmod +x webproxy

FROM alpine:3.14

ARG SFTPGOBRANCH

COPY --from=builder /src/web3gw/server/webproxy /usr/bin/webproxy
COPY --from=builder /src/web3gw/webproxy /usr/bin/webproxy

COPY --from=builder /src/sftpgo.json /var/lib/sftpgo/sftpgo.json

Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@

## web3gw

The web3gw implements a json rpc 2.0 server which opens up remote procedure calls for many clients such as tfgrid, tfchain, stellar, bitcoin, etc. Each directory in [here](server/pkg/) is a client that the web3 proxy supports.
The web3gw implements a json rpc 2.0 server which opens up remote procedure calls for many clients such as tfgrid, tfchain, stellar, bitcoin, etc. Each directory in [here](/web3gw/pkg/) is a client that the web3 proxy supports.

Project setup:

- [Server](server/): the implementation for the json rpc 2.0 server
- [Server](web3gw/): the implementation for the json rpc 2.0 server
- [Lib](lib/): the V library that implements the client for the json rpc 2.0 server, each of the server's methods can be called from that library
- [Examples](examples): contains some examples of V scripts for each client that the json rpc 2.0 server supports, these scripts show you how you can use the V library

## How to run the web3 proxy server (json rpc 2.0 server)

The server is implemented in go and is located in [this folder](server/). To build and run the server execute these commands:
The server is implemented in go and is located in [this folder](web3gw/). To build and run the server execute these commands:

```shell
cd server
go build && ./server --debug
cd web3gw
./build.sh && ~/go/bin/web3gw-server --debug
```

The json rpc 2.0 server should now be up and running and should allow you to call any of the clients that the server supports.

## Installing the V library

If you wish to use the V library to contact the server you first have to install the V libary. Please execute the command shown below. The V library has a dependency on [crystallib](https://github.com/freeflowuniverse/crystallib). The bash scrips show below will do that for you unless you install it first. Installing it first allows you to be able to use different branches from crystallib as runtime code.
If you wish to use the V library to contact the server you first have to install the V library. Please execute the command shown below. The V library has a dependency on [crystallib](https://github.com/freeflowuniverse/crystallib). The bash scrips show below will do that for you unless you install it first. Installing it first allows you to be able to use different branches from crystallib as runtime code.

```sh
./install.sh
Expand All @@ -39,7 +39,7 @@ You should now be able to run the examples under [examples](examples/). They sho

## Adding new clients

Follow the steps [here](server/) to add the client to the json rpc 2.0 server and then look [here](lib/) to add the necessary code for the V library. This repository contains a pipeline that builds and tests both the server and V clients. This should be green for development at all times. Whenever we add a new client to the web3 proxy it should be build by CI to make sure that it is building at all times.
Follow the steps [here](web3gw/) to add the client to the json rpc 2.0 server and then look [here](lib/) to add the necessary code for the V library. This repository contains a pipeline that builds and tests both the server and V clients. This should be green for development at all times. Whenever we add a new client to the web3 proxy it should be build by CI to make sure that it is building at all times.

## Documentation

Expand Down
80 changes: 40 additions & 40 deletions web3gw/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -35,22 +35,22 @@ require (
github.com/threefoldtech/tfgrid-sdk-go/rmb-sdk-go v0.11.2
github.com/threefoldtech/zos v0.5.6-0.20230809073554-ddb0ad98fc4c
golang.org/x/exp v0.0.0-20231006140011-7918f672742d
golang.org/x/net v0.16.0
golang.org/x/sync v0.4.0
golang.org/x/net v0.25.0
golang.org/x/sync v0.8.0
golang.zx2c4.com/wireguard/wgctrl v0.0.0-20230429144221-925a1e7659e6
)

replace github.com/drakkan/sftpgo/v2 v2.4.5 => github.com/freeflowuniverse/aydo/v2 v2.0.0-20230724110325-1aa405d380ec
replace github.com/drakkan/sftpgo/v2 v2.4.5 => github.com/freeflowuniverse/aydo/v2 v2.0.0-20240821121112-9dc62bbad7c1

require (
cloud.google.com/go v0.110.8 // indirect
cloud.google.com/go/compute v1.23.0 // indirect
cloud.google.com/go/compute v1.23.1 // indirect
cloud.google.com/go/compute/metadata v0.2.3 // indirect
cloud.google.com/go/iam v1.1.2 // indirect
cloud.google.com/go/iam v1.1.3 // indirect
cloud.google.com/go/storage v1.33.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/azcore v1.8.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/internal v1.3.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.1.0 // indirect
github.com/Azure/azure-sdk-for-go/sdk/storage/azblob v1.2.0 // indirect
github.com/ChainSafe/go-schnorrkel v1.1.0 // indirect
github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5 // indirect
github.com/Jorropo/jsync v1.0.1 // indirect
Expand All @@ -61,26 +61,26 @@ require (
github.com/alexedwards/argon2id v0.0.0-20230305115115-4b3c3280a736 // indirect
github.com/amoghe/go-crypt v0.0.0-20220222110647-20eada5f5964 // indirect
github.com/andybalholm/brotli v1.0.5 // indirect
github.com/aws/aws-sdk-go-v2 v1.21.1 // indirect
github.com/aws/aws-sdk-go-v2 v1.21.2 // indirect
github.com/aws/aws-sdk-go-v2/aws/protocol/eventstream v1.4.14 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.44 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.42 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.12 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.89 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.42 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.36 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.44 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.5 // indirect
github.com/aws/aws-sdk-go-v2/config v1.18.45 // indirect
github.com/aws/aws-sdk-go-v2/credentials v1.13.43 // indirect
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.13.13 // indirect
github.com/aws/aws-sdk-go-v2/feature/s3/manager v1.11.90 // indirect
github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.43 // indirect
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.37 // indirect
github.com/aws/aws-sdk-go-v2/internal/ini v1.3.45 // indirect
github.com/aws/aws-sdk-go-v2/internal/v4a v1.1.6 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.9.15 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.37 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.36 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.5 // indirect
github.com/aws/aws-sdk-go-v2/service/marketplacemetering v1.16.1 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.1 // indirect
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.21.4 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.15.1 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.2 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.23.1 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/checksum v1.1.38 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.9.37 // indirect
github.com/aws/aws-sdk-go-v2/service/internal/s3shared v1.15.6 // indirect
github.com/aws/aws-sdk-go-v2/service/marketplacemetering v1.16.2 // indirect
github.com/aws/aws-sdk-go-v2/service/s3 v1.40.2 // indirect
github.com/aws/aws-sdk-go-v2/service/secretsmanager v1.21.5 // indirect
github.com/aws/aws-sdk-go-v2/service/sso v1.15.2 // indirect
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.17.3 // indirect
github.com/aws/aws-sdk-go-v2/service/sts v1.23.2 // indirect
github.com/aws/smithy-go v1.15.0 // indirect
github.com/benbjohnson/clock v1.3.5 // indirect
github.com/beorn7/perks v1.0.1 // indirect
Expand Down Expand Up @@ -142,7 +142,7 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.3 // indirect
github.com/gomodule/redigo v2.0.0+incompatible // indirect
github.com/google/go-cmp v0.5.9 // indirect
github.com/google/go-cmp v0.6.0 // indirect
github.com/google/gopacket v1.1.19 // indirect
github.com/google/pprof v0.0.0-20230926050212-f7f687d19a98 // indirect
github.com/google/s2a-go v0.1.7 // indirect
Expand Down Expand Up @@ -220,7 +220,7 @@ require (
github.com/marten-seemann/tcp v0.0.0-20210406111302-dfbc87cc63fd // indirect
github.com/mattn/go-colorable v0.1.13 // indirect
github.com/mattn/go-isatty v0.0.19 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/mattn/go-sqlite3 v1.14.22 // indirect
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
github.com/miekg/dns v1.1.56 // indirect
github.com/mikioh/tcpinfo v0.0.0-20190314235526-30a79bb1804b // indirect
Expand Down Expand Up @@ -273,7 +273,7 @@ require (
github.com/sagikazarmark/slog-shim v0.1.0 // indirect
github.com/segmentio/asm v1.2.0 // indirect
github.com/segmentio/go-loggly v0.5.1-0.20171222203950-eb91657e62b2 // indirect
github.com/sftpgo/sdk v0.1.5 // indirect
github.com/sftpgo/sdk v0.1.6 // indirect
github.com/shirou/gopsutil v3.21.11+incompatible // indirect
github.com/shirou/gopsutil/v3 v3.23.9 // indirect
github.com/shoenig/go-m1cpu v0.1.6 // indirect
Expand All @@ -300,7 +300,7 @@ require (
github.com/whyrusleeping/cbor-gen v0.0.0-20230923211252-36a87e1ba72f // indirect
github.com/whyrusleeping/chunker v0.0.0-20181014151217-fe64bd25879f // indirect
github.com/whyrusleeping/go-keyspace v0.0.0-20160322163242-5b898ac5add1 // indirect
github.com/wneessen/go-mail v0.4.0 // indirect
github.com/wneessen/go-mail v0.4.1-0.20230823094700-0bd5390e370d // indirect
github.com/xeipuuv/gojsonschema v1.2.0 // indirect
github.com/yalp/jsonpath v0.0.0-20180802001716-5cc68e5049a0 // indirect
github.com/yl2chen/cidranger v1.0.3-0.20210928021809-d1cb2c52f37a // indirect
Expand All @@ -317,21 +317,21 @@ require (
go.uber.org/multierr v1.11.0 // indirect
go.uber.org/zap v1.26.0 // indirect
gocloud.dev v0.34.0 // indirect
golang.org/x/crypto v0.14.0 // indirect
golang.org/x/mod v0.13.0 // indirect
golang.org/x/crypto v0.26.0 // indirect
golang.org/x/mod v0.17.0 // indirect
golang.org/x/oauth2 v0.13.0 // indirect
golang.org/x/sys v0.13.0 // indirect
golang.org/x/text v0.13.0 // indirect
golang.org/x/sys v0.23.0 // indirect
golang.org/x/text v0.17.0 // indirect
golang.org/x/time v0.3.0 // indirect
golang.org/x/tools v0.14.0 // indirect
golang.org/x/xerrors v0.0.0-20220907171357-04be3eba64a2 // indirect
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028 // indirect
gonum.org/v1/gonum v0.14.0 // indirect
google.golang.org/api v0.145.0 // indirect
google.golang.org/api v0.147.0 // indirect
google.golang.org/appengine v1.6.8 // indirect
google.golang.org/genproto v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231002182017-d307bd883b97 // indirect
google.golang.org/grpc v1.58.2 // indirect
google.golang.org/genproto v0.0.0-20231012201019-e917dd12ba7a // indirect
google.golang.org/genproto/googleapis/api v0.0.0-20231012201019-e917dd12ba7a // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20231012201019-e917dd12ba7a // indirect
google.golang.org/grpc v1.58.3 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
gopkg.in/natefinch/lumberjack.v2 v2.2.1 // indirect
Expand All @@ -344,7 +344,7 @@ require (
replace (
github.com/jlaffaye/ftp => github.com/drakkan/ftp v0.0.0-20201114075148-9b9adce499a9
github.com/robfig/cron/v3 => github.com/drakkan/cron/v3 v3.0.0-20230222140221-217a1e4d96c0
golang.org/x/crypto => github.com/drakkan/crypto v0.0.0-20230614155948-29e7be6c0fab
golang.org/x/crypto => github.com/drakkan/crypto v0.0.0-20231010171726-2674169e524d
)

replace github.com/centrifuge/go-substrate-rpc-client/v4 v4.0.5 => github.com/threefoldtech/go-substrate-rpc-client/v4 v4.0.6-0.20230102154731-7c633b7d3c71
Loading
Loading