Update README to use docker package on github

This commit is contained in:
Patrick O'Grady 2020-09-18 17:39:40 -07:00
parent ba9d9ce367
commit e623b85027
No known key found for this signature in database
GPG key ID: 8DE11C985C0C8D85
2 changed files with 38 additions and 6 deletions

View file

@ -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

View file

@ -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 `<working directory>/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,