Skip to content

Commit

Permalink
Merge pull request #14 from DeFiCh/develop
Browse files Browse the repository at this point in the history
v1.0.0-rc1
  • Loading branch information
prasannavl authored Jul 1, 2020
2 parents e6ee3bd + b09590e commit d847cd8
Show file tree
Hide file tree
Showing 64 changed files with 1,094 additions and 6,506 deletions.
53 changes: 46 additions & 7 deletions .github/workflows/dev-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,31 +3,70 @@ on:
tags:
- "!v*"
branches:
- master
- staging
- develop
- master
- ci/*
pull_request:
branches:
- staging
- develop
- master
- develop
- staging
- ci/*

jobs:
x86_64-linux-gnu:

linux:
# We use a matrix since it's easier to migrate upwards, add new
# test on multiple, then remove old without creating friction.
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
env:
BUILD_VERSION: latest # Computed

steps:
- uses: actions/checkout@v2
- name: Build and package
run: ./make.sh docker-release-git
- name: Publish artifacts
run: TARGETS="x86_64-pc-linux-gnu" ./make.sh docker-release-git
- name: Publish artifact - x86_64-pc-linux-gnu
uses: actions/upload-artifact@v2-preview
with:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu.tar.gz

windows:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
env:
BUILD_VERSION: latest # Computed

steps:
- uses: actions/checkout@v2
- name: Build and package
run: TARGETS="x86_64-w64-mingw32" ./make.sh docker-release-git
- name: Publish artifact - x86_64-w64-mingw32
uses: actions/upload-artifact@v2-preview
with:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.tar.gz

macos:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04]
env:
BUILD_VERSION: latest # Computed

steps:
- uses: actions/checkout@v2
- name: Build and package
run: TARGETS="x86_64-apple-darwin11" ./make.sh docker-release-git
- name: Publish artifact - x86_64-apple-darwin11
uses: actions/upload-artifact@v2-preview
with:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin11
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin11.tar.gz
4 changes: 4 additions & 0 deletions .github/workflows/prune-artifacts.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# This is a script to remove all artifacts every month. By default it's 3 months, I think.
# This may be removed in the future when we don't have so many builds which could end up
# filling up the storage space

on:
schedule:
# Every day at 1am
Expand Down
124 changes: 107 additions & 17 deletions .github/workflows/release-builds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@ on:
tags:
- "v*"
jobs:
x86_64-linux-gnu:

linux:
runs-on: ubuntu-18.04
env:
BUILD_VERSION: latest # Computed
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2

Expand All @@ -20,6 +22,91 @@ jobs:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu.tar.gz

# Linux build additionally pushes the docker images to docker hub on successful build
- name: Tag dockerhub build
if: ${{ github.repository == 'DeFiCh/ain' }}
run: >
docker tag defichain-x86_64-pc-linux-gnu:${{ env.BUILD_VERSION }}
defichain-x86_64-pc-linux-gnu:dockerhub-latest
- uses: docker/build-push-action@v1
# Make sure to only build on ain repo. Also add in additional restrictions here if needed to
# make sure we don't push unnecessary images to docker
if: ${{ github.repository == 'DeFiCh/ain' }}
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
path: ./contrib/dockerfiles/dockerhub
dockerfile: ./contrib/dockerfiles/dockerhub/x86_64-pc-linux-gnu.dockerfile
repository: defi/defichain
tags: latest,${{ env.BUILD_VERSION }}

windows:
runs-on: ubuntu-18.04
env:
BUILD_VERSION: latest # Computed
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2

- name: Build and package
run: TARGETS="x86_64-w64-mingw32" ./make.sh docker-release-git

- name: Publish artifact - x86_64-w64-mingw32
uses: actions/upload-artifact@v2-preview
with:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.tar.gz

macos:
runs-on: ubuntu-18.04
env:
BUILD_VERSION: latest # Computed
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2

- name: Build and package
run: TARGETS="x86_64-apple-darwin11" ./make.sh docker-release-git

- name: Publish artifact - x86_64-apple-darwin11
uses: actions/upload-artifact@v2-preview
with:
name: defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin11
path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin11.tar.gz

create-release:
needs:
- linux
- windows
- macos
runs-on: ubuntu-18.04
env:
BUILD_VERSION: latest # Computed
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v2

- name: compute build version
run: ./make.sh git-version

- name: cleanup work dir
run: rm -rf *

- name: get all build artifacts
uses: actions/download-artifact@v2

- name: zip package for windows
run: |
set -e
cd defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32
tar xzf defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.tar.gz
zip -r "defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip" \
defichain-${{ env.BUILD_VERSION }}/
- name: Create release
id: create_release
uses: actions/create-release@v1
Expand All @@ -31,29 +118,32 @@ jobs:
draft: false
prerelease: false

- name: Upload release asset
id: upload-release-asset
- name: Upload release asset - linux
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu.tar.gz
asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu/defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu.tar.gz
asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-pc-linux-gnu.tar.gz
asset_content_type: application/gzip

- name: Tag dockerhub build
if: ${{ github.repository == 'DeFiCh/ain' }}
run: >
docker tag defichain-x86_64-pc-linux-gnu:${{ env.BUILD_VERSION }}
defichain-x86_64-pc-linux-gnu:dockerhub-latest
- name: Upload release asset - windows
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32/defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip
asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-w64-mingw32.zip
asset_content_type: application/zip

- uses: docker/build-push-action@v1
if: ${{ github.repository == 'DeFiCh/ain' }}
- name: Upload release asset - macos
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
path: ./contrib/dockerfiles/dockerhub
dockerfile: ./contrib/dockerfiles/dockerhub/x86_64-pc-linux-gnu.dockerfile
repository: defi/defichain
tags: latest,${{ env.BUILD_VERSION }}
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin11/defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin11.tar.gz
asset_name: defichain-${{ env.BUILD_VERSION }}-x86_64-apple-darwin11.tar.gz
asset_content_type: application/gzip
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For more information:
- Visit the [DeFi Blockchain website](https://defichain.io)
- Read our [white paper](https://defichain.io/white-paper/)

Official binaries are available from [GitHub releases](https://github.com/DeFiCh/ain/releases) page.
Official binaries are available from the [GitHub Releases](https://github.com/DeFiCh/ain/releases) page.

### Bitcoin Core

Expand All @@ -32,7 +32,7 @@ DeFi Blockchain has done significant modifications from Bitcoin Core, for instan

Merges from upstream (Bitcoin Core) will be done selectively if it applies to the improved functionality and security of DeFi Blockchain.

## Quick Documentation
## Quick Start

- [Running a node](./doc/setup-nodes.md)
- [Running a node with docker](./doc/setup-nodes-docker.md)
Expand Down
1 change: 0 additions & 1 deletion ci/test/06_script_a.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ END_FOLD

BEGIN_FOLD distdir
DOCKER_EXEC make distdir VERSION=$HOST
DOCKER_EXEC cp -r ../src/spv/bcash ../src/spv/bitcoin ../src/spv/support ../src/spv/Makefile "defi-$HOST/src/spv/"
DOCKER_EXEC cp -r ../share "defi-$HOST/"
DOCKER_EXEC cp -r ../contrib "defi-$HOST/"
END_FOLD
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ define(_CLIENT_VERSION_MINOR, 0)
define(_CLIENT_VERSION_REVISION, 0)
define(_CLIENT_VERSION_BUILD, 0)
define(_CLIENT_VERSION_RC, 0)
define(_CLIENT_VERSION_IS_RELEASE, false)
define(_CLIENT_VERSION_IS_RELEASE, true)
define(_COPYRIGHT_YEAR, 2020)
define(_COPYRIGHT_HOLDERS,[The %s developers])
define(_COPYRIGHT_HOLDERS_SUBSTITUTION,[[DeFi Blockchain]])
Expand Down
11 changes: 9 additions & 2 deletions contrib/dockerfiles/dockerhub/x86_64-pc-linux-gnu.dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,15 @@ WORKDIR /app

COPY --from=dh-build /app/. ./

VOLUME ["/root/.defi"]
RUN useradd --create-home defi && \
mkdir -p /data && \
chown defi:defi /data && \
ln -s /data /home/defi/.defi

EXPOSE 8555 8554 18555 18554 19555 19554
VOLUME ["/data"]

USER defi:defi
CMD [ "/app/bin/defid" ]

EXPOSE 8555 8554 18555 18554 19555 19554

33 changes: 20 additions & 13 deletions doc/setup-nodes-docker.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,27 @@
# defi/defichain

The DeFi Blockchain docker image, currently with support for the following platforms:
## Quick reference

* `amd64` (x86_64)
- **Maintained by**: [DeFi Blockchain Developers](https://github.com/defich/ain)
- **Where to get help**: [GitHub](https://github.com/defich/ain/issues)

The DeFi Blockchain docker image, currently supports the following platforms:

- `amd64` (x86_64)

<!-- [![defi/defichain][docker-pulls-image]][docker-hub-url] [![defi/defichain][docker-stars-image]][docker-hub-url] -->

## What is DeFi Blockchain?

DeFi Blockchains primary vision is to enable decentralized finance with Bitcoin-grade security, strength and immutability. It's a blockchain dedicated to fast, intelligent and transparent financial services, accessible by everyone.
DeFi Blockchain's primary vision is to enable decentralized finance with Bitcoin-grade security, strength and immutability. It's a blockchain dedicated to fast, intelligent and transparent financial services, accessible by everyone.

Read more at: https://defichain.io

## Tags
## Supported tags and respective Dockerfile links

- `latest` ([Dockerfile](https://raw.githubusercontent.com/DeFiCh/ain/master/contrib/dockerfiles/dockerhub/x86_64-pc-linux-gnu.dockerfile))
- `1.0.0-beta4`
- `latest` ([Dockerfile](https://github.com/DeFiCh/ain/blob/master/contrib/dockerfiles/dockerhub/x86_64-pc-linux-gnu.dockerfile))
- `1.0.0-rc1` ([Dockerfile](https://github.com/DeFiCh/ain/blob/v1.0.0-rc1/contrib/dockerfiles/dockerhub/x86_64-pc-linux-gnu.dockerfile))
- `1.0.0-beta4` ([Dockerfile](https://github.com/DeFiCh/ain/blob/v1.0.0-beta4/contrib/dockerfiles/dockerhub/x86_64-pc-linux-gnu.dockerfile))

**Picking the right tag**

Expand All @@ -38,15 +44,16 @@ Read more at: https://defichain.io
❯ docker run -it defi/defichain
```

### How to use this image
### Image details

- This image contains the main distribution package as downloaded, with the main binaries - `defid`, `defi-cli` and `defi-tx`.
- The package is at `/app`.
- All the binaries from the package are also in the `PATH` for convenience.
- Data volume is at `/root/.defi`. Feel free to mount a host dir there for further convenience.
- Default conf, if found is picked up from `/root/.defi/defi.conf`
- Process run unprivileged inside the container as user `defi` and group `defi`
- Data volume is at `/data`, (The default data dir `/home/defi/.defi` is symlinked to it). `/data` is used for convenience to change volumes with docker. (For instance `docker run -it -v "defi-data:/data" defi/defichain`)
- Default conf, if found is picked up from `/data/defi.conf`
- Use `docker logs` for default logging from stdout
- For custom commands, just use `defid`/`defi-cli` similar to how `bitcoind`/`bitcoin-cli` works.
- For custom commands, just use `defid`/`defi-cli` similar to how `bitcoind`/`bitcoin-cli` works.

#### Default ports

Expand All @@ -69,10 +76,10 @@ Example:

_Note: More about how `-rpcauth` works for remote authentication are explained below._

You can also mount a directory in a volume under `/root/.defi` in case you want to access it on the host:
You can also mount a directory in a volume under `/data` in case you want to access it on the host:

```sh
❯ docker run -v ${PWD}/data:/root/.defi -it --rm defi/defichain \
❯ docker run -v ${PWD}/data-dir:/data -it --rm defi/defichain \
defid \
-printtoconsole \
-regtest=1
Expand Down Expand Up @@ -126,7 +133,7 @@ Then, inside the running `defi-node` container, locally execute the query to the
}
```

In the background, `defi-cli` read the information automatically from `/root/.defi/regtest/.cookie`. In production, the path would not contain the regtest part.
In the background, `defi-cli` read the information automatically from `/data/regtest/.cookie`. In production, the path would not contain the regtest part.

#### Using rpcauth for remote authentication

Expand Down
Loading

0 comments on commit d847cd8

Please sign in to comment.