Skip to content

Commit

Permalink
Merge pull request #1949 from hirosystems/develop
Browse files Browse the repository at this point in the history
Merge develop into beta
  • Loading branch information
zone117x authored Apr 16, 2024
2 parents db9ad23 + fc2ac03 commit 37ca891
Show file tree
Hide file tree
Showing 15 changed files with 1,228 additions and 4,926 deletions.
37 changes: 4 additions & 33 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -851,13 +851,6 @@ jobs:

build-publish:
runs-on: ubuntu-latest
needs:
- lint
- lint-docs
- test
- test-bns
- test-rosetta
- test-rosetta-cli-construction
steps:
- uses: actions/checkout@v3
with:
Expand Down Expand Up @@ -886,6 +879,9 @@ jobs:
@semantic-release/exec@6.0.3
conventional-changelog-conventionalcommits@6.1.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -903,20 +899,6 @@ jobs:
type=semver,pattern={{major}}.{{minor}},value=${{ steps.semantic.outputs.new_release_version }},enable=${{ steps.semantic.outputs.new_release_version != '' }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Docker Standalone Meta
id: meta_standalone
uses: docker/metadata-action@v5
with:
images: |
blockstack/${{ github.event.repository.name }}-standalone
hirosystems/${{ github.event.repository.name }}-standalone
tags: |
type=ref,event=branch
type=ref,event=pr
type=semver,pattern={{version}},value=${{ steps.semantic.outputs.new_release_version }},enable=${{ steps.semantic.outputs.new_release_version != '' }}
type=semver,pattern={{major}}.{{minor}},value=${{ steps.semantic.outputs.new_release_version }},enable=${{ steps.semantic.outputs.new_release_version != '' }}
type=raw,value=latest,enable={{is_default_branch}}
- name: Login to DockerHub
uses: docker/login-action@v3
with:
Expand All @@ -927,23 +909,12 @@ jobs:
uses: docker/build-push-action@v5
with:
context: .
platforms: ${{ (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/beta') && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# Only push if (there's a new release on main branch, or if building a non-main branch) and (Only run on non-PR events or only PRs that aren't from forks)
push: ${{ (github.ref != 'refs/heads/master' || steps.semantic.outputs.new_release_version != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}

- name: Build/Tag/Push Standalone Image
uses: docker/build-push-action@v5
with:
context: .
build-args: |
STACKS_API_VERSION=${{ github.head_ref || github.ref_name }}
file: docker/rosetta.Dockerfile
tags: ${{ steps.meta_standalone.outputs.tags }}
labels: ${{ steps.meta_standalone.outputs.labels }}
# Only push if (there's a new release on main branch, or if building a non-main branch) and (Only run on non-PR events or only PRs that aren't from forks)
push: ${{ (github.ref != 'refs/heads/master' || steps.semantic.outputs.new_release_version != '') && (github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository) }}

- name: API Discord notification
if: steps.semantic.outputs.new_release_version != ''
uses: Ilshidur/action-discord@master
Expand Down
32 changes: 13 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,44 +7,38 @@

## Quick start

A self-contained Docker image is provided, which starts a Stacks 2.05 blockchain and API instance.
### Local

Ensure Docker is installed, then run the command:
This service requires `postgres`, `stacks-node`, `bitcoind`, and a few other components in order to run.
The [`clarinet`](https://github.com/hirosystems/clarinet) project provides an easy way to spin up the API and all these services:
> clarinet devnet - a local standalone development environment that simulates Bitcoin, Stacks node and other helpful components, similar to a staging environment.
```shell
docker run -p 3999:3999 hirosystems/stacks-blockchain-api-standalone
```
Get started at https://docs.hiro.so/clarinet/getting-started

Similarly, a "mocknet" instance can be started. This runs a local node, isolated from the testnet/mainnet:
### Production

```shell
docker run -p 3999:3999 -e STACKS_NETWORK=mocknet hirosystems/stacks-blockchain-api-standalone
```
The docker image `hirosystems/stacks-blockchain-api` is recommended when running the API in a mainnet or testnet environment.

Note that this image cannot be ran standalone. Other services need to be configured correctly and running. For more information see https://docs.hiro.so/stacks-blockchain-api/how-to-guides/how-to-run-api-node

Once the blockchain has synced with the network, the API will be available at:
[http://localhost:3999](http://localhost:3999)

## Development quick start

First, ensure Docker is installed on your machine.

Clone repo and install dependencies with `npm install`.

Run `npm run dev:integrated`.
VSCode is recommended for development. Pre-configured "run and debug" configurations are included. Run using `Launch: w/ postgres`.

This command will concurrently start the API server app and the service dependencies.
Alternatively, use the command `npm run dev:integrated` -- this command will concurrently start the API server app and the service dependencies.

Check to see if the server started successfully by visiting http://localhost:3999/extended/v1/status

## Local Development

### Setup Services

Then run `npm run devenv:deploy`, which uses docker-compose to deploy the service dependencies (e.g., PostgreSQL, Stacks core node, etc.)

### Running the server
To run the server, run `npm run dev:integrated`, which uses docker-compose to deploy the service dependencies (e.g., PostgreSQL, Stacks core node, etc.).

To run the server in 'watch' mode (restart for every code change), run `npm run dev:watch`. You'll have a server on port 3999.
You'll have a server on port 3999.

# Architecture

Expand Down
7 changes: 0 additions & 7 deletions config/token-metadata-image-cache-imgix.js

This file was deleted.

Loading

0 comments on commit 37ca891

Please sign in to comment.