cosmos / sdk-tutorials Goto Github PK
View Code? Open in Web Editor NEWTutorials for building modules for the Cosmos SDK
Home Page: https://tutorials.cosmos.network/
License: Apache License 2.0
Tutorials for building modules for the Cosmos SDK
Home Page: https://tutorials.cosmos.network/
License: Apache License 2.0
Currently there are three stores for the nameservice module. I think we should collapse them into one. This would have the following benefits:
types.go
file to the module for the struct that would contain {value, price, owner}
, which would help readers understand its use. They will likely have to have one if they ever build their own module.when i edit the config file of another node as below:
seeds = "[email protected]:26656"
I start the new node,but errors show:
I[2019-06-28|15:49:16.935] Starting ABCI with Tendermint module=main
E[2019-06-28|15:49:16.984] Error signing vote module=consensus height=1 round=0 vote="Vote{0:E4496DC3C236 1/00/1(Prevote) 000000000000 000000000000 @ 2019-06-28T07:49:16.984694763Z}" err="error signing vote: height regression. Got 1, last height 710"
E[2019-06-28|15:49:16.986] Error dialing seed module=p2p err="dial tcp 10.168.15.121:26656: connect: no route to host" [email protected]:26656
E[2019-06-28|15:49:16.986] Couldn't connect to any seeds module=p2p
how to solve this problem?
I followed the guide, but got error when start
ERROR: error during handshake: error on replay: validator set is nil in genesis and still empty after InitChain
I try to buy-name by using CLI and it works. However, I try to buy-name by using REST API and It doesn't work. The command I used is as follow as below.
curl -XPOST -s -k http://localhost:1317/nameservice/names --data-binary '{"base_req":{"from":"jack","password":"12345678","chain_id":"namechain","sequence":"0","account_number":"0"},"name":"jack1.id","amount":"5nametoken","buyer":"$(nscli keys show jack -a)"}' | jq .
Output:
{
"error": "invalid from address: jack"
}
Which I run these commands below to init chain.
# Initialize configuration files and genesis file
nsd init --chain-id namechain
# Copy the `Address` output here and save it for later use
# [optional] add "--ledger" at the end to use a Ledger Nano S
echo 12345678 | nscli keys add jack
# Copy the `Address` output here and save it for later use
echo 12345678 | nscli keys add alice
# Add both accounts, with coins to the genesis file
nsd add-genesis-account $(nscli keys show jack -a) 1000nametoken,1000jackcoin
nsd add-genesis-account $(nscli keys show alice -a) 1000nametoken,1000alicecoin
Please help advice.
no REST endpoint for accessing all names
After finishing the tutorial, and copy and pasting everything in, I am getting the errors below. Maybe they are due to my own mistakes, but they look like changed apis. Pasting them here before I try to solve them.
jehan@Jehans-MacBook
~/cosname
$ make install
GO111MODULE=on go install -tags "" ./cmd/nsd
# github.com/cosmos/cosmos-sdk/crypto/keys/mintkey
../work/pkg/mod/github.com/cosmos/[email protected]/crypto/keys/mintkey/mintkey.go:109:41: too many arguments in call to bcrypt.GenerateFromPassword
have ([]byte, []byte, int)
want ([]byte, int)
../work/pkg/mod/github.com/cosmos/[email protected]/crypto/keys/mintkey/mintkey.go:143:41: too many arguments in call to bcrypt.GenerateFromPassword
have ([]byte, []byte, int)
want ([]byte, int)
# github.com/jtremback/cosname/x/nameservice
x/nameservice/keeper.go:20:62: undefined: Whois
x/nameservice/keeper.go:29:56: undefined: Whois
x/nameservice/keeper.go:32:10: undefined: NewWhois
x/nameservice/keeper.go:35:12: undefined: Whois
x/nameservice/querier.go:79:9: undefined: Whois
make: *** [install] Error 2
How can I see the history of all transactions?
The examples given here: https://github.com/cosmos/sdk-application-tutorial/blob/master/tutorial/run-rest.md
no longer work. If one adjusts the curl commands as posted here:
#76
then the results are unsigned jsons and no working buy-name is broadcasted. It would be nice to adjust the run-rest.md so that a working example is given.
When the nsd blockchain is running, I can go to http://localhost:26657/ to see all the available endpoints.
Is it possible to create a similar user experience when it comes to nscli rest server? providing the user with json-rpc endpoints that can be used to GET account balances, resolve names or send transactions?
If such a feature already exists, could someone point me to it?
and CircleCI
Hi, I am trying to make this tutorial work. I followed along with it, but when I try to run 'make install' it give me this error:
GO111MODULE=on go mod verify all modules verified go install -mod=readonly ./cmd/nsd build flag -mod=readonly only valid when using modules Makefile:6: recipe for target 'install' failed make: *** [install] Error 1
and when I try to run 'go build nsd.go' or 'go build nscli.go', I get this error:
# github.com/tendermint/tendermint/crypto/ed25519 /media/thomas/Storage/Documents/Programming/go/src/github.com/tendermint/tendermint/crypto/ed25519/ed25519.go:108:13: undefined: ed25519.NewKeyFromSeed /media/thomas/Storage/Documents/Programming/go/src/github.com/tendermint/tendermint/crypto/ed25519/ed25519.go:121:13: undefined: ed25519.NewKeyFromSeed github.com/tendermint/iavl /media/thomas/Storage/Documents/Programming/go/src/github.com/tendermint/iavl/node.go:112:3: undefined: common.ColoredBytes /media/thomas/Storage/Documents/Programming/go/src/github.com/tendermint/iavl/node.go:112:30: undefined: common.Green /media/thomas/Storage/Documents/Programming/go/src/github.com/tendermint/iavl/node.go:112:41: undefined: common.Blue /media/thomas/Storage/Documents/Programming/go/src/github.com/tendermint/iavl/node.go:113:3: undefined: common.ColoredBytes /media/thomas/Storage/Documents/Programming/go/src/github.com/tendermint/iavl/node.go:113:32: undefined: common.Cyan /media/thomas/Storage/Documents/Programming/go/src/github.com/tendermint/iavl/node.go:113:42: undefined: common.Blue
Does anyone know how to resolve these? Thanks!
I get the following when I'm trying to build the app:
make install
GO111MODULE=on go install -tags " ledger" ./cmd/nsd
../../go/pkg/mod/github.com/cosmos/[email protected]/crypto/keys/mintkey/mintkey.go:109:41: too many arguments in call to bcrypt.GenerateFromPassword
have ([]byte, []byte, int)
want ([]byte, int)
../../go/pkg/mod/github.com/cosmos/[email protected]/crypto/keys/mintkey/mintkey.go:143:41: too many arguments in call to bcrypt.GenerateFromPassword
have ([]byte, []byte, int)
want ([]byte, int)
../../go/pkg/mod/github.com/cosmos/[email protected]/crypto/ledger_real.go:17:3: cannot use device (type *ledger_cosmos_go.LedgerCosmos) as type LedgerSECP256K1 in return argument:
*ledger_cosmos_go.LedgerCosmos does not implement LedgerSECP256K1 (missing ShowAddressSECP256K1 method)
make: *** [install] Error 2
If I'm leaving out the ledger import I get a similar error.
This error is reported from the example code in the tutorial.
app.go:12:2: unknown import path "github.com/tendermint/tendermint/libs/db": cannot find module providing package github.com/tendermint/tendermint/libs/db
Should it now be github.com/tendermint/tm-db
?
Hi,
Currently I'm developing under sdk-tutorial's guide and there is no dependency setting doc in web tutorial.
https://cosmos.network/docs/tutorial/gomod.html
And it seems to be outdated in github tutorial.
If you don't provide go.mod and install by only go get
, the CLI&daemon build fails like cosmos/cosmos-sdk#4179
Please update the doc the latest version :)
Many thanks,
Bryan
When running the tutorial locally, the nscli query nameservice resolve jack.id
command doesn't work. I'd tried the same a few days back (before the update to update to sdk 0.37) and it worked then.
$ nscli query nameservice resolve jack.id
could not resolve name - jack.id
Error in the nsd console:
I[2019-09-06|14:05:07.634] Committed state module=state height=7 txs=0 appHash=3B051114B03B6B10C2CA9125091AB0CF037294A876F71F5F3C21AB39329ED554
I[2019-09-06|14:05:12.655] Executed block module=state height=8 validTxs=0 invalidTxs=1
I[2019-09-06|14:05:12.660] Committed state module=state height=8 txs=1 appHash=4B8EDA374F491A1B77F5F9321485B198729EC2B608BC2C296502FB132B6AB592
E[2019-09-06|14:05:16.317] Panic in RPC HTTP handler module=rpc-server err="interface conversion: interface is nil, not types.KVStore" stack="goroutine 193 [running]:\nruntime/debug.Stack(0xc000268ed0, 0xfe5ea0, 0xc0026132c0)\n\t/usr/local/go/src/runtime/debug/stack.go:24 +0x9d\ngithub.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1.1(0xc0025feb20, 0x14e26e0, 0xc000add980, 0xbf54a47112e8a093, 0xa3e924c6a, 0x1ce8400, 0xc000a5d400)\n\t/home/ashwinp/go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:161 +0x486\npanic(0xfe5ea0, 0xc0026132c0)\n\t/usr/local/go/src/runtime/panic.go:679 +0x1b2\ngithub.com/cosmos/cosmos-sdk/store/cachemulti.Store.GetKVStore(...)\n\t/home/ashwinp/go/pkg/mod/github.com/cosmos/[email protected]/store/cachemulti/store.go:143\ngithub.com/cosmos/cosmos-sdk/types.Context.KVStore(0x14e1c20, 0xc00003a120, 0x14f1f00, 0xc0025737c0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/ashwinp/go/pkg/mod/github.com/cosmos/[email protected]/types/context.go:200 +0x89\ngithub.com/cosmos/sdk-application-tutorial/x/nameservice/internal/keeper.Keeper.GetWhois(0x14f4880, 0xc0003621c0, 0x14d3200, 0x0, 0xc000108150, 0x14e1c20, 0xc00003a120, 0x14f1f00, 0xc0025737c0, 0xa, ...)\n\t/home/ashwinp/projects/wireline/sdk-application-tutorial/x/nameservice/internal/keeper/keeper.go:30 +0x98\ngithub.com/cosmos/sdk-application-tutorial/x/nameservice/internal/keeper.Keeper.ResolveName(...)\n\t/home/ashwinp/projects/wireline/sdk-application-tutorial/x/nameservice/internal/keeper/keeper.go:57\ngithub.com/cosmos/sdk-application-tutorial/x/nameservice/internal/keeper.queryResolve(0x14e1c20, 0xc00003a120, 0x14f1f00, 0xc0025737c0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/ashwinp/projects/wireline/sdk-application-tutorial/x/nameservice/internal/keeper/querier.go:36 +0x100\ngithub.com/cosmos/sdk-application-tutorial/x/nameservice/internal/keeper.NewQuerier.func1(0x14e1c20, 0xc00003a120, 0x14f1f00, 0xc0025737c0, 0xa, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/ashwinp/projects/wireline/sdk-application-tutorial/x/nameservice/internal/keeper/querier.go:23 +0x213\ngithub.com/cosmos/cosmos-sdk/baseapp.handleQueryCustom(0xc0000c2900, 0xc002573780, 0x4, 0x4, 0x1d05818, 0x0, 0x0, 0xc000adf020, 0x22, 0x8, ...)\n\t/home/ashwinp/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:601 +0x5c9\ngithub.com/cosmos/cosmos-sdk/baseapp.(*BaseApp).Query(0xc0000c2900, 0x1d05818, 0x0, 0x0, 0xc000adf020, 0x22, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/ashwinp/go/pkg/mod/github.com/cosmos/[email protected]/baseapp/baseapp.go:463 +0x2e8\ngithub.com/tendermint/tendermint/abci/client.(*localClient).QuerySync(0xc000095500, 0x1d05818, 0x0, 0x0, 0xc000adf020, 0x22, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/ashwinp/go/pkg/mod/github.com/tendermint/[email protected]/abci/client/local_client.go:207 +0x10e\ngithub.com/tendermint/tendermint/proxy.(*appConnQuery).QuerySync(0xc000329270, 0x1d05818, 0x0, 0x0, 0xc000adf020, 0x22, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/ashwinp/go/pkg/mod/github.com/tendermint/[email protected]/proxy/app_conn.go:143 +0x6a\ngithub.com/tendermint/tendermint/rpc/core.ABCIQuery(0xc0025feb60, 0xc000adf020, 0x22, 0x1d05818, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)\n\t/home/ashwinp/go/pkg/mod/github.com/tendermint/[email protected]/rpc/core/abci.go:57 +0x114\nreflect.Value.call(0xff1180, 0x1331440, 0x13, 0x1137474, 0x4, 0xc002589e80, 0x5, 0x5, 0x5, 0x18, ...)\n\t/usr/local/go/src/reflect/value.go:460 +0x5f6\nreflect.Value.Call(0xff1180, 0x1331440, 0x13, 0xc002589e80, 0x5, 0x5, 0x4, 0x4, 0x0)\n\t/usr/local/go/src/reflect/value.go:321 +0xb4\ngithub.com/tendermint/tendermint/rpc/lib/server.makeJSONRPCHandler.func1(0x14dd220, 0xc0025feb20, 0xc000a5d400)\n\t/home/ashwinp/go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/handlers.go:157 +0x905\ngithub.com/tendermint/tendermint/rpc/lib/server.handleInvalidJSONRPCPaths.func1(0x14dd220, 0xc0025feb20, 0xc000a5d400)\n\t/home/ashwinp/go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/handlers.go:181 +0x9c\nnet/http.HandlerFunc.ServeHTTP(0xc000329430, 0x14dd220, 0xc0025feb20, 0xc000a5d400)\n\t/usr/local/go/src/net/http/server.go:2007 +0x44\nnet/http.(*ServeMux).ServeHTTP(0xc000499800, 0x14dd220, 0xc0025feb20, 0xc000a5d400)\n\t/usr/local/go/src/net/http/server.go:2387 +0x1bd\ngithub.com/tendermint/tendermint/rpc/lib/server.maxBytesHandler.ServeHTTP(0x14c5160, 0xc000499800, 0xf4240, 0x14dd220, 0xc0025feb20, 0xc000a5d400)\n\t/home/ashwinp/go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:206 +0xcf\ngithub.com/tendermint/tendermint/rpc/lib/server.RecoverAndLogHandler.func1(0x14dd920, 0xc0000e36c0, 0xc000a5d400)\n\t/home/ashwinp/go/pkg/mod/github.com/tendermint/[email protected]/rpc/lib/server/http_server.go:179 +0x33f\nnet/http.HandlerFunc.ServeHTTP(0xc000306c30, 0x14dd920, 0xc0000e36c0, 0xc000a5d400)\n\t/usr/local/go/src/net/http/server.go:2007 +0x44\nnet/http.serverHandler.ServeHTTP(0xc0003636c0, 0x14dd920, 0xc0000e36c0, 0xc000a5d400)\n\t/usr/local/go/src/net/http/server.go:2802 +0xa4\nnet/http.(*conn).serve(0xc002210820, 0x14e1be0, 0xc002573600)\n\t/usr/local/go/src/net/http/server.go:1890 +0x875\ncreated by net/http.(*Server).Serve\n\t/usr/local/go/src/net/http/server.go:2927 +0x38e\n"
I[2019-09-06|14:05:17.678] Executed block module=state height=9 validTxs=0 invalidTxs=0
I[2019-09-06|14:05:17.682] Committed state module=state height=9 txs=0 appHash=5A53A6A462301CAA4497B4C2C8260A229044ADEF5CCE3F4D06BEACD25D18ECA3
I[2019-09-06|14:05:22.701] Executed block module=state height=10 validTxs=0 invalidTxs=0
The earlier transactions seem to have gone through fine:
$ nscli tx nameservice buy-name jack.id 5nametoken --from jack
{
"chain_id": "namechain",
"account_number": "0",
"sequence": "1",
"fee": {
"amount": [],
"gas": "200000"
},
"msgs": [
{
"type": "nameservice/BuyName",
"value": {
"name": "jack.id",
"bid": [
{
"denom": "nametoken",
"amount": "5"
}
],
"buyer": "cosmos1qltywk7mrvry0yl4al64ez8h32yrhkgzjkr2rf"
}
}
],
"memo": ""
}
confirm transaction before signing and broadcasting [y/N]: y
Password to sign with 'jack':
{
"height": "0",
"txhash": "2A82587409EFEEB5C0918128A83E055C3A93E0DBDC07C5208A2046005E7F0E8D",
"raw_log": "[{\"msg_index\":0,\"success\":true,\"log\":\"\"}]",
"logs": [
{
"msg_index": 0,
"success": true,
"log": ""
}
]
}
$ nscli tx nameservice set-name jack.id 8.8.8.8 --from jack
{
"chain_id": "namechain",
"account_number": "0",
"sequence": "2",
"fee": {
"amount": [],
"gas": "200000"
},
"msgs": [
{
"type": "nameservice/SetName",
"value": {
"name": "jack.id",
"value": "8.8.8.8",
"owner": "cosmos1qltywk7mrvry0yl4al64ez8h32yrhkgzjkr2rf"
}
}
],
"memo": ""
}
confirm transaction before signing and broadcasting [y/N]: y
Password to sign with 'jack':
{
"height": "0",
"txhash": "250910CD9814C8E78290F1B65E01755B6C726444C615B91B67EBEEA4FDBF3BA1",
"raw_log": "[{\"msg_index\":0,\"success\":true,\"log\":\"\"}]",
"logs": [
{
"msg_index": 0,
"success": true,
"log": ""
}
]
}
This is below command which using run REST Server.
mtcli rest-server --laddr tcp://0.0.0.0:1317 --trust-node
in this tutorial, https://github.com/cosmos/sdk-application-tutorial/blob/master/tutorial/rest.md
where is clientrest.CompleteAndBroadcastTxREST
been used?
As the title shows. When I tested running the tutorial,the height of transaction is always 0..
Am I correct to believe that rest server that is started using nscli
is meant to roughly mimic gaicli rest server? In particular, should it fully support at least ICS0 Tendermint APIs on this Swagger page?
The API that is missing is /txs/{hash}
(Get a Tx by hash). I am able to use this API via gaicli
rest server but not via nscli
rest server.
Most applications built on the SDK (and certainly a nameservice) will want lite client RPC functionality, I think we should demonstrate a minimum viable example of what that looks like.
Might block on cosmos/cosmos-sdk#1081.
Dependabot couldn't find a go.mod for this project.
Dependabot requires a go.mod to evaluate your project's current Go dependencies. It had expected to find one at the path: /go.mod
.
If this isn't a Go project, or if it is a library, you may wish to disable updates for it from within Dependabot.
Cosmos SDK has been upgraded to go.mod
cosmos/cosmos-sdk#3907
But the tutorial still uses dep
:
https://github.com/cosmos/sdk-application-tutorial/search?q=dep&unscoped_q=dep
There is a ":" missing on this line
In the step of creating types for the module it is referenced that the file should be created at ./x/nameservice/types.go
but the package is types for the code so it should be noted it is created at ./x/nameservice/types/types.go
.
I am assuming this is a typo because in the following step it says "Start by creating a key.go file withing in the types folder" (withing also a typo) and in the example code the files are in that folder.
Currently the tutorial shows only the CLI interactions. We should also show the LCD routes as well.
Just like gaiadebug
. It would be nice so that people can query txs bytes from tendermint rpc and then unmarshall them to JSON.
Thanks for running through this with me @okwme! Here are some issues I saw when working
NewnameserviceApp
properlysdk.Result
in the handlerMore to come
What libs and functions in the cosmos-sdk i can use to sign transaction on the frontend (user-appcilation)? Explain please how can i do this on the example of the nameservice (tutor. app)?
Sorry for mis subject, but i cant find answer anywhere :\
Add documentation or update the tutorial to explain how to extend existing keepers and handlers.
Currently the tutorial hand-waves over Genesis file creation and format. We need to add some more information about this. May bock on cosmos/cosmos-sdk#3006 or cosmos/cosmos-sdk#3406
How to create new account without restarting node for this tutorial?
x/nameservice/client/cli/tx.go:94:52: "github.com/cosmos/cosmos-sdk/client/context".NewCLIContext().WithCodec(cdc).WithAccountDecoder undefined (type "github.com/cosmos/cosmos-sdk/client/context".CLIContext has no field or method WithAccountDecoder)
make: *** [install] Error 2
Any ideas? I'm new to the Go toolchain.
Can you upgrade tutorial for tx cmd queries? GetCmdSetName and GetCmdBuyName use functions that dont exist after refactoring.
File Path: sdk-application-tutorial/tutorial/cn/15-build-run.md
ERROR Sentence: rm -rf~ / .ns *
(如果你之前已经运行过该教程,则可以从头开始使用nsd unsafe-reset-all或删除home文件夹下的两个执行程序的数据及配置文件夹rm -rf~ / .ns *)
Correct Sentence: rm -rf ~/.ns*
Consequence: ALL file in $Home folder have been DELETED !!!!!! BAD STORT!! Please must modify this error immediately! Thanks!
Can we please make sure the tutorial is backward compatible or at least stay up to date.
Or can we include a verification process that tutorial itself work with the lates ask codebase!?
Hi,
I tried to use this tutorial to make a chain with only one token.
First, I changed bond_denom in genesis.json to tuckeratom.
Then, I gave all of the genesis accounts 1000 tuckeratom.
Finally, I made a gentx using --amount 1000tuckeratom.
I collected the gentx and validated the genesis.json, everything looked normal.
But when I run nsd, I get "ERROR: error during handshake: error on replay: validator set is nil in genesis and still empty after InitChain"
This error does not appear if I use stake as the bond_denom and do the default gentx with 100000000stake.
But if I use stake as the bond_denom, I can't delegate tuckeratoms.
Has non-stake delegation worked for anyone else?
Thanks
$ nsd start
$ nsd stop
$ nsd export
yields
panic: stored supply should not have been nil
Currently we focus on the module first, and then the application. It is true that the module is the main piece that people need to work on, but I think it's important for them to discover first how the app import and handle modules before coding one.
The bulk of the tuto would still be the module, but the narrative would change a bit. Namely, we would have:
./app.go
and then go in the module section when we realise we need it in the process of building app.goOverall it would require little change, and would solidify this tutorial as a coherent, bottom-up and self-sufficient way of learning the sdk.
Thoughts @jackzampolin
I'm trying to run nameservice CLI application as per the instructions in the tutorial (https://cosmos.network/docs/tutorial/build-run.html#building-the-nameservice-application).
After running the "nscli query nameservice resolve jack.id", I'm getting below error:
"Could not resolve name - jack.id"
github.com/cosmos/cosmos-sdk v0.28.2-0.20190616100639-18415eedaf25 h1:BbhcH/+GrA/j/6LimGGGq7BuMtmVF9nfk2HrCjevktw=
github.com/cosmos/cosmos-sdk v0.28.2-0.20190616100639-18415eedaf25/go.mod h1:MvaJDmjgAK7X1rTnpk8+c6tUFfIZ++iuNCp2sUWzprM=
github.com/cosmos/cosmos-sdk v0.28.2-0.20190718000257-257d3bfbf2d0 h1:lKp7Z01zQDrmjz6V0QkvQ0Lsql/I+yspTnKu1aHgKOo=
github.com/cosmos/cosmos-sdk v0.28.2-0.20190718000257-257d3bfbf2d0/go.mod h1:UV765S3m9sxCg8rYaBr4XgeHZl2UP6y++Coz9mLlYFc=
github.com/cosmos/cosmos-sdk v0.35.0 h1:EPeie1aKHwnXtTzKggvabG7aAPN+DDmju2xquvjFwao=
github.com/cosmos/cosmos-sdk v0.35.0/go.mod h1:ruF+G4D7hRf34uzZQvf/SIja9fsIThU5D7GirwTMQ9I=
github.com/cosmos/cosmos-sdk v0.36.0-rc1 h1:hgSXNeVwNYxD0+O9DxRrxJcir9Z7Q5zreLV6G7GrjYA=
github.com/cosmos/cosmos-sdk v0.36.0-rc1/go.mod h1:UV765S3m9sxCg8rYaBr4XgeHZl2UP6y++Coz9mLlYFc=
github.com/cosmos/cosmos-sdk v0.36.0 h1:nDHhZDeucmv/PoThz89Q8cj9S8OH2EUutgertz2pZ90=
github.com/cosmos/cosmos-sdk v0.37.0-rc1 h1:DjrmTg+MTRJozgqIhI+7vT1MI2hQobeb8AQcXQ87JO0=
github.com/cosmos/cosmos-sdk v0.37.0-rc1/go.mod h1:3b/k/Zd+YDuttSmEJdNkxga1H5EIiDUhSYeErAHQN7A=
github.com/cosmos/cosmos-sdk v0.37.0 h1:S2I3NDGN2wqfGlY5KqkAHTpfezjhgeqDxrCxhlhd528=
github.com/cosmos/cosmos-sdk v0.37.0/go.mod h1:3b/k/Zd+YDuttSmEJdNkxga1H5EIiDUhSYeErAHQN7A=
run commands as per the instructions on this page:
https://cosmos.network/docs/tutorial/build-run.html#building-the-nameservice-application
Following up on discussion with jin and @jackzampolin yesterday, and upon further thinking, I think it would be good to integrate content from basecoin that is missing from nameservice. The goal would be to keep nameservice concise while also making it self-sufficient.
Ultimately the question is what is the goal of this tutorial. If we take a look at https://doc.rust-lang.org/, we see there are two things:
If we want nameservice to become this self-sufficient learn by doing example that introduces all the important concepts of the sdk, and I think we agreed it would be, then it ought to be a bit longer and incorporate important explanations that currently live in basecoin. I think this vision for the nameservice example would also be supported by a slight change in narrative described here: #3.
> nsd start
I[2019-06-11|15:15:31.803] Starting ABCI with Tendermint module=main
ERROR: Error during handshake: Error on replay: Validator set is nil in genesis and still empty after InitChain
Hi,
I was going through the master branch of sdk-application-tutorial
https://github.com/cosmos/sdk-application-tutorial/blob/master/go.mod
Here the cosmos-sdk version mentioned is v0.28.2-0.20190616100639-18415eedaf25 which is probably a deprecated version. Sometimes go.mod automatically updates it to v0.35.0.
Anyways the main issue here is that none of these version contains the following packages(or atleast either of the packages):
github.com/cosmos/cosmos-sdk/types/module
github.com/cosmos/cosmos-sdk/x/auth/genaccounts
These packages are being imported in app.go. You can find it here:
https://github.com/cosmos/sdk-application-tutorial/blob/master/app.go
I am really confused how the makefile is working in such a scenario when the modules doesn't exist because when i try to do the same thing in my application its throwing error as follows:
cannot load github.com/cosmos/cosmos-sdk/types/module: import lookup disabled by -mod=readonly
Makefile:5: recipe for target 'install' failed
make: *** [install] Error 1
Makefile used by me is same as one here:
https://github.com/cosmos/sdk-application-tutorial/blob/master/Makefile
Please let me know what other changes i should make for the makefile to work. The error that i am getting is expected according to me but its surprising how the same error is not thrown in case of nameservice app. Please let me know of the hack.
➜ sdk-application-tutorial git:(master) ✗ nsd unsafe-reset-all
I[2019-03-07|15:12:56.749] Removed all blockchain history module=main dir=/Users/billy/.nsd/data
I[2019-03-07|15:12:56.753] Reset private validator file to genesis state module=main keyFile=/Users/billy/.nsd/config/priv_validator_key.json stateFile=/Users/billy/.nsd/data/priv_validator_state.json
➜ sdk-application-tutorial git:(master) ✗ nsd init --chain-id testchain
ERROR: genesis.json file already exists: /Users/billy/.nsd/config/genesis.json
Not sure if this should be an issue with the SDK about that command or if we should mention this as an outcome in the tutorial.
nscli tx nameservice buy-name jack.id 5000nametoken --from jack
or
nscli tx nameservice buy-name jack.id 5wrgstrftoken --from jack
both respond with
"raw_log": "[{\"msg_index\":0,\"success\":true,\"log\":\"\"}]",
"logs": [
{
"msg_index": 0,
"success": true,
"log": ""
}
]
the setup is a fresh install with instructions from tutorial, so 1000nametoken are present for jack. It works with <=1000.
nsd shows 1 invalidtx. but nscli gives the response quoted above.
Maybe this bug is not from sdk-application-tutorial but rather from cosmos-sdk 0.37?
genesis.go
should be split in two -> A genesis.go
should be created in /types
, it would contain the type definition of GenesisState
as well as DefaultGenesis
and ValidateGenesis
expected_keepers.go
in /types
, modify keeper.go
accordingly.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.