Skip to content

Commit

Permalink
feat(repo): Added api service initial skeleton (#405)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xterminator authored Feb 17, 2025
1 parent efd339c commit 5f37242
Show file tree
Hide file tree
Showing 26 changed files with 2,047 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
@@ -1 +1 @@
* @luizstacio @pedronauck @jurshsmith @0xterminator @cue8it
* @luizstacio @pedronauck @0xterminator @cue8it @rodrigobranas
30 changes: 30 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,29 @@ run-webserver-testnet-dev:
run-webserver-testnet-profiling:
$(MAKE) run-webserver NETWORK=testnet MODE=profiling

# ------------------------------------------------------------
# Api Run Commands
# ------------------------------------------------------------

run-api: NETWORK="testnet"
run-api: MODE="dev"
run-api: PORT="9004"
run-api: EXTRA_ARGS=""
run-api: check-network
@./scripts/run_api.sh --mode $(MODE) --port $(PORT) --extra-args $(EXTRA_ARGS)

run-api-mainnet-dev:
$(MAKE) run-api NETWORK=mainnet MODE=dev

run-api-mainnet-profiling:
$(MAKE) run-api NETWORK=mainnet MODE=profiling

run-api-testnet-dev:
$(MAKE) run-api NETWORK=testnet MODE=dev

run-api-testnet-profiling:
$(MAKE) run-api NETWORK=testnet MODE=profiling

# ------------------------------------------------------------
# Docker Compose
# ------------------------------------------------------------
Expand Down
30 changes: 30 additions & 0 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,29 @@ custom_build(
ignore=['./target']
)

# api server
custom_build(
ref='sv-api:latest',
image_deps=['sv-consumer:latest', 'sv-publisher:latest'],
command=[
'./cluster/scripts/build_docker.sh',
'--dockerfile', './cluster/docker/sv-api.Dockerfile'
],
deps=[
'./src',
'./Cargo.toml',
'./Cargo.lock',
'./cluster/docker/sv-api.Dockerfile'
],
live_update=[
sync('./src', '/usr/src'),
sync('./Cargo.toml', '/usr/src/Cargo.toml'),
sync('./Cargo.lock', '/usr/src/Cargo.lock'),
run('cargo build', trigger=['./src', './Cargo.toml', './Cargo.lock'])
],
ignore=['./target']
)

# Deploy the Helm chart with values from .env
# Get deployment mode from environment variable, default to 'full'
config_mode = os.getenv('CLUSTER_MODE', 'full')
Expand Down Expand Up @@ -107,6 +130,13 @@ RESOURCES = {
'config_mode': ['minimal', 'full'],
'deps': ['fuel-streams-nats']
},
'sv-api': {
'name': 'fuel-streams-sv-api',
'ports': ['9004:9004'],
'labels': 'api',
'config_mode': ['minimal', 'full'],
'deps': ['fuel-streams-sv-publisher', 'fuel-streams-sv-consumer']
},
'nats': {
'name': 'fuel-streams-nats',
'ports': ['4222:4222', '6222:6222', '7422:7422'],
Expand Down
Loading

0 comments on commit 5f37242

Please sign in to comment.