From 0f2493158be500986f47aa66a1d499bc87e98fa9 Mon Sep 17 00:00:00 2001 From: Patrick O'Grady Date: Mon, 21 Sep 2020 21:21:02 -0700 Subject: [PATCH] Update README --- Makefile | 5 ----- README.md | 31 +++++++++++++++++++------------ install.sh | 3 ++- 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/Makefile b/Makefile index e9564cd..e2a812d 100644 --- a/Makefile +++ b/Makefile @@ -30,11 +30,6 @@ build-release: docker build -t rosetta-bitcoin:$(version) .; docker save rosetta-bitcoin:$(version) | gzip > rosetta-bitcoin-$(version).tar.gz; -pull-remote: - curl -L https://github.com/coinbase/rosetta-bitcoin/releases/latest/download/rosetta-bitcoin.tar.gz -o rosetta-bitcoin.tar.gz; - docker load --input rosetta-bitcoin.tar.gz; - rm rosetta-bitcoin.tar.gz; - 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 f8cf802..3593dda 100644 --- a/README.md +++ b/README.md @@ -34,47 +34,54 @@ 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). +**YOU MUST INSTALL DOCKER FOR THE FOLLOWING INSTRUCTIONS TO WORK. YOU CAN DOWNLOAD +DOCKER [HERE](https://www.docker.com/get-started).** + ### Install -#### Pre-Built -You can download a pre-built Docker image from GitHub: -TODO: cast version as latest somehow? -TODO: get latest from release info and then can do automatically? Could do another script... +Running the following commands will create a Docker image called `rosetta-bitcoin:latest`. + +#### From GitHub +To download the pre-built Docker image from the latest release, run: ```text -curl -L https://github.com/coinbase/rosetta-bitcoin/releases/latest/download/rosetta-bitcoin.tar.gz -o rosetta-bitcoin.tar.gz; -docker load --input rosetta-bitcoin.tar.gz; -rm rosetta-bitcoin.tar.gz; +curl -sSfL https://raw.githubusercontent.com/coinbase/rosetta-bitcoin/master/install.sh | sh -s ``` -_This will print the image tag out that must be used for running in later steps._ +_Do not try to install rosetta-bitcoin using GitHub Packages!_ #### From Source -You can clone this repository and run the following command: +After cloning this repository, run: ```text -docker build -t rosetta-bitcoin:latest +make build-local ``` ### Run -By default, running these commands will create a data directory at `/bitcoin-data` -and start the `rosetta-bitcoin` server at port `8080`. +Running the following commands will start a Docker container in +[detached mode](https://docs.docker.com/engine/reference/run/#detached--d) with +a data directory at `/bitcoin-data` and the Rosetta API accessible +at port `8080`. #### Mainnet:Online ```text docker run -d --ulimit "nofile=100000:100000" -v "$(pwd)/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=MAINNET" -e "PORT=8080" -p 8080:8080 -p 8333:8333 rosetta-bitcoin:latest ``` +_If you cloned the repository, you can run `make run-mainnet-online`._ #### Mainnet:Offline ```text docker run -d -e "MODE=OFFLINE" -e "NETWORK=MAINNET" -e "PORT=8081" -p 8081:8081 rosetta-bitcoin:latest ``` +_If you cloned the repository, you can run `make run-mainnet-offline`._ #### Testnet:Online ```text docker run -d --ulimit "nofile=100000:100000" -v "$(pwd)/bitcoin-data:/data" -e "MODE=ONLINE" -e "NETWORK=TESTNET" -e "PORT=8080" -p 8080:8080 -p 18333:18333 rosetta-bitcoin:latest ``` +_If you cloned the repository, you can run `make run-testnet-online`._ #### Testnet:Offline ```text docker run -d -e "MODE=OFFLINE" -e "NETWORK=TESTNET" -e "PORT=8081" -p 8081:8081 rosetta-bitcoin:latest ``` +_If you cloned the repository, you can run `make run-testnet-offline`._ ## System Requirements `rosetta-bitcoin` has been tested on an [AWS c5.2xlarge instance](https://aws.amazon.com/ec2/instance-types/c5). diff --git a/install.sh b/install.sh index c954d21..5f9b4b3 100755 --- a/install.sh +++ b/install.sh @@ -45,8 +45,9 @@ execute() { http_download "${tmpdir}/${TARBALL}" "${TARBALL_URL}" "" "1" docker load --input "${tmpdir}/${TARBALL}" docker tag "rosetta-bitcoin:${TAG}" "rosetta-bitcoin:latest" - log_info "installed rosetta-bitcoin:${TAG} and tagged as rosetta-bitcoin:latest" + log_info "loaded rosetta-bitcoin:${TAG} and tagged as rosetta-bitcoin:latest" rm -rf "${tmpdir}" + log_info "removed temporary directory ${tmpdir}" } github_tag() { log_info "checking GitHub for latest tag"