From 0c34df3429b93f6beae98990b82945b83d92ce08 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sat, 20 Jul 2024 20:42:55 -0500 Subject: [PATCH 1/6] feat: add explorer logic --- .github/workflows/spawn-e2e.yaml | 6 +-- cmd/spawn/new_chain.go | 8 ++- scripts/matrix_generator.py | 2 +- simapp/Makefile | 12 +++++ spawn/cfg.go | 93 ++++++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+), 6 deletions(-) diff --git a/.github/workflows/spawn-e2e.yaml b/.github/workflows/spawn-e2e.yaml index bb68cb5a..2c8f64d2 100644 --- a/.github/workflows/spawn-e2e.yaml +++ b/.github/workflows/spawn-e2e.yaml @@ -51,7 +51,7 @@ jobs: uses: ./.github/workflows/reusable-e2e.yaml with: id: Proof of Stake - spawn-create-cmd: ./spawn new mychain --consensus=proof-of-stake --bypass-prompt --bech32=prefix --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug + spawn-create-cmd: ./spawn new mychain --consensus=proof-of-stake --bypass-prompt --bech32=prefix --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug --skip-explorer start-chain-cmd: HOME_DIR="~/.simapp" CHAIN_ID="localchain-1" BLOCK_TIME="2000ms" CLEAN=true sh scripts/test_node.sh & proof-of-authority: @@ -59,7 +59,7 @@ jobs: uses: ./.github/workflows/reusable-e2e.yaml with: id: Proof of Authority - spawn-create-cmd: ./spawn new mychain --consensus=proof-of-authority --bypass-prompt --bech32=cosmos --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug + spawn-create-cmd: ./spawn new mychain --consensus=proof-of-authority --bypass-prompt --bech32=cosmos --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug --skip-explorer start-chain-cmd: HOME_DIR="~/.simapp" CHAIN_ID="localchain-1" BLOCK_TIME="2000ms" CLEAN=true sh scripts/test_node.sh & normal-ics: @@ -67,5 +67,5 @@ jobs: uses: ./.github/workflows/reusable-e2e.yaml with: id: ICS - Cosmos Hub - spawn-create-cmd: ./spawn new mychain --consensus=ics --bin=appd --bypass-prompt --bech32=roll --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug + spawn-create-cmd: ./spawn new mychain --consensus=ics --bin=appd --bypass-prompt --bech32=roll --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug --skip-explorer start-chain-cmd: HOME_DIR="~/.icsnetwork" CHAIN_ID="localchain-2" CLEAN=true BLOCK_TIME="2000ms" sh scripts/test_ics_node.sh & \ No newline at end of file diff --git a/cmd/spawn/new_chain.go b/cmd/spawn/new_chain.go index 73b98cd7..f4511365 100644 --- a/cmd/spawn/new_chain.go +++ b/cmd/spawn/new_chain.go @@ -49,6 +49,7 @@ const ( FlagConsensus = "consensus" FlagNoGit = "skip-git" FlagBypassPrompt = "bypass-prompt" + FlagNoExplorer = "skip-explorer" ) func init() { @@ -71,6 +72,7 @@ func init() { newChain.Flags().String(FlagConsensus, "", strings.Join(consensus, ",")) // must be set to nothing is nothing is set newChain.Flags().Bool(FlagDebugging, false, "enable debugging") newChain.Flags().Bool(FlagNoGit, false, "ignore git init") + newChain.Flags().Bool(FlagNoExplorer, false, "ignore block explorer") newChain.Flags().Bool(FlagBypassPrompt, false, "bypass UI prompt") newChain.Flags().SetNormalizeFunc(normalizeWhitelistVarRun) } @@ -82,8 +84,8 @@ var newChain = &cobra.Command{ ` - spawn new rollchain --consensus=proof-of-stake --%s=cosmos --%s=simd --%s=token --org=abcde - spawn new rollchain --consensus=proof-of-authority --%s=tokenfactory,globalfee - spawn new rollchain --consensus=interchain-security --%s=cosmwasm --%s - - spawn new rollchain --%s`, - FlagWalletPrefix, FlagBinDaemon, FlagTokenDenom, FlagDisabled, FlagDisabled, FlagNoGit, FlagBypassPrompt, + - spawn new rollchain --%s --%s`, + FlagWalletPrefix, FlagBinDaemon, FlagTokenDenom, FlagDisabled, FlagDisabled, FlagNoGit, FlagBypassPrompt, FlagNoExplorer, ), Args: cobra.ExactArgs(1), Aliases: []string{"new", "init", "create"}, @@ -102,6 +104,7 @@ var newChain = &cobra.Command{ consensus, _ := cmd.Flags().GetString(FlagConsensus) bypassPrompt, _ := cmd.Flags().GetBool(FlagBypassPrompt) + ignoreExplorer, _ := cmd.Flags().GetBool(FlagNoExplorer) // Show a UI to select the consensus algorithm (POS, POA, ICS) if a custom one was not specified. if !bypassPrompt { @@ -165,6 +168,7 @@ var newChain = &cobra.Command{ Denom: denom, GithubOrg: githubOrg, IgnoreGitInit: ignoreGitInit, + IgnoreExplorer: ignoreExplorer, DisabledModules: disabled, Logger: logger, } diff --git a/scripts/matrix_generator.py b/scripts/matrix_generator.py index e669d10b..30259e08 100644 --- a/scripts/matrix_generator.py +++ b/scripts/matrix_generator.py @@ -270,7 +270,7 @@ def build(self) -> str: if len(self.org) == 0: self.org = random_string(10, True) - text = f"spawn new {self.name} --consensus={self.consensus} --bech32={self.bech32} --bin={self.bin} --denom={self.denom} --org={self.org}" + text = f"spawn new {self.name} --consensus={self.consensus} --bech32={self.bech32} --bin={self.bin} --denom={self.denom} --org={self.org} --skip-explorer" if len(self.disabled_features) == 0: text += " --bypass-prompt" diff --git a/simapp/Makefile b/simapp/Makefile index f7a11eea..faa501d2 100644 --- a/simapp/Makefile +++ b/simapp/Makefile @@ -305,6 +305,17 @@ sh-testnet: mod-tidy .PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet +################################s############################################### +### explorer ### +############################################################################### + +.PHONY: explorer +explorer: +# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash +# nvm install node && nvm install-latest-npm && npm install --global yarn + @echo "Running explorer" + @cd explorer && yarn --ignore-engines && yarn serve + ############################################################################### ### help ### ############################################################################### @@ -320,5 +331,6 @@ help: @echo " sh-testnet : Shell local devnet" @echo " ictest-basic : Basic end-to-end test" @echo " ictest-ibc : IBC end-to-end test" + @echo " explorer : Visual Block Explorer" .PHONY: help \ No newline at end of file diff --git a/spawn/cfg.go b/spawn/cfg.go index 02f45269..c637581d 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -2,6 +2,7 @@ package spawn import ( "embed" + "encoding/json" "fmt" "io/fs" "log/slog" @@ -57,6 +58,7 @@ type NewChainConfig struct { GithubOrg string // IgnoreGitInit is a flag to ignore git init IgnoreGitInit bool + IgnoreExplorer bool DisabledModules []string Logger *slog.Logger isUsingICS bool @@ -164,6 +166,7 @@ func (cfg *NewChainConfig) AnnounceSuccessfulBuild() { fmt.Printf(" - $ gh repo create %s --source=. --remote=upstream --push --private\n", projName) fmt.Println(" - $ spawn module new # generate a new module scaffolding") fmt.Println(" - $ make testnet # build & start a testnet with IBC") + fmt.Println(" - $ make explorer # run a local block explorer") } func (cfg *NewChainConfig) GithubPath() string { @@ -207,6 +210,10 @@ func (cfg *NewChainConfig) CreateNewChain() error { cfg.GitInitNewProjectRepo() } + if !cfg.IgnoreExplorer { + cfg.NewPingPubExplorer() + } + return nil } @@ -407,3 +414,89 @@ func debugErrorFile(logger *slog.Logger, newDirname string) string { return fullPath } + +func (cfg NewChainConfig) clearDir(dirLoc ...string) { + dir := path.Join(dirLoc...) + + if err := os.RemoveAll(dir); err != nil { + cfg.Logger.Error("Error removing directory", "err", err) + } + if err := os.MkdirAll(dir, 0755); err != nil { + cfg.Logger.Error("Error creating directory", "err", err) + } +} + +func (cfg NewChainConfig) NewPingPubExplorer() error { + if err := os.Chdir(cfg.ProjectName); err != nil { + cfg.Logger.Error("chdir", "err", err) + } + if err := ExecCommand("git", "clone", "https://github.com/ping-pub/explorer.git"); err != nil { + cfg.Logger.Error("git clone", "err", err) + } + if err := os.Chdir(".."); err != nil { + cfg.Logger.Error("chdir", "err", err) + } + + mainnet := path.Join(cfg.ProjectName, "explorer", "chains", "mainnet") + cfg.clearDir(mainnet) + cfg.clearDir(path.Join(cfg.ProjectName, "explorer", "chains", "testnet")) + + // Create JSON config file for explorer + explorer := cfg.NewChainExplorerConfig() + bz, err := json.MarshalIndent(explorer, "", " ") + if err != nil { + cfg.Logger.Error("Error marshalling chain explorer config", "err", err) + } + + return os.WriteFile(path.Join(mainnet, "chain_explorer.json"), bz, 0644) +} + +type ChainExplorerAsset struct { + Base string `json:"base"` + Symbol string `json:"symbol"` + Exponent string `json:"exponent"` + CoingeckoId string `json:"coingecko_id"` + Logo string `json:"logo"` +} + +type ChainExplorer struct { + ChainName string `json:"chain_name"` + Coingecko string `json:"coingecko"` + Api []string `json:"api"` + Rpc []string `json:"rpc"` + SnapshotProvider string `json:"snapshot_provider"` + SdkVersion string `json:"sdk_version"` + CoinType string `json:"coin_type"` + MinTxFee string `json:"min_tx_fee"` + AddrPrefix string `json:"addr_prefix"` + Logo string `json:"logo"` + ThemeColor string `json:"theme_color"` + Assets []ChainExplorerAsset `json:"assets"` +} + +func (cfg NewChainConfig) NewChainExplorerConfig() ChainExplorer { + logo := "https://img.freepik.com/free-vector/letter-s-box-logo-design-template_474888-3345.jpg?size=338&ext=jpg&ga=GA1.1.2008272138.1721260800&semt=ais_user" + return ChainExplorer{ + ChainName: cfg.ProjectName, + Coingecko: "", + Api: []string{"http://127.0.0.1:1317"}, + Rpc: []string{"http://127.0.0.1:26657"}, + SnapshotProvider: "", + SdkVersion: "v0.50", + CoinType: "118", + MinTxFee: "800", + AddrPrefix: cfg.Bech32Prefix, + Logo: logo, + ThemeColor: "#001be7", + Assets: []ChainExplorerAsset{ + { + Base: cfg.Denom, + Symbol: strings.ToUpper(cfg.Denom), + Exponent: "6", + CoingeckoId: "", + Logo: logo, + }, + }, + } + +} From 70704becaf5a43969ce40dd783f5cb876971e084 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 21 Jul 2024 16:08:17 -0500 Subject: [PATCH 2/6] move block-explorer to features tab --- .github/workflows/spawn-e2e.yaml | 6 +++--- cmd/spawn/new_chain.go | 9 +++------ scripts/matrix_generator.py | 2 +- spawn/cfg.go | 9 +++++++-- spawn/remove_features.go | 5 +++++ 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/.github/workflows/spawn-e2e.yaml b/.github/workflows/spawn-e2e.yaml index 2c8f64d2..bb68cb5a 100644 --- a/.github/workflows/spawn-e2e.yaml +++ b/.github/workflows/spawn-e2e.yaml @@ -51,7 +51,7 @@ jobs: uses: ./.github/workflows/reusable-e2e.yaml with: id: Proof of Stake - spawn-create-cmd: ./spawn new mychain --consensus=proof-of-stake --bypass-prompt --bech32=prefix --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug --skip-explorer + spawn-create-cmd: ./spawn new mychain --consensus=proof-of-stake --bypass-prompt --bech32=prefix --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug start-chain-cmd: HOME_DIR="~/.simapp" CHAIN_ID="localchain-1" BLOCK_TIME="2000ms" CLEAN=true sh scripts/test_node.sh & proof-of-authority: @@ -59,7 +59,7 @@ jobs: uses: ./.github/workflows/reusable-e2e.yaml with: id: Proof of Authority - spawn-create-cmd: ./spawn new mychain --consensus=proof-of-authority --bypass-prompt --bech32=cosmos --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug --skip-explorer + spawn-create-cmd: ./spawn new mychain --consensus=proof-of-authority --bypass-prompt --bech32=cosmos --bin=appd --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug start-chain-cmd: HOME_DIR="~/.simapp" CHAIN_ID="localchain-1" BLOCK_TIME="2000ms" CLEAN=true sh scripts/test_node.sh & normal-ics: @@ -67,5 +67,5 @@ jobs: uses: ./.github/workflows/reusable-e2e.yaml with: id: ICS - Cosmos Hub - spawn-create-cmd: ./spawn new mychain --consensus=ics --bin=appd --bypass-prompt --bech32=roll --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug --skip-explorer + spawn-create-cmd: ./spawn new mychain --consensus=ics --bin=appd --bypass-prompt --bech32=roll --no-git --org=rollchains-org --denom=uroll --debug --log-level=debug start-chain-cmd: HOME_DIR="~/.icsnetwork" CHAIN_ID="localchain-2" CLEAN=true BLOCK_TIME="2000ms" sh scripts/test_ics_node.sh & \ No newline at end of file diff --git a/cmd/spawn/new_chain.go b/cmd/spawn/new_chain.go index f4511365..3ba8c881 100644 --- a/cmd/spawn/new_chain.go +++ b/cmd/spawn/new_chain.go @@ -32,6 +32,7 @@ var ( {ID: "wasm-light-client", IsSelected: false, Details: "08 Wasm Light Client"}, {ID: "optimistic-execution", IsSelected: false, Details: "Pre-process blocks ahead of consensus request"}, {ID: "ignite-cli", IsSelected: false, Details: "Ignite-CLI Support"}, + {ID: "block-explorer", IsSelected: true, Details: "Ping Pub Explorer"}, }...) // parentDeps is a list of modules that are disabled if a parent module is disabled. @@ -49,7 +50,6 @@ const ( FlagConsensus = "consensus" FlagNoGit = "skip-git" FlagBypassPrompt = "bypass-prompt" - FlagNoExplorer = "skip-explorer" ) func init() { @@ -72,7 +72,6 @@ func init() { newChain.Flags().String(FlagConsensus, "", strings.Join(consensus, ",")) // must be set to nothing is nothing is set newChain.Flags().Bool(FlagDebugging, false, "enable debugging") newChain.Flags().Bool(FlagNoGit, false, "ignore git init") - newChain.Flags().Bool(FlagNoExplorer, false, "ignore block explorer") newChain.Flags().Bool(FlagBypassPrompt, false, "bypass UI prompt") newChain.Flags().SetNormalizeFunc(normalizeWhitelistVarRun) } @@ -84,8 +83,8 @@ var newChain = &cobra.Command{ ` - spawn new rollchain --consensus=proof-of-stake --%s=cosmos --%s=simd --%s=token --org=abcde - spawn new rollchain --consensus=proof-of-authority --%s=tokenfactory,globalfee - spawn new rollchain --consensus=interchain-security --%s=cosmwasm --%s - - spawn new rollchain --%s --%s`, - FlagWalletPrefix, FlagBinDaemon, FlagTokenDenom, FlagDisabled, FlagDisabled, FlagNoGit, FlagBypassPrompt, FlagNoExplorer, + - spawn new rollchain --%s`, + FlagWalletPrefix, FlagBinDaemon, FlagTokenDenom, FlagDisabled, FlagDisabled, FlagNoGit, FlagBypassPrompt, ), Args: cobra.ExactArgs(1), Aliases: []string{"new", "init", "create"}, @@ -104,7 +103,6 @@ var newChain = &cobra.Command{ consensus, _ := cmd.Flags().GetString(FlagConsensus) bypassPrompt, _ := cmd.Flags().GetBool(FlagBypassPrompt) - ignoreExplorer, _ := cmd.Flags().GetBool(FlagNoExplorer) // Show a UI to select the consensus algorithm (POS, POA, ICS) if a custom one was not specified. if !bypassPrompt { @@ -168,7 +166,6 @@ var newChain = &cobra.Command{ Denom: denom, GithubOrg: githubOrg, IgnoreGitInit: ignoreGitInit, - IgnoreExplorer: ignoreExplorer, DisabledModules: disabled, Logger: logger, } diff --git a/scripts/matrix_generator.py b/scripts/matrix_generator.py index 30259e08..e669d10b 100644 --- a/scripts/matrix_generator.py +++ b/scripts/matrix_generator.py @@ -270,7 +270,7 @@ def build(self) -> str: if len(self.org) == 0: self.org = random_string(10, True) - text = f"spawn new {self.name} --consensus={self.consensus} --bech32={self.bech32} --bin={self.bin} --denom={self.denom} --org={self.org} --skip-explorer" + text = f"spawn new {self.name} --consensus={self.consensus} --bech32={self.bech32} --bin={self.bin} --denom={self.denom} --org={self.org}" if len(self.disabled_features) == 0: text += " --bypass-prompt" diff --git a/spawn/cfg.go b/spawn/cfg.go index c637581d..2bb74cab 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -58,7 +58,6 @@ type NewChainConfig struct { GithubOrg string // IgnoreGitInit is a flag to ignore git init IgnoreGitInit bool - IgnoreExplorer bool DisabledModules []string Logger *slog.Logger isUsingICS bool @@ -210,7 +209,13 @@ func (cfg *NewChainConfig) CreateNewChain() error { cfg.GitInitNewProjectRepo() } - if !cfg.IgnoreExplorer { + // see if block-expolorer is disbaled + // if !cfg.IgnoreExplorer { + // cfg.NewPingPubExplorer() + // } + + // if "block-explorer" is not in cfg.Disabled + if !cfg.IsFeatureDisabled("block-explorer") { cfg.NewPingPubExplorer() } diff --git a/spawn/remove_features.go b/spawn/remove_features.go index e8b308ce..ab193c17 100644 --- a/spawn/remove_features.go +++ b/spawn/remove_features.go @@ -22,6 +22,7 @@ var ( Ignite = "ignite" InterchainSecurity = "ics" OptimisticExecution = "optimistic-execution" + BlockExplorer = "block-explorer" appGo = path.Join("app", "app.go") appAnte = path.Join("app", "ante.go") @@ -60,6 +61,8 @@ func AliasName(name string) string { return IBCRateLimit case InterchainSecurity, "interchain-security": return InterchainSecurity + case BlockExplorer, "explorer", "pingpub": + return BlockExplorer default: panic(fmt.Sprintf("AliasName: unknown feature to remove: %s", name)) } @@ -97,6 +100,8 @@ func (fc *FileContent) RemoveDisabledFeatures(cfg *NewChainConfig) { fc.RemoveIgniteCLI() case OptimisticExecution: fc.RemoveOptimisticExecution() + case BlockExplorer: + continue default: panic(fmt.Sprintf("unknown feature to remove %s", name)) } From 6ede59a06c10aad08f8b07e2ceae3de6fdcb2d16 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 21 Jul 2024 17:36:25 -0500 Subject: [PATCH 3/6] nginx + config --- simapp/embed.go | 2 +- simapp/nginx/README.md | 34 ++++++++++++++++++++ simapp/nginx/nginx-selfsigned.crt | 21 ++++++++++++ simapp/nginx/nginx-selfsigned.key | 28 ++++++++++++++++ simapp/nginx/nginx.conf | 53 +++++++++++++++++++++++++++++++ spawn/cfg.go | 4 +-- spawn/file_content.go | 4 +-- spawn/remove_features.go | 6 +++- 8 files changed, 145 insertions(+), 7 deletions(-) create mode 100644 simapp/nginx/README.md create mode 100644 simapp/nginx/nginx-selfsigned.crt create mode 100755 simapp/nginx/nginx-selfsigned.key create mode 100644 simapp/nginx/nginx.conf diff --git a/simapp/embed.go b/simapp/embed.go index 96d55bc7..a88359c6 100644 --- a/simapp/embed.go +++ b/simapp/embed.go @@ -6,7 +6,7 @@ import ( // !IMPORTANT: interchaintest/ has its own `InterchainTest` embed.FS that will need to be iterated on. -//go:embed .github/* app/* chains/* cmd/* contrib/* scripts/* Makefile Dockerfile proto/*.* *.* +//go:embed .github/* app/* chains/* cmd/* contrib/* scripts/* Makefile Dockerfile nginx/* proto/*.* *.* var SimAppFS embed.FS // To embed the interchaintest/ directory, rename the go.mod file to `go.mod_` diff --git a/simapp/nginx/README.md b/simapp/nginx/README.md new file mode 100644 index 00000000..b5a0d44b --- /dev/null +++ b/simapp/nginx/README.md @@ -0,0 +1,34 @@ +# Nginx Explorer + +To run the explorer locally, this nginx configuration is required to get https to work locally. + +## PingPub Docker Build + +```dockerfile +# docker build . -t pingpub:latest + +FROM node:20-alpine + +RUN apk add --no-cache yarn + +WORKDIR /app + +COPY . . + +EXPOSE 8080 + +CMD [ "yarn", "--ignore-engines", "serve", "--host", "0.0.0.0" ] +``` + +## Running + +Update your `/etc/hosts` file to include the following: + +``` +127.0.0.1 api.localhost +127.0.0.1 rpc.localhost +127.0.0.1 pingpub.localhost +``` + +Then `docker compose up` to start the reverse proxy, explorer, and the RPC/REST API Services. Then start the testnet (make sh-testnet) + diff --git a/simapp/nginx/nginx-selfsigned.crt b/simapp/nginx/nginx-selfsigned.crt new file mode 100644 index 00000000..4309c1bf --- /dev/null +++ b/simapp/nginx/nginx-selfsigned.crt @@ -0,0 +1,21 @@ +-----BEGIN CERTIFICATE----- +MIIDazCCAlOgAwIBAgIUVgGX1ixwRoR1zlI8hTotdUKYLv4wDQYJKoZIhvcNAQEL +BQAwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgMClNvbWUtU3RhdGUxITAfBgNVBAoM +GEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZDAeFw0yNDA3MjEyMTM4MDVaFw0yNDA4 +MjAyMTM4MDVaMEUxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApTb21lLVN0YXRlMSEw +HwYDVQQKDBhJbnRlcm5ldCBXaWRnaXRzIFB0eSBMdGQwggEiMA0GCSqGSIb3DQEB +AQUAA4IBDwAwggEKAoIBAQDPiqGL1t3RFFkhFJXRb1qO249wODwhUmMIYr3Kn4Tv +RzgZg8+6U95djp6j5ToOnZpW+HGk87y/QKdnc4j23rVLUhWjIOJNsdttB/iBY3bY +4kGpTByeM0/INE1ccjjE/+0e8Zmi/EpAGOtaQc8XWW4w7XUr7PtvXt8hlOSJWfd6 ++1gtiN/uHiAjWAudDyQw06ldhFyBBbIjTgF5jFVUFflPg7rB1RJFquDJGjaW3kDQ +Jz4BLlRhspgQqz1bzJTwqXivXp3nk9na2wesMcMDK0NSLBoqxqqTx06UZmlMm2/R +vRFg6F66/wqUhhxHvw2iLqBhoirhRiIL9IgTu388cE/DAgMBAAGjUzBRMB0GA1Ud +DgQWBBQD++PJjWJKDdNPv+t6aoMyCiF6TDAfBgNVHSMEGDAWgBQD++PJjWJKDdNP +v+t6aoMyCiF6TDAPBgNVHRMBAf8EBTADAQH/MA0GCSqGSIb3DQEBCwUAA4IBAQCn ++nuVpVpetc83BTOoJopqosaVZuk87NGutvMiua/dHosfwgVqz0PAmg3DZ47eVOeH +trgFW3XINXxPdV8RL9cLAq3sppmSMBHMxHDu54uJ/9nJcEX2zCXYlCeJgcLShLv8 +BB7M1VFPRiaPpAwrE/UgaVumeD+XWNVs6INGB0n74SZG1aRr7JWbm9HG02Hon/MG +5OpUfhpCL13P78x1KuHCMAxAK16Ifpb0Vk17RNqbrDx6yHnhcDOWOCH29RdMB7I9 +fwf62r70hGjhOavgaVKGcbiOIfQoGh8rLOOQUcHXdpbx7lKtjgAnytMIQ6Fx9wNI +WMRBwh/Vql5nhzioWSmB +-----END CERTIFICATE----- diff --git a/simapp/nginx/nginx-selfsigned.key b/simapp/nginx/nginx-selfsigned.key new file mode 100755 index 00000000..d39ecb23 --- /dev/null +++ b/simapp/nginx/nginx-selfsigned.key @@ -0,0 +1,28 @@ +-----BEGIN PRIVATE KEY----- +MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQDPiqGL1t3RFFkh +FJXRb1qO249wODwhUmMIYr3Kn4TvRzgZg8+6U95djp6j5ToOnZpW+HGk87y/QKdn +c4j23rVLUhWjIOJNsdttB/iBY3bY4kGpTByeM0/INE1ccjjE/+0e8Zmi/EpAGOta +Qc8XWW4w7XUr7PtvXt8hlOSJWfd6+1gtiN/uHiAjWAudDyQw06ldhFyBBbIjTgF5 +jFVUFflPg7rB1RJFquDJGjaW3kDQJz4BLlRhspgQqz1bzJTwqXivXp3nk9na2wes +McMDK0NSLBoqxqqTx06UZmlMm2/RvRFg6F66/wqUhhxHvw2iLqBhoirhRiIL9IgT +u388cE/DAgMBAAECggEALQBn3/0SsuvBGcmvZK7LCY/1LcWb0DPfkmlqst1dA09D +jFDHAaV+4XVz06D4MkQdO796UOSi6Ct6QRXNvI307KSbWXhfaa5noGAqk8+/7O4+ +g5mj2O/SXFxu690+jwTZYyzK/grLhNOCcNs1LuBu4sASeJhVusPtCQiSd2/hGDK0 +3AtN561z3QEAseV+yIVyAutAL0Xj+w8g1g0sKGkojypAwWnhX9I02xBhNFCyMkBp +/Tuts48QEomYbEI91wEa6PumD9EMtHV5JSiHJm59jbn7GPd38fqORB2Qhh580lg6 +zINAOHZb9BwXJYo5tRLZI/tKUQKj8PCactDM+hmQiQKBgQDuFB96a44R7xII8P6o +OE3ECHEsaaiywQ6FX3rVfC2AYySIXVIcrng//ITbwW8Tv26jAfCxkaTV+XN2UplH +tksSj3Ll9f9qCdeog9UJhT7TFR6uwSHTZ9ninhS0J5HEalkYwYo7i4uQaIrjK4Ll +4fLMqiGoFVU1g4REJlNiz/ecqwKBgQDfKgujoCL73akWqVKdEFNWKWlHaTr7Ihhb +wMAmSkK6L29+Ig+0Q+Cs5ndtZP8UFGTndVoi++yU2oXYdXwUcyS+cyzi7X9Zmp+F +xSa8zq5+oOGOfRAOtlp/Sf3/xJO6NxCT7uS0Q5u3BHuldU/Lx5wagA20uCldh5dO +Nx5zubfpSQKBgCvHMX6eVnJ/xo40Wm9uYwZgEwd6qlWsYFIwG3M0MV3BXU9h8Z5q +ipwhgAC00gsMkXiR+8N7J5ddFlk0mRDxuV5BWHxmvr+t7aUEEOF+Se4gnRK/Wsv3 +9b3RGbeC6y/16ko+FIAcid5VCuz47En/QVlXE3dH7PI5K9IoRf8OhNafAoGAKNaP +5LSUUlUA8WWw+Y8YQQc4/dly8qwNmxTN1PP3/AxcMc/X4dweDGXsavd1el41DOo7 +wXUqmR7YKYFuYGulyLhY+XoOuP4DvT4T1a9Y3VFhlWqrepXCP9LxiVGW2xfij7/C +2H4ay8YlPmUWYis4FN1kJLMi1rvOY4DQsMrGrgkCgYEAg/nASsYYpOUxEg8Z2X7r +PvDIPu6S51o74Qwukq4tXG0ALpNHQQJfh4kG2+Dy9gYYuSYHyyRw3I1P68JDQzHB +4qnRaVLQn5rk4++xD01P22juvT+XHqeiRAGl+8n/xqj/qdwoI4LEyhgXH5TpjpCw +gcH/cDxQQbmkHxLCQ3bzuJ8= +-----END PRIVATE KEY----- diff --git a/simapp/nginx/nginx.conf b/simapp/nginx/nginx.conf new file mode 100644 index 00000000..54056556 --- /dev/null +++ b/simapp/nginx/nginx.conf @@ -0,0 +1,53 @@ +server { + listen 80; + listen 443 ssl; + + server_name api.localhost; + ssl_certificate nginx-selfsigned.crt; + ssl_certificate_key nginx-selfsigned.key; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Max-Age 3600; + add_header Access-Control-Expose-Headers Content-Length; + + location / { + proxy_pass http://127.0.0.1:1317; + } +} + +server { + listen 80; + listen 443 ssl; + + server_name rpc.localhost; + ssl_certificate nginx-selfsigned.crt; + ssl_certificate_key nginx-selfsigned.key; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Max-Age 3600; + add_header Access-Control-Expose-Headers Content-Length; + + location / { + proxy_pass http://127.0.0.1:26657; + } +} + +server { + listen 80; + listen 443 ssl; + + server_name pingpub.localhost; + ssl_certificate nginx-selfsigned.crt; + ssl_certificate_key nginx-selfsigned.key; + proxy_set_header Host $host; + proxy_set_header X-Forwarded-For $remote_addr; + add_header Access-Control-Allow-Origin *; + add_header Access-Control-Max-Age 3600; + add_header Access-Control-Expose-Headers Content-Length; + + location / { + proxy_pass http://127.0.0.1:5173; + } +} diff --git a/spawn/cfg.go b/spawn/cfg.go index 2bb74cab..f0fefe9b 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -484,8 +484,8 @@ func (cfg NewChainConfig) NewChainExplorerConfig() ChainExplorer { return ChainExplorer{ ChainName: cfg.ProjectName, Coingecko: "", - Api: []string{"http://127.0.0.1:1317"}, - Rpc: []string{"http://127.0.0.1:26657"}, + Api: []string{"https://api.localhost"}, + Rpc: []string{"https://rpc.localhost"}, SnapshotProvider: "", SdkVersion: "v0.50", CoinType: "118", diff --git a/spawn/file_content.go b/spawn/file_content.go index 7b6e84d3..4fad810e 100644 --- a/spawn/file_content.go +++ b/spawn/file_content.go @@ -88,9 +88,7 @@ func (fc *FileContent) DeleteFile(path string) { } func (fc *FileContent) DeleteDirectoryContents(path string) { - if fc.ContainsPath(path) && !AlreadyCheckedDeletion[path] { - AlreadyCheckedDeletion[path] = true - + if fc.ContainsPath(path) { fc.Logger.Debug("Deleting contents for", "path", path) fc.Contents = "" } diff --git a/spawn/remove_features.go b/spawn/remove_features.go index ab193c17..e5f73cf6 100644 --- a/spawn/remove_features.go +++ b/spawn/remove_features.go @@ -101,7 +101,7 @@ func (fc *FileContent) RemoveDisabledFeatures(cfg *NewChainConfig) { case OptimisticExecution: fc.RemoveOptimisticExecution() case BlockExplorer: - continue + fc.RemoveExplorer() default: panic(fmt.Sprintf("unknown feature to remove %s", name)) } @@ -264,6 +264,10 @@ func (fc *FileContent) RemoveOptimisticExecution() { fc.RemoveTaggedLines(OptimisticExecution, true) } +func (fc *FileContent) RemoveExplorer() { + fc.DeleteDirectoryContents("nginx") +} + func (fc *FileContent) RemoveInterchainSecurity() { text := "ics" From fd953e7b59f81c6cb3cdf12ac2c7f305d3dc7113 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 21 Jul 2024 19:19:04 -0500 Subject: [PATCH 4/6] AHA working explorer --- README.md | 7 +- simapp/Makefile | 12 ---- simapp/README.md | 6 +- simapp/docker-compose.yml | 36 +++++++++++ simapp/nginx/README.md | 27 ++------ spawn/cfg.go | 94 --------------------------- spawn/explorer.go | 130 ++++++++++++++++++++++++++++++++++++++ 7 files changed, 184 insertions(+), 128 deletions(-) create mode 100644 simapp/docker-compose.yml create mode 100644 spawn/explorer.go diff --git a/README.md b/README.md index 44dc0416..002d4d59 100644 --- a/README.md +++ b/README.md @@ -48,13 +48,18 @@ make install ```shell GITHUB_USERNAME=rollchains +# Available Features: +# * tokenfactory,globalfee,ibc-packetforward,ibc-ratelimit,cosmwasm,wasm-light-client,optimistic-execution,ignite-cli,block-explorer + spawn new rollchain \ --consensus=proof-of-authority `# proof-of-authority,proof-of-stake,interchain-security` \ --bech32=roll `# the prefix for addresses` \ --denom=uroll `# the coin denomination to create` \ --bin=rolld `# the name of the binary` \ ---disabled=cosmwasm,globalfee `# disable features. [tokenfactory,globalfee,ibc-packetforward,ibc-ratelimit,cosmwasm,wasm-light-client,ignite-cli]` \ +--disabled=cosmwasm,globalfee,block-explorer `# disable features.` \ --org=${GITHUB_USERNAME} `# the github username or organization to use for the module imports, optional` + + ``` > *NOTE:* `spawn` creates a ready to use repository complete with `git` and GitHub CI. It can be quickly pushed to a new repository getting you and your team up and running quickly. diff --git a/simapp/Makefile b/simapp/Makefile index faa501d2..f7a11eea 100644 --- a/simapp/Makefile +++ b/simapp/Makefile @@ -305,17 +305,6 @@ sh-testnet: mod-tidy .PHONY: setup-testnet set-testnet-configs testnet testnet-basic sh-testnet -################################s############################################### -### explorer ### -############################################################################### - -.PHONY: explorer -explorer: -# curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash -# nvm install node && nvm install-latest-npm && npm install --global yarn - @echo "Running explorer" - @cd explorer && yarn --ignore-engines && yarn serve - ############################################################################### ### help ### ############################################################################### @@ -331,6 +320,5 @@ help: @echo " sh-testnet : Shell local devnet" @echo " ictest-basic : Basic end-to-end test" @echo " ictest-ibc : IBC end-to-end test" - @echo " explorer : Visual Block Explorer" .PHONY: help \ No newline at end of file diff --git a/simapp/README.md b/simapp/README.md index 3fa44399..bfcec73d 100644 --- a/simapp/README.md +++ b/simapp/README.md @@ -21,4 +21,8 @@ ## Testing - `go test ./... -v` *Unit test* -- `make ictest-*` *E2E testing* \ No newline at end of file +- `make ictest-*` *E2E testing* + +## Launch Block Explorer Locally + +[Reference Guide](./nginx/README.md) \ No newline at end of file diff --git a/simapp/docker-compose.yml b/simapp/docker-compose.yml new file mode 100644 index 00000000..9f5dcf15 --- /dev/null +++ b/simapp/docker-compose.yml @@ -0,0 +1,36 @@ +version: '3' + +# Runs the explorer & reverse proxy +# +# NOTE: Must add the following to your /etc/hosts file: +# +# 127.0.0.1 api.localhost +# 127.0.0.1 rpc.localhost +# 127.0.0.1:5173 pingpub.localhost +# +# Then: +# docker compose up + +services: + nginx: + image: nginx + network_mode: "host" + ports: + - "80:80" + - "443:443" + volumes: + - ./nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf + - ./nginx/nginx-selfsigned.crt:/etc/nginx/nginx-selfsigned.crt + - ./nginx/nginx-selfsigned.key:/etc/nginx/nginx-selfsigned.key + pingpub: + image: pingpub:latest + network_mode: "host" + build: + context: pingpub + dockerfile: ./explorer/Dockerfile + + volumes: + - ./explorer/chains:/app/chains/ + ports: + - "80:80" + - "443:443" \ No newline at end of file diff --git a/simapp/nginx/README.md b/simapp/nginx/README.md index b5a0d44b..bdafdba0 100644 --- a/simapp/nginx/README.md +++ b/simapp/nginx/README.md @@ -1,24 +1,6 @@ # Nginx Explorer -To run the explorer locally, this nginx configuration is required to get https to work locally. - -## PingPub Docker Build - -```dockerfile -# docker build . -t pingpub:latest - -FROM node:20-alpine - -RUN apk add --no-cache yarn - -WORKDIR /app - -COPY . . - -EXPOSE 8080 - -CMD [ "yarn", "--ignore-engines", "serve", "--host", "0.0.0.0" ] -``` +To run the explorer locally, this nginx configuration is required to get local https to work. ## Running @@ -30,5 +12,10 @@ Update your `/etc/hosts` file to include the following: 127.0.0.1 pingpub.localhost ``` -Then `docker compose up` to start the reverse proxy, explorer, and the RPC/REST API Services. Then start the testnet (make sh-testnet) +Start the testnet with: `make sh-testnet` or the full IBC network with `make testnet` + +Then `docker compose up` to start the reverse proxy, explorer, and the RPC/REST API Services. + +Visit: https://pingpub.localhost to view the explorer. +> Attempting to view as a standard http:// instance will break the block explorer due to pesky CORS errors. diff --git a/spawn/cfg.go b/spawn/cfg.go index f0fefe9b..f0b14974 100644 --- a/spawn/cfg.go +++ b/spawn/cfg.go @@ -2,7 +2,6 @@ package spawn import ( "embed" - "encoding/json" "fmt" "io/fs" "log/slog" @@ -165,7 +164,6 @@ func (cfg *NewChainConfig) AnnounceSuccessfulBuild() { fmt.Printf(" - $ gh repo create %s --source=. --remote=upstream --push --private\n", projName) fmt.Println(" - $ spawn module new # generate a new module scaffolding") fmt.Println(" - $ make testnet # build & start a testnet with IBC") - fmt.Println(" - $ make explorer # run a local block explorer") } func (cfg *NewChainConfig) GithubPath() string { @@ -209,12 +207,6 @@ func (cfg *NewChainConfig) CreateNewChain() error { cfg.GitInitNewProjectRepo() } - // see if block-expolorer is disbaled - // if !cfg.IgnoreExplorer { - // cfg.NewPingPubExplorer() - // } - - // if "block-explorer" is not in cfg.Disabled if !cfg.IsFeatureDisabled("block-explorer") { cfg.NewPingPubExplorer() } @@ -419,89 +411,3 @@ func debugErrorFile(logger *slog.Logger, newDirname string) string { return fullPath } - -func (cfg NewChainConfig) clearDir(dirLoc ...string) { - dir := path.Join(dirLoc...) - - if err := os.RemoveAll(dir); err != nil { - cfg.Logger.Error("Error removing directory", "err", err) - } - if err := os.MkdirAll(dir, 0755); err != nil { - cfg.Logger.Error("Error creating directory", "err", err) - } -} - -func (cfg NewChainConfig) NewPingPubExplorer() error { - if err := os.Chdir(cfg.ProjectName); err != nil { - cfg.Logger.Error("chdir", "err", err) - } - if err := ExecCommand("git", "clone", "https://github.com/ping-pub/explorer.git"); err != nil { - cfg.Logger.Error("git clone", "err", err) - } - if err := os.Chdir(".."); err != nil { - cfg.Logger.Error("chdir", "err", err) - } - - mainnet := path.Join(cfg.ProjectName, "explorer", "chains", "mainnet") - cfg.clearDir(mainnet) - cfg.clearDir(path.Join(cfg.ProjectName, "explorer", "chains", "testnet")) - - // Create JSON config file for explorer - explorer := cfg.NewChainExplorerConfig() - bz, err := json.MarshalIndent(explorer, "", " ") - if err != nil { - cfg.Logger.Error("Error marshalling chain explorer config", "err", err) - } - - return os.WriteFile(path.Join(mainnet, "chain_explorer.json"), bz, 0644) -} - -type ChainExplorerAsset struct { - Base string `json:"base"` - Symbol string `json:"symbol"` - Exponent string `json:"exponent"` - CoingeckoId string `json:"coingecko_id"` - Logo string `json:"logo"` -} - -type ChainExplorer struct { - ChainName string `json:"chain_name"` - Coingecko string `json:"coingecko"` - Api []string `json:"api"` - Rpc []string `json:"rpc"` - SnapshotProvider string `json:"snapshot_provider"` - SdkVersion string `json:"sdk_version"` - CoinType string `json:"coin_type"` - MinTxFee string `json:"min_tx_fee"` - AddrPrefix string `json:"addr_prefix"` - Logo string `json:"logo"` - ThemeColor string `json:"theme_color"` - Assets []ChainExplorerAsset `json:"assets"` -} - -func (cfg NewChainConfig) NewChainExplorerConfig() ChainExplorer { - logo := "https://img.freepik.com/free-vector/letter-s-box-logo-design-template_474888-3345.jpg?size=338&ext=jpg&ga=GA1.1.2008272138.1721260800&semt=ais_user" - return ChainExplorer{ - ChainName: cfg.ProjectName, - Coingecko: "", - Api: []string{"https://api.localhost"}, - Rpc: []string{"https://rpc.localhost"}, - SnapshotProvider: "", - SdkVersion: "v0.50", - CoinType: "118", - MinTxFee: "800", - AddrPrefix: cfg.Bech32Prefix, - Logo: logo, - ThemeColor: "#001be7", - Assets: []ChainExplorerAsset{ - { - Base: cfg.Denom, - Symbol: strings.ToUpper(cfg.Denom), - Exponent: "6", - CoingeckoId: "", - Logo: logo, - }, - }, - } - -} diff --git a/spawn/explorer.go b/spawn/explorer.go new file mode 100644 index 00000000..8b41ebde --- /dev/null +++ b/spawn/explorer.go @@ -0,0 +1,130 @@ +package spawn + +import ( + "encoding/json" + "fmt" + "os" + "path" + "strings" +) + +type ( + ChainExplorerAsset struct { + Base string `json:"base"` + Symbol string `json:"symbol"` + Exponent string `json:"exponent"` + CoingeckoId string `json:"coingecko_id"` + Logo string `json:"logo"` + } + + Endpoint struct { + Provider string `json:"provider"` + Address string `json:"address"` + } + + ChainExplorer struct { + ChainName string `json:"chain_name"` + Api []Endpoint `json:"api"` + Rpc []Endpoint `json:"rpc"` + SdkVersion string `json:"sdk_version"` + CoinType string `json:"coin_type"` + MinTxFee string `json:"min_tx_fee"` + AddrPrefix string `json:"addr_prefix"` + Logo string `json:"logo"` + ThemeColor string `json:"theme_color"` + Assets []ChainExplorerAsset `json:"assets"` + } +) + +// hacky: pingpub does not have a docker file for some reason... +const dockerFile = `# docker build . -t pingpub:latest + +FROM node:20-alpine + +RUN apk add --no-cache yarn npm + +WORKDIR /app + +COPY . . + +# install node_modules to the image +RUN yarn --ignore-engines + +CMD [ "yarn", "--ignore-engines", "serve", "--host", "0.0.0.0" ]` + +func NewEndpoint(provider, address string) Endpoint { + return Endpoint{ + Provider: provider, + Address: address, + } +} + +func (cfg NewChainConfig) NewPingPubExplorer() error { + if err := os.Chdir(cfg.ProjectName); err != nil { + cfg.Logger.Error("chdir", "err", err) + } + if err := ExecCommand("git", "clone", "https://github.com/ping-pub/explorer.git"); err != nil { + cfg.Logger.Error("git clone", "err", err) + } + if err := os.Chdir(".."); err != nil { + cfg.Logger.Error("chdir", "err", err) + } + + mainnet := path.Join(cfg.ProjectName, "explorer", "chains", "mainnet") + cfg.clearDir(mainnet) + cfg.clearDir(path.Join(cfg.ProjectName, "explorer", "chains", "testnet")) + + // Create JSON config file for explorer + explorer := cfg.NewChainExplorerConfig() + bz, err := json.MarshalIndent(explorer, "", " ") + if err != nil { + cfg.Logger.Error("Error marshalling chain explorer config", "err", err) + } + + err = os.WriteFile(path.Join(mainnet, fmt.Sprintf("%s.json", cfg.ProjectName)), bz, 0644) + if err != nil { + cfg.Logger.Error("Error writing chain explorer config", "err", err) + } + + err = os.WriteFile(path.Join(cfg.ProjectName, "explorer", "Dockerfile"), []byte(dockerFile), 0644) + if err != nil { + cfg.Logger.Error("Error writing docker file", "err", err) + } + + return nil +} + +func (cfg NewChainConfig) NewChainExplorerConfig() ChainExplorer { + logo := "https://img.freepik.com/free-vector/letter-s-box-logo-design-template_474888-3345.jpg?size=338&ext=jpg&ga=GA1.1.2008272138.1721260800&semt=ais_user" + return ChainExplorer{ + ChainName: cfg.ProjectName, + Api: []Endpoint{NewEndpoint("api.localhost", "https://api.localhost")}, + Rpc: []Endpoint{NewEndpoint("rpc.localhost", "https://rpc.localhost")}, + SdkVersion: "0.50", + CoinType: "118", + MinTxFee: "800", + AddrPrefix: cfg.Bech32Prefix, + Logo: logo, + ThemeColor: "#001be7", + Assets: []ChainExplorerAsset{ + { + Base: cfg.Denom, + Symbol: strings.ToUpper(cfg.Denom), + Exponent: "6", + CoingeckoId: "", + Logo: logo, + }, + }, + } +} + +func (cfg NewChainConfig) clearDir(dirLoc ...string) { + dir := path.Join(dirLoc...) + + if err := os.RemoveAll(dir); err != nil { + cfg.Logger.Error("Error removing directory", "err", err) + } + if err := os.MkdirAll(dir, 0755); err != nil { + cfg.Logger.Error("Error creating directory", "err", err) + } +} From a0767a0093ea002631efebe6e2b416a4ddd22350 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 21 Jul 2024 19:23:50 -0500 Subject: [PATCH 5/6] markdown-link-check-disable-next-line --- simapp/nginx/README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/simapp/nginx/README.md b/simapp/nginx/README.md index bdafdba0..2bd9025f 100644 --- a/simapp/nginx/README.md +++ b/simapp/nginx/README.md @@ -16,6 +16,7 @@ Start the testnet with: `make sh-testnet` or the full IBC network with `make tes Then `docker compose up` to start the reverse proxy, explorer, and the RPC/REST API Services. + Visit: https://pingpub.localhost to view the explorer. > Attempting to view as a standard http:// instance will break the block explorer due to pesky CORS errors. From 270e7843dc5bde473e220ff902e4e806f104ae28 Mon Sep 17 00:00:00 2001 From: Reece Williams Date: Sun, 21 Jul 2024 19:51:45 -0500 Subject: [PATCH 6/6] explorer --- simapp/Makefile | 4 ++++ simapp/docker-compose.yml | 2 ++ 2 files changed, 6 insertions(+) diff --git a/simapp/Makefile b/simapp/Makefile index f7a11eea..f76ab310 100644 --- a/simapp/Makefile +++ b/simapp/Makefile @@ -309,6 +309,10 @@ sh-testnet: mod-tidy ### help ### ############################################################################### +.PHONY: explorer +explorer: + docker compose up + help: @echo "Usage: make " @echo "" diff --git a/simapp/docker-compose.yml b/simapp/docker-compose.yml index 9f5dcf15..c96bb2b1 100644 --- a/simapp/docker-compose.yml +++ b/simapp/docker-compose.yml @@ -23,6 +23,8 @@ services: - ./nginx/nginx-selfsigned.crt:/etc/nginx/nginx-selfsigned.crt - ./nginx/nginx-selfsigned.key:/etc/nginx/nginx-selfsigned.key pingpub: + depends_on: + - nginx image: pingpub:latest network_mode: "host" build: