Skip to content

Commit 9689c13

Browse files
authored
Merge branch 'main' into feat/wasmv2
2 parents 4293ac4 + 07f9eb3 commit 9689c13

File tree

16 files changed

+416
-92
lines changed

16 files changed

+416
-92
lines changed

Dockerfile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ WORKDIR /minitia
4343

4444
COPY --from=go-builder /code/build/minitiad /usr/local/bin/minitiad
4545

46+
# for new-metric setup
47+
COPY --from=go-builder /code/contrib /minitia/contrib
48+
4649
USER minitia
4750

4851
# rest server

README.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,23 @@
1-
# miniwasm
1+
# MiniWasm
22

3-
miniwasm is an optimistic rollup consumer chain powered by wasmvm. It is a framework designed to simplify the process of bootstrapping an L2 network. The main advantage of using miniwasm is that you can leverage the OPinit stack for enhanced security and utilize all the initia ecosystem tooling from day one, without the need to prepare a validator group or build your own ecosystem tools.
3+
MiniWasm is an optimistic rollup consumer chain powered by WasmVM, designed to simplify the process of bootstrapping an L2 network. The main advantage of using MiniWasm is that the users can leverage the OPinit stack for enhanced security and utilize all the Initia ecosystem tooling from day one, without the need to prepare a validator group or build the users' own ecosystem tools.
4+
5+
## Prerequisites
6+
7+
- Go v1.22.2+
48

59
## Getting Started
610

7-
To get started with L2, please visit the documentation.
11+
To get started with L2, please visit the [documentation](https://initia.gitbook.io/initia-docs-v2/).
812

913
## Features
1014

11-
- Optimistic rollup consumer chain powered by wasmvm.
12-
- Simplified network bootstrapping process.
13-
- No need to prepare a validator group or build your own ecosystem tools.
14-
- Enhanced security through the OPinit stack.
15-
- Access to all initia ecosystem tools from day one.
15+
- Powered by WasmVM, MiniWasm acts as an optimistic rollup consumer chain.
16+
- Simplifies the network bootstrapping process, making it faster and more efficient.
17+
- Eliminates the need for setting up a validator group or creating custom ecosystem tools.
18+
- Integrates seamlessly with the OPinit stack, enhancing security.
19+
- Provides immediate access to the full suite of Initia ecosystem tools right from the start.
20+
1621

1722
## Contributing
1823

app/app.go

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"os"
88
"path/filepath"
99
"slices"
10+
"strings"
1011

1112
"github.com/gorilla/mux"
1213
"github.com/rakyll/statik/fs"
@@ -156,9 +157,9 @@ import (
156157
indexer "github.com/initia-labs/kvindexer"
157158
indexerconfig "github.com/initia-labs/kvindexer/config"
158159
blocksubmodule "github.com/initia-labs/kvindexer/submodules/block"
159-
pair "github.com/initia-labs/kvindexer/submodules/pair"
160160
tx "github.com/initia-labs/kvindexer/submodules/tx"
161161
nft "github.com/initia-labs/kvindexer/submodules/wasm-nft"
162+
pair "github.com/initia-labs/kvindexer/submodules/wasm-pair"
162163
indexermodule "github.com/initia-labs/kvindexer/x/kvindexer"
163164
indexerkeeper "github.com/initia-labs/kvindexer/x/kvindexer/keeper"
164165

@@ -975,9 +976,22 @@ func NewMinitiaApp(
975976
}
976977
err = msgservice.ValidateProtoAnnotations(protoFiles)
977978
if err != nil {
978-
// Once we switch to using protoreflect-based antehandlers, we might
979-
// want to panic here instead of logging a warning.
980-
fmt.Fprintln(os.Stderr, err.Error())
979+
errMsg := ""
980+
981+
// ignore injective proto annotations comes from github.com/cosoms/relayer
982+
for _, s := range strings.Split(err.Error(), "\n") {
983+
if strings.Contains(s, "injective") {
984+
continue
985+
}
986+
987+
errMsg += s + "\n"
988+
}
989+
990+
if errMsg != "" {
991+
// Once we switch to using protoreflect-based antehandlers, we might
992+
// want to panic here instead of logging a warning.
993+
fmt.Fprintln(os.Stderr, errMsg)
994+
}
981995
}
982996

983997
// must be before Loading version

client/docs/statik/statik.go

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

client/docs/swagger-ui/swagger.yaml

Lines changed: 44 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -41293,7 +41293,7 @@ paths:
4129341293
- Query
4129441294
/indexer/version:
4129541295
get:
41296-
summary: Version queries all the collections of an account
41296+
summary: Version queries all the versions of the submodules
4129741297
operationId: Versions
4129841298
responses:
4129941299
'200':
@@ -41340,6 +41340,7 @@ paths:
4134041340
- Query
4134141341
/indexer/vmtype:
4134241342
get:
41343+
summary: VMType queries the type of the Minitia's VM
4134341344
operationId: VMType
4134441345
responses:
4134541346
'200':
@@ -41480,13 +41481,15 @@ paths:
4148041481
type: string
4148141482
title: >-
4148241483
actually minitias have no identity because they
41483-
haven't MsgCreateValidator, but we decided to keep
41484-
this field for compatibility with L1
41484+
haven't MsgCreateValidator,
41485+
41486+
but we decided to keep this field for compatibility
41487+
with L1
4148541488
operator_address:
4148641489
type: string
4148741490
title: >-
4148841491
Proposer represents the proposer of a block: for
41489-
minitia, its the L2 operator
41492+
minitia, it is the L2 operator
4149041493
title: Block represents a indexed block in a blockchain
4149141494
pagination:
4149241495
description: pagination defines the pagination in the response.
@@ -41650,15 +41653,17 @@ paths:
4165041653
type: string
4165141654
title: >-
4165241655
actually minitias have no identity because they
41653-
haven't MsgCreateValidator, but we decided to keep
41654-
this field for compatibility with L1
41656+
haven't MsgCreateValidator,
41657+
41658+
but we decided to keep this field for compatibility
41659+
with L1
4165541660
operator_address:
4165641661
type: string
4165741662
title: >-
4165841663
Proposer represents the proposer of a block: for minitia,
41659-
its the L2 operator
41664+
it is the L2 operator
4166041665
title: Block represents a indexed block in a blockchain
41661-
description: BlockResponse defines the response for the Blocks RPC.
41666+
description: BlockResponse defines the response for the Block RPC.
4166241667
default:
4166341668
description: An unexpected error response.
4166441669
schema:
@@ -42199,7 +42204,7 @@ paths:
4219942204
- Query
4220042205
/indexer/tx/v1/txs/by_account/{account}:
4220142206
get:
42202-
summary: TxsByAccount queries all the collections of given account
42207+
summary: TxsByAccount queries all transactions of given account
4220342208
operationId: TxsByAccount
4220442209
responses:
4220542210
'200':
@@ -42712,7 +42717,7 @@ paths:
4271242717
- Query
4271342718
/indexer/tx/v1/txs/by_height/{height}:
4271442719
get:
42715-
summary: TxsByHeight queries all the collections of given height
42720+
summary: TxsByHeight queries all transactions of given height
4271642721
operationId: TxsByHeight
4271742722
responses:
4271842723
'200':
@@ -43722,7 +43727,9 @@ paths:
4372243727
}
4372343728
title: >-
4372443729
QueryCollectionsResponse is the response type for the
43725-
Query/Collections RPC method
43730+
Query/Collections RPC
43731+
43732+
method
4372643733
default:
4372743734
description: An unexpected error response.
4372843735
schema:
@@ -43848,7 +43855,9 @@ paths:
4384843855
address
4384943856
title: >-
4385043857
QueryCollectionResponse is the response type for the
43851-
Query/Collection RPC method
43858+
Query/Collection RPC
43859+
43860+
method
4385243861
default:
4385343862
description: An unexpected error response.
4385443863
schema:
@@ -44208,7 +44217,7 @@ paths:
4420844217
- Query
4420944218
/indexer/pair/v1/pairs:
4421044219
get:
44211-
summary: Pairs queries all the collections of an account
44220+
summary: Pairs queries all the pairs of L1 and L2
4421244221
operationId: Pairs
4421344222
responses:
4421444223
'200':
@@ -70446,12 +70455,13 @@ definitions:
7044670455
type: string
7044770456
title: >-
7044870457
actually minitias have no identity because they haven't
70449-
MsgCreateValidator, but we decided to keep this field for
70450-
compatibility with L1
70458+
MsgCreateValidator,
70459+
70460+
but we decided to keep this field for compatibility with L1
7045170461
operator_address:
7045270462
type: string
7045370463
title: >-
70454-
Proposer represents the proposer of a block: for minitia, its the L2
70464+
Proposer represents the proposer of a block: for minitia, it is the L2
7045570465
operator
7045670466
title: Block represents a indexed block in a blockchain
7045770467
indexer.block.v1.BlockResponse:
@@ -70508,15 +70518,16 @@ definitions:
7050870518
type: string
7050970519
title: >-
7051070520
actually minitias have no identity because they haven't
70511-
MsgCreateValidator, but we decided to keep this field for
70512-
compatibility with L1
70521+
MsgCreateValidator,
70522+
70523+
but we decided to keep this field for compatibility with L1
7051370524
operator_address:
7051470525
type: string
7051570526
title: >-
70516-
Proposer represents the proposer of a block: for minitia, its the
70517-
L2 operator
70527+
Proposer represents the proposer of a block: for minitia, it is
70528+
the L2 operator
7051870529
title: Block represents a indexed block in a blockchain
70519-
description: BlockResponse defines the response for the Blocks RPC.
70530+
description: BlockResponse defines the response for the Block RPC.
7052070531
indexer.block.v1.BlocksResponse:
7052170532
type: object
7052270533
properties:
@@ -70573,12 +70584,13 @@ definitions:
7057370584
type: string
7057470585
title: >-
7057570586
actually minitias have no identity because they haven't
70576-
MsgCreateValidator, but we decided to keep this field for
70577-
compatibility with L1
70587+
MsgCreateValidator,
70588+
70589+
but we decided to keep this field for compatibility with L1
7057870590
operator_address:
7057970591
type: string
7058070592
title: >-
70581-
Proposer represents the proposer of a block: for minitia, its
70593+
Proposer represents the proposer of a block: for minitia, it is
7058270594
the L2 operator
7058370595
title: Block represents a indexed block in a blockchain
7058470596
pagination:
@@ -70610,12 +70622,13 @@ definitions:
7061070622
type: string
7061170623
title: >-
7061270624
actually minitias have no identity because they haven't
70613-
MsgCreateValidator, but we decided to keep this field for
70614-
compatibility with L1
70625+
MsgCreateValidator,
70626+
70627+
but we decided to keep this field for compatibility with L1
7061570628
operator_address:
7061670629
type: string
7061770630
title: >-
70618-
Proposer represents the proposer of a block: for minitia, its the L2
70631+
Proposer represents the proposer of a block: for minitia, it is the L2
7061970632
operator
7062070633
indexer.tx.v1.QueryTxResponse:
7062170634
type: object
@@ -71175,7 +71188,7 @@ definitions:
7117571188
title: TokenHandle is an embedded message for CollectionData
7117671189
title: Collection is the message for a collection of NFTs
7117771190
title: IndexedCollection is wrapped Collection with its object address
71178-
title: >-
71191+
title: |-
7117971192
QueryCollectionResponse is the response type for the Query/Collection RPC
7118071193
method
7118171194
indexer.nft.v1.QueryCollectionsResponse:
@@ -71237,7 +71250,9 @@ definitions:
7123771250
}
7123871251
title: >-
7123971252
QueryCollectionsResponse is the response type for the Query/Collections
71240-
RPC method
71253+
RPC
71254+
71255+
method
7124171256
indexer.nft.v1.QueryTokensResponse:
7124271257
type: object
7124371258
properties:

cmd/minitiad/config.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,14 @@ func initAppConfig() (string, interface{}) {
4040
// In simapp, we set the min gas prices to 0.
4141
srvCfg.MinGasPrices = fmt.Sprintf("0%s", types.BaseDenom)
4242

43+
// Enable API and unsafe CORS (CORS allowed from any host)
44+
srvCfg.API.Enable = true
45+
srvCfg.API.EnableUnsafeCORS = true
46+
srvCfg.API.Address = "tcp://0.0.0.0:1317"
47+
48+
srvCfg.GRPC.Enable = true
49+
srvCfg.GRPC.Address = "0.0.0.0:9090"
50+
4351
minitiaAppConfig := minitiaAppConfig{
4452
Config: *srvCfg,
4553
WasmConfig: wasmtypes.DefaultWasmConfig(),

cmd/minitiad/init.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ func InitCmd(mbm module.BasicManager, defaultNodeHome string) *cobra.Command {
8686
config := serverCtx.Config
8787
config.SetRoot(clientCtx.HomeDir)
8888

89+
// Configure the server to open RPC port to everyone and allow every origins
90+
config.RPC.ListenAddress = "tcp://0.0.0.0:26657"
91+
config.RPC.CORSAllowedOrigins = []string{"*"}
92+
8993
chainID, _ := cmd.Flags().GetString(flags.FlagChainID)
9094
if chainID == "" {
9195
chainID = fmt.Sprintf("test-chain-%v", cometrand.Str(6))

0 commit comments

Comments
 (0)