diff --git a/CHANGELOG.md b/CHANGELOG.md index bde72a2b..0fbf3449 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added - [\#98](https://github.com/Finschia/finschia-js/pull/98) bumpup cosmjs to 0.31.0 +- [\#105](https://github.com/Finschia/finschia-js/pull/105) add `MsgUpdateCensorship` msg and `Censorship` query apis of x/foundation ### Changed diff --git a/package.json b/package.json index e0dfea41..3f385efe 100644 --- a/package.json +++ b/package.json @@ -40,7 +40,7 @@ "@cosmjs/encoding": "^0.31.0", "@cosmjs/proto-signing": "^0.31.0", "@cosmjs/stargate": "^0.31.0", - "@finschia/finschia": "0.9.0-rc2", + "@finschia/finschia": "0.9.0", "eslint": "^7.5", "karma-chrome-launcher": "^3.1.0", "karma-jasmine": "^4.0.1", diff --git a/packages/finschia/package.json b/packages/finschia/package.json index 14a310e6..cfbde856 100644 --- a/packages/finschia/package.json +++ b/packages/finschia/package.json @@ -1,6 +1,6 @@ { "name": "@finschia/finschia", - "version": "0.9.0-rc2", + "version": "0.9.0", "description": "Utilities for FINSCHIA v2.0.0", "contributors": [ "zemyblue ", @@ -47,7 +47,7 @@ "@cosmjs/stargate": "^0.31.0", "@cosmjs/tendermint-rpc": "^0.31.0", "@cosmjs/utils": "^0.31.0", - "@finschia/finschia-proto": "^2.0.0-rc5", + "@finschia/finschia-proto": "^2.0.0", "cosmjs-types": "^0.8.0", "long": "^4.0.0", "pako": "^2.0.2", diff --git a/packages/finschia/src/index.ts b/packages/finschia/src/index.ts index 768627ef..ed5d5978 100644 --- a/packages/finschia/src/index.ts +++ b/packages/finschia/src/index.ts @@ -55,6 +55,7 @@ export { createMsgGrant, createMsgRevoke, createMsgSubmitProposal, + createMsgUpdateCensorship, createMsgUpdateDecisionPolicy, createMsgUpdateMembers, createMsgWithdrawFromTreasury, @@ -69,6 +70,7 @@ export { isMsgLeaveFoundationEncodeObject, isMsgRevokeEncodeObject, isMsgSubmitProposalEncodeObject, + isMsgUpdateCensorshipEncodeObject, isMsgUpdateDecisionPolicyEncodeObject, isMsgUpdateMembersEncodeObject, isMsgVoteEncodeObject, @@ -82,6 +84,7 @@ export { MsgLeaveFoundationEncodeObject, MsgRevokeEncodeObject, MsgSubmitProposalEncodeObject, + MsgUpdateCensorshipEncodeObject, MsgUpdateDecisionPolicyEncodeObject, MsgUpdateMembersEncodeObject, MsgVoteEncodeObject, diff --git a/packages/finschia/src/modules/foundation/aminomessages.spec.ts b/packages/finschia/src/modules/foundation/aminomessages.spec.ts index 8001ba20..b7291f1a 100644 --- a/packages/finschia/src/modules/foundation/aminomessages.spec.ts +++ b/packages/finschia/src/modules/foundation/aminomessages.spec.ts @@ -5,6 +5,7 @@ import { AminoTypes, assertIsDeliverTxSuccess, coins, logs } from "@cosmjs/starg import { sleep } from "@cosmjs/utils"; import { ReceiveFromTreasuryAuthorization } from "@finschia/finschia-proto/lbm/foundation/v1/authz"; import { + CensorshipAuthority, PercentageDecisionPolicy, ThresholdDecisionPolicy, VoteOption, @@ -16,6 +17,7 @@ import { MsgGrant, MsgLeaveFoundation, MsgRevoke, + MsgUpdateCensorship, MsgUpdateDecisionPolicy, MsgUpdateMembers, MsgVote, @@ -45,6 +47,7 @@ import { AminoMsgLeaveFoundation, AminoMsgRevoke, AminoMsgSubmitProposal, + AminoMsgUpdateCensorship, AminoMsgUpdateDecisionPolicy, AminoMsgUpdateMembers, AminoMsgVote, @@ -56,8 +59,13 @@ import { } from "./aminomessages"; import { createMsgGrant, + createMsgSubmitProposal, + createMsgUpdateCensorship, createMsgUpdateDecisionPolicy, + createMsgWithdrawFromTreasury, createPercentageDecisionPolicy, + createThresholdDecisionPolicy, + foundationTypes, MsgExecEncodeObject, MsgGrantEncodeObject, MsgLeaveFoundationEncodeObject, @@ -66,12 +74,6 @@ import { MsgWithdrawFromTreasuryEncodeObject, MsgWithdrawProposalEncodeObject, } from "./messages"; -import { - createMsgSubmitProposal, - createMsgWithdrawFromTreasury, - createThresholdDecisionPolicy, - foundationTypes, -} from "./messages"; import { makeClientWithFoundation } from "./queries.spec"; describe("Amino sign", () => { @@ -315,6 +317,28 @@ describe("Amino sign", () => { assertIsDeliverTxSuccess(result); }); + it("MsgUpdateCensorship", async () => { + pendingWithoutSimapp(); + const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic, { + hdPaths: [makeLinkPath(0)], + prefix: simapp.prefix, + }); + const signingFinschiaClient2 = await SigningFinschiaClient.connectWithSigner( + simapp.tendermintUrl, + wallet, + defaultSigningClientOptions, + ); + + const foundationModuleAddr = "link190vt0vxc8c8vj24a7mm3fjsenfu8f5yxxj76cp"; + const msgUpdateCensorship = createMsgUpdateCensorship(foundationModuleAddr, { + msgTypeUrl: "/lbm.foundation.v1.MsgWithdrawFromTreasury", + authority: CensorshipAuthority.CENSORSHIP_AUTHORITY_GOVERNANCE, + }); + const msg1 = createMsgSubmitProposal([faucet.address0], [msgUpdateCensorship]); + const result1 = await signingFinschiaClient2.signAndBroadcast(faucet.address0, [msg1], defaultFee); + assertIsDeliverTxSuccess(result1); + }); + it("MsgUpdateDecisionPolicy ThresholdDecisionPolicy", async () => { pendingWithoutSimapp(); const wallet = await Secp256k1HdWallet.fromMnemonic(faucet.mnemonic, { @@ -643,6 +667,32 @@ describe("AminoTypes", () => { expect(aminoMsg).toEqual(expected); }); + it("MsgUpdateCensorship", () => { + const msg: MsgUpdateCensorship = { + authority: faucet.address0, + censorship: { + msgTypeUrl: "/lbm.foundation.v1.MsgWithdrawFromTreasury", + authority: CensorshipAuthority.CENSORSHIP_AUTHORITY_GOVERNANCE, + }, + }; + const aminoTypes = new AminoTypes(createFoundationAminoConverters()); + const aminoMsg = aminoTypes.toAmino({ + typeUrl: "/lbm.foundation.v1.MsgUpdateCensorship", + value: msg, + }); + const expected: AminoMsgUpdateCensorship = { + type: "lbm-sdk/MsgUpdateCensorship", + value: { + authority: faucet.address0, + censorship: { + msg_type_url: "/lbm.foundation.v1.MsgWithdrawFromTreasury", + authority: 1, + }, + }, + }; + expect(aminoMsg).toEqual(expected); + }); + it("MsgGrant", () => { const msg: MsgGrant = { authority: faucet.address0, @@ -944,6 +994,32 @@ describe("AminoTypes", () => { }); }); + it("MsgUpdateCensorship", () => { + const aminoMsg: AminoMsgUpdateCensorship = { + type: "lbm-sdk/MsgUpdateCensorship", + value: { + authority: faucet.address0, + censorship: { + msg_type_url: "/lbm.foundation.v1.MsgWithdrawFromTreasury", + authority: 1, + }, + }, + }; + const aminoTypes = new AminoTypes(createFoundationAminoConverters()); + const msg = aminoTypes.fromAmino(aminoMsg); + const expectedValue: MsgUpdateCensorship = { + authority: faucet.address0, + censorship: { + msgTypeUrl: "/lbm.foundation.v1.MsgWithdrawFromTreasury", + authority: CensorshipAuthority.CENSORSHIP_AUTHORITY_GOVERNANCE, + }, + }; + expect(msg).toEqual({ + typeUrl: "/lbm.foundation.v1.MsgUpdateCensorship", + value: expectedValue, + }); + }); + it("MsgGrant", () => { const aminoMsg: AminoMsgGrant = { type: "lbm-sdk/MsgGrant", diff --git a/packages/finschia/src/modules/foundation/aminomessages.ts b/packages/finschia/src/modules/foundation/aminomessages.ts index 454593bf..26e445b8 100644 --- a/packages/finschia/src/modules/foundation/aminomessages.ts +++ b/packages/finschia/src/modules/foundation/aminomessages.ts @@ -5,6 +5,7 @@ import { AminoConverter, AminoConverters, AminoTypes } from "@cosmjs/stargate"; import { assertDefinedAndNotNull } from "@cosmjs/utils"; import { ReceiveFromTreasuryAuthorization } from "@finschia/finschia-proto/lbm/foundation/v1/authz"; import { + censorshipAuthorityFromJSON, PercentageDecisionPolicy, ThresholdDecisionPolicy, voteOptionFromJSON, @@ -18,6 +19,7 @@ import { MsgLeaveFoundation, MsgRevoke, MsgSubmitProposal, + MsgUpdateCensorship, MsgUpdateDecisionPolicy, MsgUpdateMembers, MsgVote, @@ -28,6 +30,7 @@ import { CreateValidatorAuthorization } from "@finschia/finschia-proto/lbm/staki import { Any } from "cosmjs-types/google/protobuf/any"; import Long from "long"; +// eslint-disable-next-line import/no-cycle import { createDefaultRegistry, createDefaultTypesWithoutFoundation } from "../../types"; import { jsonDecimalToProto, @@ -46,6 +49,11 @@ interface MemberRequest { metadata?: string; } +interface Censorship { + msg_type_url: string; + authority: number; +} + export interface AminoMsgFundTreasury extends AminoMsg { readonly type: "lbm-sdk/MsgFundTreasury"; readonly value: { @@ -54,7 +62,7 @@ export interface AminoMsgFundTreasury extends AminoMsg { }; } -export function isAminoMsgFundTreasurys(msg: AminoMsg): msg is AminoMsgFundTreasury { +export function isAminoMsgFundTreasury(msg: AminoMsg): msg is AminoMsgFundTreasury { return msg.type === "lbm-sdk/MsgFundTreasury"; } @@ -191,6 +199,18 @@ export function isAminoMsgLeaveFoundation(msg: AminoMsg): msg is AminoMsgLeaveFo return msg.type === "lbm-sdk/MsgLeaveFoundation"; } +export interface AminoMsgUpdateCensorship extends AminoMsg { + readonly type: "lbm-sdk/MsgUpdateCensorship"; + readonly value: { + readonly authority: string; + readonly censorship: Censorship; + }; +} + +export function isAminoMsgUpdateCensorship(msg: AminoMsg): msg is AminoMsgUpdateCensorship { + return msg.type === "lbm-sdk/MsgUpdateCensorship"; +} + export interface AminoMsgGrant extends AminoMsg { readonly type: "lbm-sdk/MsgGrant"; readonly value: { @@ -493,6 +513,28 @@ export function createFoundationAminoConvertersWithoutSubmitProposal(): AminoCon }; }, }, + "/lbm.foundation.v1.MsgUpdateCensorship": { + aminoType: "lbm-sdk/MsgUpdateCensorship", + toAmino: ({ authority, censorship }: MsgUpdateCensorship): AminoMsgUpdateCensorship["value"] => { + assertDefinedAndNotNull(censorship); + return { + authority: authority, + censorship: { + msg_type_url: censorship.msgTypeUrl, + authority: censorship.authority, + }, + }; + }, + fromAmino: ({ authority, censorship }: AminoMsgUpdateCensorship["value"]): MsgUpdateCensorship => { + return { + authority: authority, + censorship: { + msgTypeUrl: censorship.msg_type_url, + authority: censorshipAuthorityFromJSON(censorship.authority), + }, + }; + }, + }, "/lbm.foundation.v1.MsgGrant": { aminoType: "lbm-sdk/MsgGrant", toAmino: ({ authority, grantee, authorization }: MsgGrant): AminoMsgGrant["value"] => { diff --git a/packages/finschia/src/modules/foundation/messages.ts b/packages/finschia/src/modules/foundation/messages.ts index 3dae3ff6..a1cc062c 100644 --- a/packages/finschia/src/modules/foundation/messages.ts +++ b/packages/finschia/src/modules/foundation/messages.ts @@ -2,6 +2,7 @@ import { Decimal } from "@cosmjs/math"; import { EncodeObject, GeneratedType, Registry } from "@cosmjs/proto-signing"; import { ReceiveFromTreasuryAuthorization } from "@finschia/finschia-proto/lbm/foundation/v1/authz"; import { + Censorship, DecisionPolicyWindows, MemberRequest, PercentageDecisionPolicy, @@ -16,6 +17,7 @@ import { MsgLeaveFoundation, MsgRevoke, MsgSubmitProposal, + MsgUpdateCensorship, MsgUpdateDecisionPolicy, MsgUpdateMembers, MsgVote, @@ -37,6 +39,7 @@ export const foundationTypes: ReadonlyArray<[string, GeneratedType]> = [ ["/lbm.foundation.v1.MsgVote", MsgVote], ["/lbm.foundation.v1.MsgExec", MsgExec], ["/lbm.foundation.v1.MsgLeaveFoundation", MsgLeaveFoundation], + ["/lbm.foundation.v1.MsgUpdateCensorship", MsgUpdateCensorship], ["/lbm.foundation.v1.MsgGrant", MsgGrant], ["/lbm.foundation.v1.MsgRevoke", MsgRevoke], ["/lbm.foundation.v1.ReceiveFromTreasuryAuthorization", ReceiveFromTreasuryAuthorization], @@ -140,6 +143,17 @@ export function isMsgLeaveFoundationEncodeObject( return (object as MsgLeaveFoundationEncodeObject).typeUrl === "/lbm.foundation.v1.MsgLeaveFoundation"; } +export interface MsgUpdateCensorshipEncodeObject extends EncodeObject { + readonly typeUrl: "/lbm.foundation.v1.MsgUpdateCensorship"; + readonly value: Partial; +} + +export function isMsgUpdateCensorshipEncodeObject( + object: EncodeObject, +): object is MsgUpdateCensorshipEncodeObject { + return (object as MsgUpdateCensorshipEncodeObject).typeUrl === "/lbm.foundation.v1.MsgUpdateCensorship"; +} + export interface MsgGrantEncodeObject extends EncodeObject { readonly typeUrl: "/lbm.foundation.v1.MsgGrant"; readonly value: Partial; @@ -203,6 +217,19 @@ export function createMsgSubmitProposal( }; } +export function createMsgUpdateCensorship( + authority: string, + censorship: Censorship, +): MsgUpdateCensorshipEncodeObject { + return { + typeUrl: "/lbm.foundation.v1.MsgUpdateCensorship", + value: { + authority: authority, + censorship: censorship, + }, + }; +} + export function createMsgGrant(authority: string, grantee: string): MsgGrantEncodeObject { const registry = new Registry(foundationTypes); return { diff --git a/packages/finschia/src/modules/foundation/queries.spec.ts b/packages/finschia/src/modules/foundation/queries.spec.ts index c0686e6c..2737987f 100644 --- a/packages/finschia/src/modules/foundation/queries.spec.ts +++ b/packages/finschia/src/modules/foundation/queries.spec.ts @@ -5,6 +5,8 @@ import { assertIsDeliverTxSuccess, logs, QueryClient } from "@cosmjs/stargate"; import { Tendermint34Client } from "@cosmjs/tendermint-rpc"; import { sleep } from "@cosmjs/utils"; import { + Censorship, + CensorshipAuthority, MemberRequest, ThresholdDecisionPolicy, } from "@finschia/finschia-proto/lbm/foundation/v1/foundation"; @@ -388,6 +390,24 @@ describe("FoundationExtension", () => { }); }); + describe("Censorship", () => { + it("work", async () => { + pendingWithoutSimapp(); + const [client, tmClient] = await makeClientWithFoundation(simapp.tendermintUrl); + + const result = await client.foundation.censorship(); + expect(result).not.toBeUndefined(); + expect(result.censorships.length).toEqual(1); + const expected: Censorship = { + msgTypeUrl: "/lbm.foundation.v1.MsgWithdrawFromTreasury", + authority: CensorshipAuthority.CENSORSHIP_AUTHORITY_FOUNDATION, + }; + expect(result.censorships[0]).toEqual(expected); + + tmClient.disconnect(); + }); + }); + describe("Tally Result", () => { let proposalId: Long; beforeAll(async () => { diff --git a/packages/finschia/src/modules/foundation/queries.ts b/packages/finschia/src/modules/foundation/queries.ts index 7fffb9c8..a54ee2da 100644 --- a/packages/finschia/src/modules/foundation/queries.ts +++ b/packages/finschia/src/modules/foundation/queries.ts @@ -1,6 +1,5 @@ import { Uint64 } from "@cosmjs/math"; import { createPagination, createProtobufRpcClient, QueryClient } from "@cosmjs/stargate"; -import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin"; import { FoundationInfo, Member, @@ -10,12 +9,14 @@ import { Vote, } from "@finschia/finschia-proto/lbm/foundation/v1/foundation"; import { + QueryCensorshipsResponse, QueryClientImpl, QueryGrantsResponse, QueryMembersResponse, QueryProposalsResponse, QueryVotesResponse, } from "@finschia/finschia-proto/lbm/foundation/v1/query"; +import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin"; import { longify } from "../../utils"; @@ -36,6 +37,7 @@ export interface FoundationExtension { paginationKey?: Uint8Array, ) => Promise; readonly tallyResult: (proposalId: FoundationProposalId) => Promise; + readonly censorship: (paginationKey?: Uint8Array) => Promise; readonly grants: ( grantee: string, msgTypeUrl: string, @@ -93,6 +95,9 @@ export function setupFoundationExtension(base: QueryClient): FoundationExtension const response = await queryService.TallyResult({ proposalId: longify(proposalId) }); return response.tally; }, + censorship: async (paginationKey?: Uint8Array) => { + return await queryService.Censorships({ pagination: createPagination(paginationKey) }); + }, grants: async (grantee: string, msgTypeUrl: string, paginationKey?: Uint8Array) => { return await queryService.Grants({ grantee: grantee, diff --git a/packages/finschia/src/modules/index.ts b/packages/finschia/src/modules/index.ts index e424116a..89898410 100644 --- a/packages/finschia/src/modules/index.ts +++ b/packages/finschia/src/modules/index.ts @@ -49,11 +49,13 @@ export { export { CollectionExtension, setupCollectionExtension } from "./collection/queries"; export { EvidenceExtension, setupEvidenceExtension } from "./evidence/queries"; export { FeeGrantExtension, setupFeeGrantExtension } from "./feegrant/queries"; +// eslint-disable-next-line import/no-cycle export { createFoundationAminoConverters } from "./foundation/aminomessages"; export { createMsgGrant, createMsgRevoke, createMsgSubmitProposal, + createMsgUpdateCensorship, createMsgUpdateDecisionPolicy, createMsgUpdateMembers, createMsgWithdrawFromTreasury, @@ -66,6 +68,7 @@ export { isMsgLeaveFoundationEncodeObject, isMsgRevokeEncodeObject, isMsgSubmitProposalEncodeObject, + isMsgUpdateCensorshipEncodeObject, isMsgUpdateDecisionPolicyEncodeObject, isMsgUpdateMembersEncodeObject, isMsgVoteEncodeObject, @@ -79,6 +82,7 @@ export { MsgLeaveFoundationEncodeObject, MsgRevokeEncodeObject, MsgSubmitProposalEncodeObject, + MsgUpdateCensorshipEncodeObject, MsgUpdateDecisionPolicyEncodeObject, MsgUpdateMembersEncodeObject, MsgVoteEncodeObject, diff --git a/scripts/finschia/env b/scripts/finschia/env index 30d8252e..dd9626f0 100644 --- a/scripts/finschia/env +++ b/scripts/finschia/env @@ -1,4 +1,4 @@ # Choose from https://hub.docker.com/r/finschia/finschianode/tags REPOSITORY="finschia/finschianode" -VERSION="2.0.0-rc5" +VERSION="2.0.0" CONTAINER_NAME="finschia-app" diff --git a/scripts/finschia/template/.finschia/config/config.toml b/scripts/finschia/template/.finschia/config/config.toml index 78cedd44..2e2f34d1 100644 --- a/scripts/finschia/template/.finschia/config/config.toml +++ b/scripts/finschia/template/.finschia/config/config.toml @@ -86,13 +86,16 @@ priv_validator_state_file = "data/priv_validator_state.json" # TCP or UNIX socket address for Ostracon to listen on for # connections from an external PrivValidator process +# If this value is set, key file(priv_validator_key.json) will not be generated. # example) tcp://0.0.0.0:26659 priv_validator_laddr = "" # Validator's remote address to allow a connection -# ostracon only allow a connection from this address +# Comma separated list of addresses to allow +# ostracon only allows a connection from these addresses separated by a comma # example) 127.0.0.1 -priv_validator_raddr = "127.0.0.1" +# example) 127.0.0.1,192.168.1.2 +priv_validator_raddrs = "127.0.0.1" # Path to the JSON file containing the private key to use for node authentication in the p2p protocol node_key_file = "config/node_key.json" diff --git a/scripts/finschia/template/.finschia/config/genesis.json b/scripts/finschia/template/.finschia/config/genesis.json index 49eac373..d2346612 100644 --- a/scripts/finschia/template/.finschia/config/genesis.json +++ b/scripts/finschia/template/.finschia/config/genesis.json @@ -1,5 +1,5 @@ { - "genesis_time": "2023-04-03T08:52:38.610633Z", + "genesis_time": "2023-10-20T09:05:44.853293671Z", "chain_id": "simd-testing", "initial_height": "1", "consensus_params": { @@ -273,7 +273,27 @@ "amount": "220000000000" } ], - "denom_metadata": [] + "denom_metadata": [ + { + "description": "The fee token of this test chain", + "denom_units": [ + { + "denom": "cony", + "exponent": 0, + "aliases": ["microfinschia"] + }, + { + "denom": "finschia", + "exponent": 6, + "aliases": [] + } + ], + "base": "cony", + "display": "finschia", + "name": "FINSCHIA", + "symbol": "FNSA" + } + ] }, "capability": { "index": "1", @@ -359,10 +379,6 @@ { "authority": 2, "msg_type_url": "/lbm.foundation.v1.MsgWithdrawFromTreasury" - }, - { - "authority": 2, - "msg_type_url": "/lbm.foundation.v1.MsgUpdateParams" } ] }, diff --git a/scripts/finschia/template/setup.sh b/scripts/finschia/template/setup.sh index 9149bfee..1f6370e1 100755 --- a/scripts/finschia/template/setup.sh +++ b/scripts/finschia/template/setup.sh @@ -11,7 +11,10 @@ source "$SCRIPT_DIR"/../env CHAIN_ID="simd-testing" MONIKER="simd-testing" CONFIG_DIR=${SCRIPT_DIR}/.finschia -CHAIN_DIR=${CONFIG_DIR} +if [[ -z "${CHAIN_DIR}" ]] +then + CHAIN_DIR=${CONFIG_DIR} +fi if [[ $1 == "docker" ]] then diff --git a/scripts/simapp/env b/scripts/simapp/env index 1a8e19f9..832d9f11 100644 --- a/scripts/simapp/env +++ b/scripts/simapp/env @@ -1,4 +1,4 @@ # Choose from https://hub.docker.com/r/finschia/finschia-simapp/tags REPOSITORY="finschia/finschia-simapp" -VERSION="0.47.0" +VERSION="0.48.0" CONTAINER_NAME="finschia-simapp" diff --git a/scripts/simapp/template/.simapp/config/app.toml b/scripts/simapp/template/.simapp/config/app.toml index 0d004b0d..952eac32 100644 --- a/scripts/simapp/template/.simapp/config/app.toml +++ b/scripts/simapp/template/.simapp/config/app.toml @@ -62,8 +62,8 @@ inter-block-cache-size = 104857600 iavl-cache-size = 524288 # IAVLDisableFastNode enables or disables the fast node feature of IAVL. -# Default is false. -iavl-disable-fastnode = false +# Default is true. +iavl-disable-fastnode = true # IndexEvents defines the set of events in the form {eventType}.{attributeKey}, # which informs Tendermint what to index. If empty, all events will be indexed. @@ -183,6 +183,14 @@ enable = true # Address defines the gRPC server address to bind to. address = "0.0.0.0:9090" +# MaxRecvMsgSize defines the max message size in bytes the server can receive. +# The default value is 10MB. +max-recv-msg-size = "10485760" + +# MaxSendMsgSize defines the max message size in bytes the server can send. +# The default value is math.MaxInt32. +max-send-msg-size = "2147483647" + ############################################################################### ### gRPC Web Configuration ### ############################################################################### diff --git a/scripts/simapp/template/.simapp/config/config.toml b/scripts/simapp/template/.simapp/config/config.toml index f732c1d5..2e2f34d1 100644 --- a/scripts/simapp/template/.simapp/config/config.toml +++ b/scripts/simapp/template/.simapp/config/config.toml @@ -86,8 +86,17 @@ priv_validator_state_file = "data/priv_validator_state.json" # TCP or UNIX socket address for Ostracon to listen on for # connections from an external PrivValidator process +# If this value is set, key file(priv_validator_key.json) will not be generated. +# example) tcp://0.0.0.0:26659 priv_validator_laddr = "" +# Validator's remote address to allow a connection +# Comma separated list of addresses to allow +# ostracon only allows a connection from these addresses separated by a comma +# example) 127.0.0.1 +# example) 127.0.0.1,192.168.1.2 +priv_validator_raddrs = "127.0.0.1" + # Path to the JSON file containing the private key to use for node authentication in the p2p protocol node_key_file = "config/node_key.json" @@ -210,12 +219,15 @@ experimental_close_on_slow_client = false # How long to wait for a tx to be committed during /broadcast_tx_commit. # WARNING: Using a value larger than 'WriteTimeout' will result in increasing the # global HTTP write timeout, which applies to all connections and endpoints. -# See https://github.com/line/ostracon/issues/3435 +# See https://github.com/tendermint/tendermint/issues/3435 timeout_broadcast_tx_commit = "10s" # Maximum size of request body, in bytes max_body_bytes = 1000000 +# Maximum number of requests in a request body +max_batch_request_num = 10 + # Maximum size of request header, in bytes max_header_bytes = 1048576 @@ -327,6 +339,11 @@ statesync_recv_buf_size = 1000 ####################################################### [mempool] +# Mempool version to use: +# 1) "v0" - (default) FIFO mempool. +# 2) "v1" - prioritized mempool. +version = "v0" + recheck = true broadcast = true wal_dir = "" @@ -353,9 +370,25 @@ max_tx_bytes = 1048576 # Maximum size of a batch of transactions to send to a peer # Including space needed by encoding (one varint per transaction). -# XXX: Unused due to https://github.com/line/ostracon/issues/5796 +# XXX: Unused due to https://github.com/tendermint/tendermint/issues/5796 max_batch_bytes = 0 +# ttl-duration, if non-zero, defines the maximum amount of time a transaction +# can exist for in the mempool. +# +# Note, if ttl-num-blocks is also defined, a transaction will be removed if it +# has existed in the mempool at least ttl-num-blocks number of blocks or if it's +# insertion time into the mempool is beyond ttl-duration. +ttl-duration = "0s" + +# ttl-num-blocks, if non-zero, defines the maximum number of blocks a transaction +# can exist for in the mempool. +# +# Note, if ttl-duration is also defined, a transaction will be removed if it +# has existed in the mempool at least ttl-num-blocks number of blocks or if +# it's insertion time into the mempool is beyond ttl-duration. +ttl-num-blocks = 0 + ####################################################### ### State Sync Configuration Options ### ####################################################### @@ -447,6 +480,17 @@ max_txs = 0 peer_gossip_sleep_duration = "100ms" peer_query_maj23_sleep_duration = "2s" +####################################################### +### Storage Configuration Options ### +####################################################### +[storage] + +# Set to true to discard ABCI responses from the state store, which can save a +# considerable amount of disk space. Set to false to ensure ABCI responses are +# persisted. ABCI responses are required for /block_results RPC queries, and to +# reindex events in the command-line tool. +discard_abci_responses = false + ####################################################### ### Transaction Indexer Configuration Options ### ####################################################### @@ -461,8 +505,14 @@ peer_query_maj23_sleep_duration = "2s" # 1) "null" # 2) "kv" (default) - the simplest possible indexer, backed by key-value storage (defaults to levelDB; see DBBackend). # - When "kv" is chosen "tx.height" and "tx.hash" will always be indexed. +# 3) "psql" - the indexer services backed by PostgreSQL. +# When "kv" or "psql" is chosen "tx.height" and "tx.hash" will always be indexed. indexer = "kv" +# The PostgreSQL connection configuration, the connection format: +# postgresql://:@:/? +psql-conn = "" + ####################################################### ### Instrumentation Configuration Options ### ####################################################### diff --git a/scripts/simapp/template/.simapp/config/genesis.json b/scripts/simapp/template/.simapp/config/genesis.json index d132170f..a486cafd 100644 --- a/scripts/simapp/template/.simapp/config/genesis.json +++ b/scripts/simapp/template/.simapp/config/genesis.json @@ -1,5 +1,5 @@ { - "genesis_time": "2023-05-02T02:20:24.731517Z", + "genesis_time": "2023-10-23T08:33:31.106710587Z", "chain_id": "simd-testing", "initial_height": "1", "consensus_params": { @@ -14,7 +14,9 @@ "max_bytes": "1048576" }, "validator": { - "pub_key_types": ["ed25519"] + "pub_key_types": [ + "ed25519" + ] }, "version": {} }, @@ -278,16 +280,18 @@ { "denom": "cony", "exponent": 0, - "aliases": [] + "aliases": ["microfinschia"] }, { - "denom": "LN", + "denom": "finschia", "exponent": 6, "aliases": [] } ], - "base": "LINK", - "display": "LN" + "base": "cony", + "display": "finschia", + "name": "FINSCHIA", + "symbol": "FNSA" } ] }, @@ -375,10 +379,6 @@ { "authority": 2, "msg_type_url": "/lbm.foundation.v1.MsgWithdrawFromTreasury" - }, - { - "authority": 2, - "msg_type_url": "/lbm.foundation.v1.MsgUpdateParams" } ] }, diff --git a/scripts/with-ibc/finschia/env b/scripts/with-ibc/finschia/env index 30d8252e..dd9626f0 100644 --- a/scripts/with-ibc/finschia/env +++ b/scripts/with-ibc/finschia/env @@ -1,4 +1,4 @@ # Choose from https://hub.docker.com/r/finschia/finschianode/tags REPOSITORY="finschia/finschianode" -VERSION="2.0.0-rc5" +VERSION="2.0.0" CONTAINER_NAME="finschia-app" diff --git a/scripts/with-ibc/finschia/template/.finschia/config/config.toml b/scripts/with-ibc/finschia/template/.finschia/config/config.toml index 78cedd44..2e2f34d1 100644 --- a/scripts/with-ibc/finschia/template/.finschia/config/config.toml +++ b/scripts/with-ibc/finschia/template/.finschia/config/config.toml @@ -86,13 +86,16 @@ priv_validator_state_file = "data/priv_validator_state.json" # TCP or UNIX socket address for Ostracon to listen on for # connections from an external PrivValidator process +# If this value is set, key file(priv_validator_key.json) will not be generated. # example) tcp://0.0.0.0:26659 priv_validator_laddr = "" # Validator's remote address to allow a connection -# ostracon only allow a connection from this address +# Comma separated list of addresses to allow +# ostracon only allows a connection from these addresses separated by a comma # example) 127.0.0.1 -priv_validator_raddr = "127.0.0.1" +# example) 127.0.0.1,192.168.1.2 +priv_validator_raddrs = "127.0.0.1" # Path to the JSON file containing the private key to use for node authentication in the p2p protocol node_key_file = "config/node_key.json" diff --git a/scripts/with-ibc/finschia/template/.finschia/config/genesis.json b/scripts/with-ibc/finschia/template/.finschia/config/genesis.json index 49eac373..79411e07 100644 --- a/scripts/with-ibc/finschia/template/.finschia/config/genesis.json +++ b/scripts/with-ibc/finschia/template/.finschia/config/genesis.json @@ -359,10 +359,6 @@ { "authority": 2, "msg_type_url": "/lbm.foundation.v1.MsgWithdrawFromTreasury" - }, - { - "authority": 2, - "msg_type_url": "/lbm.foundation.v1.MsgUpdateParams" } ] }, diff --git a/scripts/with-ibc/finschia2/env b/scripts/with-ibc/finschia2/env index 163d8939..4a15f1a4 100644 --- a/scripts/with-ibc/finschia2/env +++ b/scripts/with-ibc/finschia2/env @@ -1,4 +1,4 @@ # Choose from https://hub.docker.com/r/finschia/finschianode/tags REPOSITORY="finschia/finschianode" -VERSION="2.0.0-rc5" +VERSION="2.0.0" CONTAINER_NAME="finschia2-app" diff --git a/scripts/with-ibc/finschia2/template/.finschia/config/config.toml b/scripts/with-ibc/finschia2/template/.finschia/config/config.toml index b9e1b6bd..205ae403 100644 --- a/scripts/with-ibc/finschia2/template/.finschia/config/config.toml +++ b/scripts/with-ibc/finschia2/template/.finschia/config/config.toml @@ -86,13 +86,16 @@ priv_validator_state_file = "data/priv_validator_state.json" # TCP or UNIX socket address for Ostracon to listen on for # connections from an external PrivValidator process +# If this value is set, key file(priv_validator_key.json) will not be generated. # example) tcp://0.0.0.0:26659 priv_validator_laddr = "" # Validator's remote address to allow a connection -# ostracon only allow a connection from this address +# Comma separated list of addresses to allow +# ostracon only allows a connection from these addresses separated by a comma # example) 127.0.0.1 -priv_validator_raddr = "127.0.0.1" +# example) 127.0.0.1,192.168.1.2 +priv_validator_raddrs = "127.0.0.1" # Path to the JSON file containing the private key to use for node authentication in the p2p protocol node_key_file = "config/node_key.json" diff --git a/yarn.lock b/yarn.lock index 272df13f..ffd66646 100644 --- a/yarn.lock +++ b/yarn.lock @@ -393,10 +393,10 @@ minimatch "^3.0.4" strip-json-comments "^3.1.1" -"@finschia/finschia-proto@^2.0.0-rc5": - version "2.0.0-rc5" - resolved "https://registry.yarnpkg.com/@finschia/finschia-proto/-/finschia-proto-2.0.0-rc5.tgz#6b2b2e21598a7129c9c3ede64f31fb527f26aeda" - integrity sha512-UCwcmN6yCvkGdKOXwu/Dt3pGMSPOotXsHtTbmZjuJ457oijVTkAqUWnYKA9bITeRGI4FM00i4aJmGngj2hULzQ== +"@finschia/finschia-proto@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@finschia/finschia-proto/-/finschia-proto-2.0.0.tgz#c0a00bede1a330d6ff1d5370c2620ff2542bbe6b" + integrity sha512-HZF/BvYaUmDGjTWRGC8dgdQ0IZEAUPJEeL7SLonAdIaGDRmrReAy9CJ19nEct5Epks+FgXCABbiXz45r+eG71w== dependencies: long "^4.0.0" protobufjs "~6.11.2"