Skip to content

Commit

Permalink
Update Go-Ethereum (#214)
Browse files Browse the repository at this point in the history
* Refactored start docs

* Changed source of go-bindata #197

* Updated go dep trackers

* Updated yarn dependencies

* Added update step to Makefile

* New auto-generated bindata tests

* Added doc note about make update

* yarn upgrade

* Doc: rename Infura key as "project ID" for clarity

* Set resource class to medium for CircleCI builds

* Use Debian 'stable' release in Docker

* Add .env configuration loader to make #204

* Copy env during bootstrap

* Documentation related to license finder

* go-bindata install path

* Docker documentation link

* README revised

* Added logging instruction

* Dependency updates, tidy and fix #213

* Documentation tips added

* Yarn update

* Added versioned ssri & is-svg to ui/core

* File type to sync Map #215

* echo-contrib locked to echo v3 #216

* Fix make circular dependency on bindata.go warning

* Switch to CircleCI next gen image #202

* Skip compilation in cloud deploy

* Update to Go 1.16 #217

* Fixed go-bindata install

* Better test for window.web3 #199

* Reverted to legacy CircleCI image

* Revert to new image and new go-bindata load strategy #202

* Fix use of mongo.IndexModel #218

* Update to Node.js LTS 14.x #217

* Improve test for window.web3 #199

* Use same image for build-ui #217

* Updated ui library web3 1.3.4 #199

* Go mod tidy
  • Loading branch information
loleg authored Apr 30, 2021
1 parent bc73a53 commit 3994324
Show file tree
Hide file tree
Showing 22 changed files with 1,195 additions and 351 deletions.
8 changes: 4 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ executors:
environment:
PROJECT_ROOT_FOLDER: ~/project
docker:
- image: circleci/golang:1.13
- image: cimg/go:1.16-node
docker-image-golang-dependencies:
environment:
PROJECT_ROOT_FOLDER: ~/project
docker:
- image: circleci/golang:1.13
- image: cimg/go:1.16-node
- image: proxeus/node-crypto-forex-rates
- image: proxeus/document-service
- image: proxeus/mongo-dev-cluster
Expand All @@ -25,7 +25,7 @@ executors:
jobs:
build-ui:
docker:
- image: node:10
- image: cimg/go:1.16-node
steps:
- checkout
- restore_cache:
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- restore_cache:
keys:
- go-mod-v2-{{ checksum "go.sum" }}
- run: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
- run: curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
- run: curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
- run: echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
- run: sudo apt-get update && sudo apt-get install yarn
Expand Down
28 changes: 17 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
SHELL:= /bin/bash
DEBUG_FLAG?=false
GO_VERSION=1.13
GO_VERSION=1.16

ifeq ($(DEBUG), "true")
BINDATA_OPTS="-debug"
Expand All @@ -10,14 +10,6 @@ ifdef BUILD_ID
GO_OPTS=-ldflags="-X main.ServerVersion=build-$(BUILD_ID)"
endif

DOCKER_GATEWAY=172.17.0.1
DOCKER=sudo docker
ifeq ($(shell uname), Darwin)
DOCKER_LINUX=docker run --rm -v "$(PWD):/usr/src" -w /usr/src golang:$(GO_VERSION)
DOCKER_GATEWAY=host.docker.internal
DOCKER=docker
endif

# Load dotenv configuration
ifneq (,$(wildcard ./.env))
include .env
Expand All @@ -40,6 +32,20 @@ export PROXEUS_DATABASE_URI?=mongodb://localhost:27017

#########################################################

# Docker build set up

DOCKER_GATEWAY=172.17.0.1
DOCKER=sudo docker
export BUILD_WITH_DOCKER?=false
ifeq ($(shell uname), Darwin)
BUILD_WITH_DOCKER=true
endif
ifeq ($(BUILD_WITH_DOCKER), true)
DOCKER_LINUX=docker run --rm -v "$(PWD):/usr/src" -w /usr/src golang:$(GO_VERSION)
DOCKER_GATEWAY=host.docker.internal
DOCKER=docker
endif

#########################################################

# Coverage
Expand Down Expand Up @@ -72,10 +78,10 @@ all: ui server
init:
@for d in $(dependencies); do (echo "Checking $$d is installed... " && which $$d ) || ( echo "Please install $$d before continuing" && exit 1 ); done
go install golang.org/x/tools/cmd/goimports
go install github.com/go-bindata/go-bindata/...
go install github.com/golang/mock/mockgen
go install github.com/wadey/gocovmerge
go install golang.org/x/tools/cmd/godoc
go get -u github.com/go-bindata/go-bindata/v3/...

.PHONY: update
update:
Expand Down Expand Up @@ -202,7 +208,7 @@ main/handlers/assets/bindata.go: $(wildcard ./ui/core/dist/**)
go-bindata ${BINDATA_OPTS} -pkg assets -o ./main/handlers/assets/bindata.go -prefix ./ui/core/dist ./ui/core/dist/...
goimports -w $@

test/assets/bindata.go: $(filter-out bindata.go,$(shell find ./test/assets/))
test/assets/bindata.go: $(filter-out bindata.go,$(shell find ./test/assets/ ! -name "bindata.go"))
go-bindata ${BINDATA_OPTS} -pkg assets -o ./test/assets/bindata.go ./test/assets/...
goimports -w $@

Expand Down
59 changes: 24 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,47 +10,47 @@ blockchain functionalities, enabling users to digitize and monetize their IP.
You can access the source code of this application and various extensions
on [GitHub](https://github.com/ProxeusApp).

# Quick Starts
## Quickstart

## Automated builds

We are making facilitated "one click" build configurations available for select cloud platforms:
We are making facilitated "one-click" automated build configurations available for select cloud platforms. Please contact us if you are interested in additional providers on this list:

- [Linode StackScript](deploy/linode/README.md)

## Using Docker
## Installation using Docker

The quickest way to set up Proxeus for development is to use Docker, and the `docker-compose` tool.

### Install docker and docker-compose

1. [Install Docker Engine](https://docs.docker.com/install/)
2. [Install docker-compose](https://docs.docker.com/compose/install/)

### Get API Keys for Infura and SparkPost
See further deployment instructions in [docs/docker](docs/docker.md) to set up your server using Docker.

### Infura and SparkPost

The Proxeus platform depends on [Infura](https://infura.io/) and [SparkPost](https://www.sparkpost.com/)
The Proxeus platform currently depends on [Infura](https://infura.io/) and [SparkPost](https://www.sparkpost.com/)
for Ethereum and email integration respectively. Create an account on those platforms
to get API Keys. These keys need to be added to corresponding environment variables.
to get API Keys. These keys need to be added to corresponding environment variables, or
entered when deploying a "one-click" instance.

See further deployment instructions in [docs/docker](docs/docker.md) to set up your server using Docker.
Please note that the domain you set up on SparkPost MUST match the **reply-to** e-mail address that you configure in the next step in order to create accounts and receive e-mails on your instance.

If all goes well, Proxeus should be available at http://localhost:1323
If all goes well, Proxeus should be available at http://localhost:1323. The next step will be to [configure](docs/configure.md) your instance for the first time.

The next step is to [configure](docs/configure.md) your instance for the first time.
## User manual

## Build Proxeus Platform from the source code
Get help to make the most of the platform in the [User Handbook](https://docs.google.com/document/d/e/2PACX-1vTchv7PotoQeH2cBA2VIHcqV0I0N_IQpFnbESR-8C19cgBikek3HAMVdPtfJJcYkANzPWbfy_S3bf8X/pub).

If you are a developer and want to build the project form the source code follow the instructions in [Build all](docs/build_all.md)
### XES Payments
For detailed information about payments setup, check the [XES-Payment Readme](docs/xes-payment.md).

## Developer manual
### Smart contracts
Check the [Smart contracts & Solidity Readme](https://github.com/ProxeusApp/proxeus-contract) to learn more.

Please read the [Developer Manual](https://doc.proxeus.com) to learn more about the
Proxeus platform.
## Development guide

## User manual
Please read the [Developer Manual](https://doc.proxeus.com) to learn more about the Proxeus platform.

Get help to make the most of the platform in the [User Handbook](https://docs.google.com/document/d/e/2PACX-1vTchv7PotoQeH2cBA2VIHcqV0I0N_IQpFnbESR-8C19cgBikek3HAMVdPtfJJcYkANzPWbfy_S3bf8X/pub).
If you wish to build the project form the source code, follow the instructions in [Build all](docs/build_all.md)

## Contributing

Expand All @@ -59,25 +59,14 @@ engaging in insightful discussions. Especially, we are looking forward to receiv

See the [Contributing](docs/contributing.md) section for instructions on how to contribute.

### Security Issues

If you find a vulnerability that may affect live or testnet deployments please send your report privately to
[email protected]. Please DO NOT file a public issue.
## Security Issues

## Misc

### XES-Payment
For more info check the [XES-Payment Readme](docs/xes-payment.md).

### Smart contracts & Solidity
For more info check the [Smart contracts & Solidity Readme](https://github.com/ProxeusApp/proxeus-contract).
If you find a vulnerability that may affect live or testnet deployments please DO NOT file a public issue - send your report privately to [email protected]

## License

Licensed under the GNU GENERAL PUBLIC LICENSE. You may read a copy of the License [here](LICENSE)
Licensed under the GNU GENERAL PUBLIC LICENSE. You may read a copy of the [License here](LICENSE).

## Acknowledgements

Like so many projects, this effort has roots in many places.

The list can be found [here](ACKNOWLEDGEMENTS)
Like so many projects, this effort has roots in many places. The list can be found in [ACKNOWLEDGEMENTS](ACKNOWLEDGEMENTS).
3 changes: 2 additions & 1 deletion bootstrap.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -78,13 +78,15 @@ install-proxeus() {

if [[ -n $GIT_BRANCH ]]; then
install-proxeus-from-source "origin/$GIT_BRANCH"

elif [[ -n $GIT_TAG ]]; then
local GIT_SEMVER="${GIT_TAG//v/}"
major=$(echo "$GIT_SEMVER" | awk '{split($0,a,"."); print a[1]}')
minor=$(echo "$GIT_SEMVER" | awk '{split($0,a,"."); print a[2]}')
patch=$(echo "$GIT_SEMVER" | awk '{split($0,a,"."); print a[3]}')

install-proxeus-from-source "$GIT_TAG"

else
install-proxeus-from-source
fi
Expand All @@ -102,7 +104,6 @@ install-proxeus-from-source() {
cp ../.env .
git fetch origin
[[ -n $GIT_CHECKOUT ]] && git checkout "$GIT_CHECKOUT"
make
}

main() {
Expand Down
4 changes: 4 additions & 0 deletions deploy/linode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ This script is maintained for the community by Proxeus Association

Once your server is running, visit the [User Handbook](https://docs.google.com/document/d/e/2PACX-1vTchv7PotoQeH2cBA2VIHcqV0I0N_IQpFnbESR-8C19cgBikek3HAMVdPtfJJcYkANzPWbfy_S3bf8X/pub) to get started.

To view the logs, log in with the Linode's built-in shell client ("Launch LISH console"), or connect to your instance using an SSH client program. Then paste this into the console to see the logs being updated in real time:

`cd /srv/proxeus && docker-compose logs -f`

## References

The basic set-up of a Debian or Ubuntu server is based roughly on Linode's [Basic OCA Helper One-Click](https://cloud.linode.com/stackscripts/401712).
Expand Down
11 changes: 9 additions & 2 deletions deploy/linode/stackscript.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# <UDF name="FQDN" Label="Fully Qualified Domain Name" example="web.example.com" />
# <UDF name="INFURA" Label="Infura.io API key" example="a0e728c9fd444a123456789000b9370f" />
# <UDF name="SPARKPOST" Label="Sparkpost.com API key" example="27ed8e1234567890000014863f9e2cf553a7bd87" />
# <UDF name="ADMINEMAIL" Label="Admin e-mail address" example="[email protected]" />

# Logs: tail -f /var/log/stackscript.log
# Logs: cat /var/log/stackscript.log
Expand Down Expand Up @@ -102,21 +103,27 @@ cd /srv

cat <<END >.env
PROXEUS_BLOCKCHAIN_CONTRACT_ADDRESS=0x1d3e5c81bf4bc60d41a8fbbb3d1bae6f03a75f71
PROXEUS_ALLOW_HTTP=true
PROXEUS_DATA_DIR=./data
PROXEUS_ALLOW_HTTP=true
PROXEUS_INFURA_API_KEY=$INFURA
PROXEUS_SPARKPOST_API_KEY=$SPARKPOST
PROXEUS_PLATFORM_DOMAIN=http://$FQDN:1323
PROXEUS_VIRTUAL_HOST=$FQDN
LETSENCRYPT_EMAIL=$ADMINEMAIL
END

log "Warning: you should disable port 80 in production by removing the PROXEUS_ALLOW_HTTP line in your .env"

wget https://raw.githubusercontent.com/ProxeusApp/proxeus-core/master/bootstrap.sh;
bash bootstrap.sh

cd /srv/proxeus

log "Starting Proxeus Core"
# Compilation should not be necessary for a cloud install
# make init server-docker

log "Starting cloud deployment via docker-compose"
docker-compose --env-file .env -f docker-compose.yml -f docker-compose-cloud.override.yml up -d &

# Open http://$FQDN:1323/init to configure your server
Expand Down
15 changes: 13 additions & 2 deletions docs/build_all.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ Here is the list of dependencies:
+ go (1.10+, 64bit for Windows)
+ GOBIN added to your PATH (to check your GOBIN: `echo $(go env GOPATH)/bin`)
+ curl
+ yarn (1.12.3+)
+ node (8.11.3+, node v12 is incompatible)
+ yarn (1.12+)
+ node (14)
+ vue-cli
+ git
+ docker-compose (18.06.0+)
Expand Down Expand Up @@ -92,3 +92,14 @@ Run `server`.
The platform will be available at the following URL: http://localhost:1323

It is now time to [configure your platform](configure.md)

### Tips

Update command failing? Try:

- doing a quick verification and config-file check
`go mod verify` / `go mod tidy`
- clearing your module cache:
`go clean -cache -modcache -i -r`
- checking your dependency graph to isolate the issue:
`go mod graph`
23 changes: 18 additions & 5 deletions docs/build_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

## Build a Docker image


The project includes a `Dockerfile` that is used to create the `proxeus-core` docker image.

First you need to have the [Docker Engine](https://docs.docker.com/install/) installed.
Expand All @@ -19,10 +18,17 @@ Please refer to the `docker-compose.yml` file to learn how to configure a Proxeu

## Using Docker during development

You can use Docker during development:
If you want to use a Docker image to build your server (for example, when you are not on a Linux machine or have a newer version of GLIBC than is supported in production), compile as follows:

```
BUILD_WITH_DOCKER=true make init server-docker
docker build .
```

You can of course use Docker to run the platform during development:

```
docker-compose build
docker-compose build
docker-compose up
```

Expand All @@ -33,9 +39,17 @@ docker-compose build
docker-compose restart
```

This will build the proxeus-core image based on your current project and use a deployed image
This will build the proxeus-core image based on your current project and use a deployed image
for the document service.

If you're having trouble, try a clean full build, specifying each of the configuration files:

```
make clean
BUILD_WITH_DOCKER=true make init server-docker
docker-compose --env-file .env -f docker-compose.yml -f docker-compose.override.yml build
```

## Using Docker for deployment

For deployment, a `docker-compose-cloud.override.yml` file is provide and must be used
Expand All @@ -44,4 +58,3 @@ instead of the default `docker-compose.override.yml`:
```
docker-compose -f docker-compose.yml -f docker-compose-cloud.override.yml
```

8 changes: 4 additions & 4 deletions docs/frontend.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Frontend Development

### Prerequisites
+ yarn (1.12.*)
+ node (8.11.3+, not working with node 12)
+ yarn (1.12+)
+ node (14+)
+ vue-cli

> **Important**
>
> Only use yarn 1.12.*. For linking together local dependencies we use Yarn Workspaces:
> Only use yarn 1.12 or higher. For linking together local dependencies we use Yarn Workspaces:
> https://yarnpkg.com/lang/en/docs/workspaces/
>
> Use yarn only from the /core/central/ui directory, as the common dependencies will be stored in
Expand Down Expand Up @@ -47,7 +47,7 @@ the latest production build. Use 3005 if you want to use the latest frontend fea

- Progressive Web Apps https://developers.google.com/web/progressive-web-apps/
- FileSystem API https://developer.mozilla.org/en-US/docs/Web/API/FileSystem
- Web3 https://github.com/ethereum/web3.js/tree/v0.20.6
- Web3 https://github.com/ethereum/web3.js/tree/v0.20.6
- ES6/ES7… https://codeburst.io/javascript-wtf-is-es6-es8-es-2017-ecmascript-dca859e4821c
- Async/Await https://medium.com/@rafaelvidaurre/truly-understanding-async-await-491dd580500e
- JavaScript https://developer.mozilla.org/bm/docs/Web/JavaScript
Expand Down
Loading

0 comments on commit 3994324

Please sign in to comment.