From e623b85027ea678aabe028d0776bbce361b304f5 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Fri, 18 Sep 2020 17:39:40 -0700 Subject: [PATCH] Update README to use docker package on github --- Makefile | 6 ++++++ README.md | 38 ++++++++++++++++++++++++++++++++------ 2 files changed, 38 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index c0a20a7..533ba14 100644 --- a/Makefile +++ b/Makefile @@ -25,6 +25,12 @@ build: build-local: docker build -t rosetta-bitcoin:latest . +build-release: + # https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages + docker build -t rosetta-bitcoin:$(version) .; + docker tag rosetta-bitcoin:$(version) docker.pkg.github.com/coinbase/rosetta-bitcoin/rosetta-bitcoin:$(version); + docker push docker.pkg.github.com/coinbase/rosetta-bitcoin/rosetta-bitcoin:$(version); + run-mainnet-online: docker run -d --ulimit "nofile=${NOFILE}:${NOFILE}" -v "${PWD}/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 8333:8333 rosetta-bitcoin:latest diff --git a/README.md b/README.md index 3c0762b..df62232 100644 --- a/README.md +++ b/README.md @@ -34,16 +34,42 @@ As specified in the [Rosetta API Principles](https://www.rosetta-api.org/docs/au all Rosetta implementations must be deployable via Docker and support running via either an [`online` or `offline` mode](https://www.rosetta-api.org/docs/node_deployment.html#multiple-modes). -To build a Docker image from this repository, run the command `make build`. To start -`rosetta-bitcoin`, you can run: -* `make run-mainnet-online` -* `make run-mainnet-offline` -* `make run-testnet-online` -* `make run testnet-offline` +### Install +#### Pre-Built +You can download a pre-built Docker image from GitHub: +```text +docker pull docker.pkg.github.com/coinbase/rosetta-bitcoin/rosetta-bitcoin:v0.0.1 +``` +#### From Source +You can clone this repository and run the following command: +```text +docker build -t rosetta-bitcoin:v0.0.1 +``` +### Run By default, running these commands will create a data directory at `/bitcoin-data` and start the `rosetta-bitcoin` server at port `8080`. +#### Mainnet:Online +```text +docker run -d --ulimit "nofile=100000:100000" -v "$(shell pwd)/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 8333:8333 rosetta-bitcoin:v0.0.1 +``` + +#### Mainnet:Offline +```text +docker run -d -e "MODE=OFFLINE" -e "NETWORK=MAINNET" -e "PORT=8081" -p 8081:8081 rosetta-bitcoin:v0.0.1 +``` + +#### Testnet:Online +```text +docker run -d --ulimit "nofile=100000:100000" -v "$(shell pwd)/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 18333:18333 rosetta-bitcoin:v0.0.1 +``` + +#### Testnet:Offline +```text +docker run -d -e "MODE=OFFLINE" -e "NETWORK=TESTNET" -e "PORT=8081" -p 8081:8081 rosetta-bitcoin:v0.0.1 +``` + ## System Requirements `rosetta-bitcoin` has been tested on an [AWS c5.2xlarge instance](https://aws.amazon.com/ec2/instance-types/c5). This instance type has 8 vCPU and 16 GB of RAM. If you use a computer with less than 16 GB of RAM,