Cosmos API module (apis) - interact with arbitrary api's from your cosmos app using this prebuilt cosmos hub module.
Going after the build a module challenge for the cosmos hackatom contest for increasing Cosmos utility and go to market.
Note this is a prototype/hackathon concept module.
This module is for you if:
- You want to easily make api calls in response to key events such as block starts or ends, arbitrary messages, or ad-hoc queries.
- Perform programmatic access to other services such as other blockchains, third party api's (increase interoperability).
- Provide a simple interface to configure a set of API-based commands even without detailed knowledge of go http or cosmos. Simply provide the urls and payloads and the module can take care of the rest.
- Centralize all your API-related work in your cosmos application.
- Add the /x/apis module to your app
- Configure the module with your external API's and desired parameters.
- Create subscribers to process emitted events.
- Edit or fork the module however you wish.
- Adjust
DefaultParams
in params.go of the apis module (currently configured in the cosmos20 app to poll for weather and emit an event). starport serve -v
You should see these requests going out in response to the EndBlock event.
- Subscribe to the events via the tendermint websocket.
Can see evidence of the events emitted here.
go build -v ./...
go test -v ./...
- brew install tendermint/tap/starport
- starport serve
- https://www.youtube.com/watch?v=PCSzgJCgwdE
- https://cosmos.network/intro
- https://github.com/cosmos/cosmos-sdk
- https://github.com/tendermint/starport/blob/develop/docs/1%20Introduction/2%20Install.md
- https://docs.cosmos.network/master/building-modules/intro.html
- https://docs.google.com/document/d/16XTVG6j2TQw53DWjs_QAEBXNFukxRzQohsmL1K3JYVA/edit?usp=sharing
- https://tutorials.cosmos.network/
- https://five.hackatom.org/resources
cosmos20 is a blockchain application built using Cosmos SDK and Tendermint and generated with Starport.
starport serve
serve
command installs dependencies, initializes and runs the application.
Initialization parameters of your app are stored in config.yml
.
A list of user accounts created during genesis of your application.
Key | Required | Type | Description |
---|---|---|---|
name | Y | String | Local name of the key pair |
coins | Y | List of Strings | Initial coins with denominations (e.g. "100coin") |