Skip to content

Commit

Permalink
Merge pull request #2460 from get10101/feat/add-code-to-brag
Browse files Browse the repository at this point in the history
feat: add referral code into brag the bag meme img
  • Loading branch information
bonomat authored Apr 23, 2024
2 parents f3a221d + c6281a3 commit d0aff5e
Show file tree
Hide file tree
Showing 23 changed files with 202 additions and 124 deletions.
1 change: 1 addition & 0 deletions .env.sample
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ COORDINATOR_PORT_HTTP=80
NETWORK=regtest
ORACLE_ENDPOINT=http://34.32.62.120:8081
ORACLE_PUBKEY=5d12d79f575b8d99523797c46441c0549eb0defb6195fe8a080000cbe3ab3859
MEME_ENDPOINT=http://api.10101.finance/memes/

# Fastlane android variables
ANDROID_SERVICE_ACCOUNT_KEY=/path/to/android-service-key.json
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/android-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ on:
required: true
description: "The public key of the oracle. Must match with the public key returned at http://${oracle_endpoint}/oracle/publickey"
type: string
meme_endpoint:
required: true
description: "The url where our memes are being hosted"
type: string
workflow_dispatch:
inputs:
coordinator_port_http:
Expand Down Expand Up @@ -57,6 +61,10 @@ on:
required: true
description: "The public key of the oracle. Must match with the public key returned at http://${oracle_endpoint}/oracle/publickey"
type: string
meme_endpoint:
required: true
description: "The url where our memes are being hosted"
type: string

jobs:
build:
Expand Down Expand Up @@ -154,6 +162,7 @@ jobs:
COORDINATOR_PORT_HTTP: ${{ inputs.coordinator_port_http }}
ORACLE_ENDPOINT: ${{ inputs.oracle_endpoint }}
ORACLE_PUBKEY: ${{ inputs.oracle_pubkey }}
MEME_ENDPOINT: ${{ inputs.meme_endpoint }}

- name: Build Android APK for each platform
run: |
Expand All @@ -165,6 +174,7 @@ jobs:
COORDINATOR_PORT_HTTP: ${{ inputs.coordinator_port_http }}
ORACLE_ENDPOINT: ${{ inputs.oracle_endpoint }}
ORACLE_PUBKEY: ${{ inputs.oracle_pubkey }}
MEME_ENDPOINT: ${{ inputs.meme_endpoint }}

- name: Build Android APK fat bundle
run: |
Expand All @@ -176,6 +186,7 @@ jobs:
COORDINATOR_PORT_HTTP: ${{ inputs.coordinator_port_http }}
ORACLE_ENDPOINT: ${{ inputs.oracle_endpoint }}
ORACLE_PUBKEY: ${{ inputs.oracle_pubkey }}
MEME_ENDPOINT: ${{ inputs.meme_endpoint }}

- name: Attach android apks to release
uses: softprops/action-gh-release@v1
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/build-release-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ jobs:
fastlane_developer_app_identifier: finance.get10101.app
fastlane_provisioning_profile_specifier: match AppStore finance.get10101.app 1692208014
app_scheme: Runner
meme_endpoint: http://api.10101.finance/memes/

build_and_release_mainnet_android_app_for_latest_main:
permissions:
Expand All @@ -55,3 +56,4 @@ jobs:
network: mainnet
oracle_endpoint: http://oracle.10101.finance
oracle_pubkey: 93051f54feefdb4765492a85139c436d4857e2e331a360c89a16d6bc02ba9cd0
meme_endpoint: http://api.10101.finance/memes/
2 changes: 2 additions & 0 deletions .github/workflows/deliverables-push-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ jobs:
fastlane_developer_app_identifier: finance.get10101.app.test
fastlane_provisioning_profile_specifier: match AppStore finance.get10101.app.test
app_scheme: test
meme_endpoint: http://api.10101.finance/memes/

build_and_release_regtest_android_app_for_latest_main:
needs: changes
Expand All @@ -76,3 +77,4 @@ jobs:
network: regtest
oracle_endpoint: http://34.32.62.120:8081
oracle_pubkey: 5d12d79f575b8d99523797c46441c0549eb0defb6195fe8a080000cbe3ab3859
meme_endpoint: http://api.10101.finance/memes/
5 changes: 5 additions & 0 deletions .github/workflows/ios-fastlane.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ on:
required: true
description: "For regtest enter 'test' or mainnet enter 'Runner'"
type: string
meme_endpoint:
required: true
description: "The url where our memes are being hosted"
type: string

jobs:
build:
Expand Down Expand Up @@ -148,6 +152,7 @@ jobs:
COORDINATOR_PORT_HTTP: ${{ inputs.coordinator_port_http }}
ORACLE_ENDPOINT: ${{ inputs.oracle_endpoint }}
ORACLE_PUBKEY: ${{ inputs.oracle_pubkey }}
MEME_ENDPOINT: ${{ inputs.meme_endpoint }}

- name: Check for COCOAPODS bug
run: cat mobile/ios/Pods/Target\ Support\ Files/Pods-Runner/Pods-Runner-frameworks.sh
Expand Down
1 change: 1 addition & 0 deletions crates/tests-e2e/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,5 +140,6 @@ fn test_config() -> native::config::api::Config {
oracle_pubkey: "16f88cf7d21e6c0f46bcbc983a4e3b19726c6c98858cc31c83551a88fde171c0"
.to_string(),
health_check_interval_secs: 1, // We want to measure health more often in tests
meme_endpoint: "https://localhost:8080/memes/".to_string(),
}
}
1 change: 1 addition & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ services:
- ./services/faucet/open_channel.html:/usr/share/nginx/html/channel/index.html
- ./services/faucet/default.conf:/etc/nginx/conf.d/default.conf
- ./services/faucet/btc-fee-estimates.json:/usr/share/nginx/html/fee/btc-fee-estimates.json
- ./services/faucet/memes:/usr/share/nginx/memes/
depends_on:
- bitcoin
restart: unless-stopped
Expand Down
13 changes: 12 additions & 1 deletion justfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public_coordinator_http_port := "80"
public_regtest_oracle_endpoint := "http://34.32.62.120:8081"
public_regtest_oracle_pk := "5d12d79f575b8d99523797c46441c0549eb0defb6195fe8a080000cbe3ab3859"

mainnet_meme_endoint := "http://api.10101.finance/memes/"

# command to get the local IP of this machine
get_local_ip := if os() == "linux" {
"ip -o route get to 1 | sed -n 's/.*src \\([0-9.]\\+\\).*/\\1/p'"
Expand Down Expand Up @@ -131,7 +133,8 @@ run-regtest args="":
--dart-define="COORDINATOR_P2P_ENDPOINT={{public_regtest_coordinator}}" \
--dart-define="COORDINATOR_PORT_HTTP={{public_coordinator_http_port}}" \
--dart-define="ORACLE_ENDPOINT={{public_regtest_oracle_endpoint}}" \
--dart-define="ORACLE_PUBKEY={{public_regtest_oracle_pk}}"
--dart-define="ORACLE_PUBKEY={{public_regtest_oracle_pk}}" \
--dart-define="MEME_ENDPOINT=${mainnet_meme_endpoint}"
# Run against our public mainnet server
run-mainnet args="":
Expand All @@ -146,6 +149,7 @@ run-mainnet args="":
--dart-define="ORACLE_ENDPOINT=http://oracle.10101.finance" \
--dart-define="NETWORK=mainnet" \
--dart-define="ORACLE_PUBKEY=93051f54feefdb4765492a85139c436d4857e2e331a360c89a16d6bc02ba9cd0" \
--dart-define="MEME_ENDPOINT=http://api.10101.finance/memes/"
# Specify correct Android flavor to run against our public regtest server
run-regtest-android args="":
Expand All @@ -159,6 +163,7 @@ run-regtest-android args="":
--dart-define="COORDINATOR_PORT_HTTP={{public_coordinator_http_port}}" \
--dart-define="ORACLE_ENDPOINT={{public_regtest_oracle_endpoint}}" \
--dart-define="ORACLE_PUBKEY={{public_regtest_oracle_pk}}" \
--dart-define="MEME_ENDPOINT=http://api.10101.finance/memes/"
--flavor test
[unix]
Expand All @@ -175,6 +180,7 @@ run-local-android args="":
--dart-define="COORDINATOR_PORT_HTTP=8000" \
--dart-define="ORACLE_ENDPOINT=http://${LOCAL_IP}:8081" \
--dart-define="ORACLE_PUBKEY=16f88cf7d21e6c0f46bcbc983a4e3b19726c6c98858cc31c83551a88fde171c0" \
--dart-define="MEME_ENDPOINT=http://${LOCAL_IP}:8080/memes/"
--flavor local
fund args="":
Expand Down Expand Up @@ -499,6 +505,7 @@ build-ipa args="":
--dart-define="COORDINATOR_PORT_HTTP=${COORDINATOR_PORT_HTTP}" \
--dart-define="ORACLE_ENDPOINT=${ORACLE_ENDPOINT}" \
--dart-define="ORACLE_PUBKEY=${ORACLE_PUBKEY}" \
--dart-define="MEME_ENDPOINT=${MEME_ENDPOINT}"
--build-number=${BUILD_NUMBER} \
{{args}}

Expand Down Expand Up @@ -532,6 +539,7 @@ build-apk-regtest:
--dart-define="COORDINATOR_PORT_HTTP={{public_coordinator_http_port}}" \
--dart-define="ORACLE_ENDPOINT={{public_regtest_oracle_endpoint}}" \
--dart-define="ORACLE_PUBKEY={{public_regtest_oracle_pk}}" \
--dart-define="MEME_ENDPOINT={{mainnet_meme_endoint}}" \
--flavor demo
release-apk-regtest: gen android-release build-apk-regtest
Expand All @@ -553,6 +561,7 @@ build-app-bundle-regtest:
--dart-define="COORDINATOR_PORT_HTTP={{public_coordinator_http_port}}" \
--dart-define="ORACLE_ENDPOINT={{public_regtest_oracle_endpoint}}" \
--dart-define="ORACLE_PUBKEY={{public_regtest_oracle_pk}}" \
--dart-define="MEME_ENDPOINT={{mainnet_meme_endoint}}" \
--flavor demo

Expand Down Expand Up @@ -586,6 +595,7 @@ build-android-app-bundle:
--dart-define="COORDINATOR_PORT_HTTP=${COORDINATOR_PORT_HTTP}" \
--dart-define="ORACLE_ENDPOINT=${ORACLE_ENDPOINT}" \
--dart-define="ORACLE_PUBKEY=${ORACLE_PUBKEY}" \
--dart-define="MEME_ENDPOINT=${MEME_ENDPOINT}" \
"${flavor_arg[@]}"

build-android-app-apk args="":
Expand Down Expand Up @@ -618,6 +628,7 @@ build-android-app-apk args="":
--dart-define="COORDINATOR_PORT_HTTP=${COORDINATOR_PORT_HTTP}" \
--dart-define="ORACLE_ENDPOINT=${ORACLE_ENDPOINT}" \
--dart-define="ORACLE_PUBKEY=${ORACLE_PUBKEY}" \
--dart-define="MEME_ENDPOINT=${MEME_ENDPOINT}" \
"${flavor_arg[@]}"

upload-app-bundle:
Expand Down
6 changes: 3 additions & 3 deletions mobile/lib/common/init_service.dart
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:get_10101/common/dlc_channel_service.dart';
import 'package:get_10101/common/domain/dlc_channel.dart';
import 'package:get_10101/common/domain/tentenone_config.dart';
import 'package:get_10101/common/full_sync_change_notifier.dart';
import 'package:get_10101/features/brag/github_service.dart';
import 'package:get_10101/features/brag/meme_service.dart';
import 'package:get_10101/features/trade/candlestick_change_notifier.dart';
import 'package:get_10101/features/trade/order_change_notifier.dart';
import 'package:get_10101/features/trade/position_change_notifier.dart';
Expand Down Expand Up @@ -46,7 +46,7 @@ List<SingleChildWidget> createProviders() {
const channelInfoService = ChannelInfoService();
const dlcChannelService = DlcChannelService();
const pollService = PollService();
const githubService = GitHubService();
final memeService = MemeService();

var providers = [
ChangeNotifierProvider(create: (context) {
Expand All @@ -71,7 +71,7 @@ List<SingleChildWidget> createProviders() {
Provider(create: (context) => config),
Provider(create: (context) => channelInfoService),
Provider(create: (context) => pollService),
Provider(create: (context) => githubService)
Provider(create: (context) => memeService)
];
if (config.network == "regtest") {
providers.add(Provider(create: (context) => FaucetService()));
Expand Down
Loading

0 comments on commit d0aff5e

Please sign in to comment.