-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
109 additions
and
97 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
FROM golang:1.21-bookworm as builder | ||
|
||
ARG IGNITE_VERSION="28.1.0" | ||
|
||
# Ignite CLI prompts users for tracking info which hangs the tty | ||
# See https://github.com/ignite/cli/blob/main/ignite/internal/analytics/analytics.go#L71 | ||
ENV DO_NOT_TRACK=1 | ||
|
||
# Setup env and dev tools | ||
RUN apt update &&\ | ||
apt-get install --yes git make curl jq &&\ | ||
mkdir /env &&\ | ||
cd /env &&\ | ||
curl -L https://github.com/ignite/cli/releases/download/v${IGNITE_VERSION}/ignite_${IGNITE_VERSION}_linux_amd64.tar.gz > ignite.tar.gz &&\ | ||
tar xvf ignite.tar.gz &&\ | ||
mv ignite /usr/local/bin/ignite &&\ | ||
cd / && rm -rf /env | ||
WORKDIR /app | ||
|
||
# Cache deps | ||
COPY go.* /app | ||
COPY ./submodules /app/submodules | ||
RUN go mod download | ||
|
||
# Build | ||
COPY . /app | ||
ENV GOFLAGS='-buildvcs=false' | ||
RUN --mount=type=cache,target=/root/.cache ignite chain build && ignite chain init | ||
|
||
# Dev image entrypoint | ||
ENTRYPOINT ["scripts/dev-entrypoint.sh"] | ||
CMD ["start"] | ||
|
||
|
||
# Deployment entrypoint | ||
FROM debian:bookworm-slim | ||
|
||
RUN useradd -ms /bin/bash tendermint | ||
USER operator | ||
|
||
COPY --from=builder /root/go/bin/sourcehubd /usr/local/bin/sourcehubd | ||
|
||
EXPOSE 8080 | ||
|
||
ENTRYPOINT ["sourcehubd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
IGNITE_RUN = docker run --rm -ti --volume $(PWD):/apps ignitehq/cli:latest | ||
UID := $(shell id --user) | ||
GID := $(shell id --group) | ||
BIN = sourcehubd | ||
DEMO_SRC = cmd/token-protocol-demo/main.go | ||
DEMO_BIN = build/token-protocol-demo | ||
|
||
.PHONY: build | ||
build: | ||
ignite chain build | ||
|
||
.PHONY: proto | ||
proto: | ||
ignite generate proto-go | ||
|
||
.PHONY: test | ||
test: | ||
go test ./... | ||
|
||
.PHONY: simulate | ||
simulate: | ||
ignite chain simulate | ||
|
||
|
||
.PHONY: fmt | ||
fmt: | ||
gofmt -w . | ||
|
||
.PHONY: run | ||
run: | ||
${BIN} start |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
version: 1 | ||
accounts: | ||
- name: alice | ||
- name: validator | ||
coins: | ||
- 20000token | ||
- 200000000stake | ||
- name: bob | ||
- 200000000stake | ||
- name: faucet | ||
coins: | ||
- 10000token | ||
- 100000000stake | ||
- 200000000stake | ||
client: | ||
openapi: | ||
path: docs/static/openapi.yml | ||
faucet: | ||
name: bob | ||
name: faucet | ||
coins: | ||
- 5token | ||
- 100000stake | ||
- 100000stake | ||
|
||
validators: | ||
- name: alice | ||
bonded: 100000000stake | ||
- name: validator | ||
bonded: 200000000stake |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
version: '3.8' | ||
|
||
services: | ||
sourcehub: | ||
build: | ||
target: builder | ||
ports: | ||
- 9090 | ||
volumes: | ||
- .:/app |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,51 +1,18 @@ | ||
# sourcehub | ||
**sourcehub** is a blockchain built using Cosmos SDK and Tendermint and created with [Ignite CLI](https://ignite.com/cli). | ||
# SourceHub | ||
|
||
## Get started | ||
Source's Trust Layer | ||
|
||
``` | ||
ignite chain serve | ||
``` | ||
|
||
`serve` command installs dependencies, builds, initializes, and starts your blockchain in development. | ||
|
||
### Configure | ||
|
||
Your blockchain in development can be configured with `config.yml`. To learn more, see the [Ignite CLI docs](https://docs.ignite.com). | ||
|
||
### Web Frontend | ||
|
||
Additionally, Ignite CLI offers both Vue and React options for frontend scaffolding: | ||
|
||
For a Vue frontend, use: `ignite scaffold vue` | ||
For a React frontend, use: `ignite scaffold react` | ||
These commands can be run within your scaffolded blockchain project. | ||
|
||
## Development | ||
|
||
For more information see the [monorepo for Ignite front-end development](https://github.com/ignite/web). | ||
|
||
## Release | ||
To release a new version of your blockchain, create and push a new tag with `v` prefix. A new draft release with the configured targets will be created. | ||
To run locally run: | ||
|
||
``` | ||
git tag v0.1 | ||
git push origin v0.1 | ||
docker-compose up | ||
``` | ||
|
||
After a draft release is created, make your final changes from the release page and publish it. | ||
|
||
### Install | ||
To install the latest version of your blockchain node's binary, execute the following command on your machine: | ||
|
||
``` | ||
curl https://get.ignite.com/sourcenetwork/sourcehub@latest! | sudo bash | ||
``` | ||
`sourcenetwork/sourcehub` should match the `username` and `repo_name` of the Github repository to which the source code was pushed. Learn more about [the install process](https://github.com/allinbits/starport-installer). | ||
|
||
## Learn more | ||
|
||
Docs: | ||
- [Ignite CLI](https://ignite.com/cli) | ||
- [Tutorials](https://docs.ignite.com/guide) | ||
- [Ignite CLI docs](https://docs.ignite.com) | ||
- [Cosmos SDK docs](https://docs.cosmos.network) | ||
- [Developer Chat](https://discord.gg/ignite) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/bash | ||
|
||
ignite chain build --skip-proto | ||
exec sourcehubd $@ |
Empty file.