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

Renew dev #27

Open
wants to merge 13 commits into
base: dev
Choose a base branch
from
Open
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
71 changes: 71 additions & 0 deletions .github/workflows/analyze.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
name: "Analyze"

on:
push:
branches: [ $default-branch, $protected-branches ]
pull_request:
# The branches below must be a subset of the branches above
branches: [$default-branch]
schedule:
- cron: '0 4 * * 1'

jobs:
analyze:
name: Analyze
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
# Override automatic language detection
language: ['python']
# CodeQL supports [ $supported-codeql-languages ]
# Learn more:
# https://docs.github.com/en/free-pro-team@latest/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#changing-the-languages-that-are-analyzed

steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
# We must fetch at least the immediate parents so that if this is
# a pull request then we can checkout the head.
fetch-depth: 2

# If this run was triggered by a pull request event, then checkout
# the head of the pull request instead of the merge commit.
- run: git checkout HEAD^2
if: ${{ github.event_name == 'pull_request' }}

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v1
with:
languages: ${{ matrix.language }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# queries: ./path/to/local/query, your-org/your-repo/queries@main

# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
# If this step fails, then you should remove it and run the build manually (see below)
- name: Autobuild
uses: github/codeql-action/autobuild@v1

# ℹ️ Command-line programs to run using the OS shell.
# 📚 https://git.io/JvXDl

# ✏️ If the Autobuild fails above, remove it and uncomment the following three lines
# and modify them (or add more) to build your code if your project
# uses a compiled language

#- run: |
# make bootstrap
# make release

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v1
35 changes: 35 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: "Docker Build & Test"

on:
pull_request:
types:
- opened
- synchronize

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false
ref: ${{ github.event.pull_request.head.sha }}

# In this step, this action saves a list of existing images,
# the cache is created without them in the post run.
# It also restores the cache if it exists.
- uses: satackey/[email protected]
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

- name: Build docker image
run: docker build -t bitcoin-vault-electrumx-ci .

# Disable tests
# - name: pytest
# run: docker run --rm -w /source -e LOCAL_USER_ID=`id -u` -v "$(PWD):/source" bitcoin-vault-electrumx-ci pytest --cov=electrumx

- name: pycodestyle
run: docker run --rm -w /source -e LOCAL_USER_ID=`id -u` -v "$(PWD):/source" bitcoin-vault-electrumx-ci flake8 --exit-zero --max-line-length 100 --filename "./electrumx/**/*.py,./electrumx/*.py"
18 changes: 18 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: "Lint Pull Request"

on:
pull_request_target:
types:
- opened
- edited
- synchronize

jobs:
main:
runs-on: ubuntu-latest
steps:
- uses: amannn/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
requireScope: false
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: "Release"

on:
push:
branches:
- dev

env:
ECR_REPOSITORY: electrumx
IMAGE_TAG: ${{ github.sha }}
BUILD_NAME: bitcoin-vault-electrumx-build-${{ github.run_id }}

jobs:
release:
name: release
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
persist-credentials: false

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.CI_DEPLOYER_AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.CI_DEPLOYER_AWS_SECRET_ACCESS_KEY }}
aws-region: eu-west-1
role-to-assume: ${{ secrets.CI_DEPLOYER_AWS_ROLE_TO_ASSUME }}

- name: Login to Amazon ECR
id: login-ecr
uses: aws-actions/amazon-ecr-login@v1

- uses: satackey/[email protected]
# Ignore the failure of a step and avoid terminating the job.
continue-on-error: true

- name: Python Semantic Release
uses: relekang/python-semantic-release@dev
with:
github_token: ${{ secrets.TS_GH_TOKEN }}
pypi_token: false

- name: Pull docker docker image (for layers that we dont have)
continue-on-error: true
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: docker pull $ECR_REGISTRY/$ECR_REPOSITORY:latest

- name: Builder image
run: docker build -t $BUILD_NAME .

- name: Tag, and push image to Amazon ECR
env:
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }}
run: |
docker tag $BUILD_NAME $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker tag $BUILD_NAME $ECR_REGISTRY/$ECR_REPOSITORY:latest
docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Changelog

<!--next-version-placeholder-->

## v2.1.0 (2021-08-18)
### Feature
* Getbalance support single or multi entrance as comma separated list ([#24](https://github.com/bitcoinvault/electrumx/issues/24)) ([`045a0a5`](https://github.com/bitcoinvault/electrumx/commit/045a0a5de1aa55be1c4aa845580b5a3f706762c6))

## v2.0.2 (2021-03-03)
### Fix
* **tx:** Handle empty witness list ([#22](https://github.com/bitcoinvault/electrumx/issues/22)) ([`d1b5126`](https://github.com/bitcoinvault/electrumx/commit/d1b5126edb7d453598189bd5cb03c690be13f57f))

## v2.0.1 (2021-02-26)
### Fix
* **ci:** Set proper secret name ([`dbd63c4`](https://github.com/bitcoinvault/electrumx/commit/dbd63c4df80b1968c8240540012a0581acc6d208))
* **ci:** Use proper token go generate GitHub release ([`390e3b4`](https://github.com/bitcoinvault/electrumx/commit/390e3b4907cbb03a1ca7391f2affb0131e8af741))
54 changes: 54 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
FROM python:3.7-alpine3.11

WORKDIR /source

RUN apk add --no-cache \
git \
build-base \
openssl \
libressl-dev \
libffi-dev \
gcc && \
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/v3.11/main leveldb-dev && \
apk add --no-cache --repository http://dl-cdn.alpinelinux.org/alpine/edge/testing rocksdb-dev && \
pip install \
aiohttp \
pylru \
plyvel \
websockets \
leveldb \
python-rocksdb \
pytest-asyncio \
pytest-cov \
pycodestyle \
coveralls \
flake8 \
&& mkdir /db

RUN ulimit -n 1048576

VOLUME /db

ENV ALLOW_ROOT 1
ENV DB_DIRECTORY /db
ENV DAEMON_URL "http://username:password@hostname:port/"
ENV COIN BitcoinVault
ENV NET mainnet
ENV DB_ENGINE leveldb
ENV HOST ""
ENV SSL_CERTFILE ""
ENV SSL_KEYFILE ""
ENV SERVICES "ssl://:50002,tcp://:50001"
ENV COST_HARD_LIMIT 500000
ENV COST_LIMIT_SOFT 100000
ENV INITIAL_CONCURRENT 500
ENV BANDWIDTH_UNIT_COST 100000
ENV MAX_SEND 10000000
ENV CACHE_MB 2000
ENV MAX_SESSIONS 999999

COPY . .

RUN python3 setup.py install

CMD ["/usr/local/bin/electrumx_server"]
51 changes: 51 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
ElectrumX
=========

A reimplementation of Electrum-Server for a future with bigger blocks.

The current version is 2.0.

Source Code
===========

The project is hosted on [GitHub](https://github.com/bitcoinvault/electrumx).

Please submit an issue on the [bug tracker](https://github.com/bitcoinvault/electrumx/issues)
if you have found a bug or have a suggestion to improve the server.

Authors and License
===================

Neil Booth wrote the vast majority of the code; see [Authors](docs/authors.md).

Bitcoin Vault development team adjusted the code to BTCV coin.

Python version at least 3.6 is required.

The code is released under the [MIT Licence](https://github.com/bitcoinvault/electrumx/LICENCE)

Getting Started
===============

See [HOWTO](docs/HOWTO.md).

There is also an `installer` available that simplifies the
installation on various Linux-based distributions, and a `Dockerfile`
available .

Documentation
=============

+ [Features](docs/features.md)
+ [Changelog](docs/changelog.md)
+ [HOWTO](docs/HOWTO.md)
+ [Environment](docs/environment.md)
+ Protocol
+ [Protocol Basics](docs/protocol-basics.md)
+ [Protocol Changes](docs/protocol-changes.md)
+ [Protocol Methods](docs/protocol-methods.md)
+ [Protocol Removals](docs/protocol-removed.md)
+ [Peer Discovery](docs/peer_discovery.md)
+ [RPC Interface](docs/rpc-interface.md)
+ [Architecture](docs/architecture.md)
+ [Authors](docs/authors.md)
18 changes: 0 additions & 18 deletions README.rst

This file was deleted.

1 change: 0 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ version: '3.5'
services:

bitcoind:
image: nexus-01.minebest.local:5001/bitcoind
build:
context: ./docker
dockerfile: bitcoind.Dockerfile
Expand Down
6 changes: 3 additions & 3 deletions docker/bitcoind.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ RUN add-apt-repository ppa:bitcoin/bitcoin
RUN apt-get update && apt-get -y install libdb4.8-dev libdb4.8++-dev

WORKDIR /source
RUN curl -L -k -f https://github.com/bitcoinvault/bitcoinvault/archive/dev.zip -o dev.zip
RUN unzip dev.zip
RUN rm dev.zip
RUN curl -L -k -f https://github.com/bitcoinvault/bitcoinvault/archive/dev.zip -o bitcoinvault.zip
RUN unzip bitcoinvault.zip
RUN rm bitcoinvault.zip
WORKDIR /source/bitcoinvault-dev
RUN env CFLAGS=-O2 CXXFLAGS=-O2 \
./autogen.sh
Expand Down
Loading