Documentation
¶
Index ¶
- Variables
- func ParseFS(myFuncs template.FuncMap, fsys fs.FS, pattern string) (*template.Template, error)
- type ChainConfig
- type ExampleEntity
- type Project
- func (p *Project) BuildExampleEntity() error
- func (p *Project) ChainEndpoint() (string, error)
- func (p *Project) ExampleEntityHasID() bool
- func (p *Project) GetModuleName() string
- func (p *Project) GetOutputProtoPath() string
- func (p *Project) GetOutputProtobufPath() string
- func (p *Project) HasExampleEntity() bool
- func (p *Project) OutputName() string
- func (p *Project) ProtoOutputName() string
- func (p *Project) ProtoOutputNameToSnake() string
- func (p *Project) Render(outputType string, withDevEnv bool) (projectFiles map[string][]byte, err error)
- func (p *Project) SubstreamsKebabName() string
- type ProtoGenerator
Constants ¶
This section is empty.
Variables ¶
View Source
var ChainConfigByID = map[string]*ChainConfig{ "mainnet": { DisplayName: "Ethereum Mainnet", ExplorerLink: "https://etherscan.io", FirehoseEndpoint: "mainnet.eth.streamingfast.io:443", Network: "mainnet", SupportsCalls: true, }, "bnb": { DisplayName: "BNB", ExplorerLink: "https://bscscan.com", FirehoseEndpoint: "bnb.streamingfast.io:443", Network: "bsc", SupportsCalls: true, }, "polygon": { DisplayName: "Polygon", ExplorerLink: "https://polygonscan.com", FirehoseEndpoint: "polygon.streamingfast.io:443", Network: "polygon", SupportsCalls: true, }, "amoy": { DisplayName: "Polygon Amoy Testnet", ExplorerLink: "https://www.okx.com/web3/explorer/amoy", FirehoseEndpoint: "amoy.substreams.pinax.network:443", Network: "amoy", SupportsCalls: true, }, "arbitrum": { DisplayName: "Arbitrum", ExplorerLink: "https://arbiscan.io", FirehoseEndpoint: "arb-one.streamingfast.io:443", Network: "arbitrum", SupportsCalls: true, }, "holesky": { DisplayName: "Holesky", ExplorerLink: "https://holesky.etherscan.io/", FirehoseEndpoint: "holesky.eth.streamingfast.io:443", Network: "holesky", SupportsCalls: true, }, "sepolia": { DisplayName: "Sepolia Testnet", ExplorerLink: "https://sepolia.etherscan.io", FirehoseEndpoint: "sepolia.streamingfast.io:443", Network: "sepolia", SupportsCalls: true, }, "optimism": { DisplayName: "Optimism Mainnet", ExplorerLink: "https://optimistic.etherscan.io", FirehoseEndpoint: "opt-mainnet.streamingfast.io:443", Network: "optimism", SupportsCalls: false, }, "avalanche": { DisplayName: "Avalanche C-chain", ExplorerLink: "https://subnets.avax.network/c-chain", FirehoseEndpoint: "avalanche-mainnet.streamingfast.io:443", Network: "avalanche", SupportsCalls: false, }, "chapel": { DisplayName: "BNB Chapel Testnet", ExplorerLink: "https://testnet.bscscan.com/", FirehoseEndpoint: "chapel.substreams.pinax.network:443", Network: "chapel", SupportsCalls: true, }, "injective-mainnet": { DisplayName: "Injective Mainnet", ExplorerLink: "https://explorer.injective.network/", FirehoseEndpoint: "mainnet.injective.streamingfast.io:443", Network: "injective-mainnet", }, "injective-testnet": { DisplayName: "Injective Testnet", ExplorerLink: "https://testnet.explorer.injective.network/", FirehoseEndpoint: "testnet.injective.streamingfast.io:443", Network: "injective-testnet", }, "starknet-mainnet": { DisplayName: "Starknet Mainnet Transactions", ExplorerLink: "https://starkscan.co/", FirehoseEndpoint: "mainnet.starknet.streamingfast.io:443", Network: "starknet-mainnet", }, "starknet-testnet": { DisplayName: "Starknet Testnet Transactions", ExplorerLink: "", FirehoseEndpoint: "testnet.starknet.streamingfast.io:443", Network: "starknet-testnet", }, "solana": { DisplayName: "Solana Mainnet", Network: "solana", FirehoseEndpoint: "mainnet.solana.streamingfast.io:443", }, "vara-mainnet": { DisplayName: "Vara Mainnet", ExplorerLink: "https://vara.subscan.io/", FirehoseEndpoint: "mainnet.vara.streamingfast.io:443", Network: "vara-mainnet", }, "vara-testnet": { DisplayName: "Vara Testnet", ExplorerLink: "", FirehoseEndpoint: "testnet.vara.streamingfast.io:443", Network: "vara-testnet", }, }
View Source
var Cmd = &cobra.Command{Use: "codegen", Short: "Code generator for substreams"}
View Source
var SQLCmd = &cobra.Command{ Use: "subgraph <manifest_url> <module_name>", Short: "Generate subgraph dev environment from substreams manifest", Args: cobra.ExactArgs(3), RunE: generateSQLEnv, }
View Source
var SubgraphCmd = &cobra.Command{ Use: "subgraph [<manifest_url>]", Short: "Generate subgraph dev environment from substreams manifest", Args: cobra.RangeArgs(0, 1), RunE: generateSubgraphEnv, }
Functions ¶
Types ¶
type ChainConfig ¶ added in v1.10.0
type ExampleEntity ¶ added in v1.10.0
type Project ¶ added in v1.10.0
type Project struct {
Name string
Network string
Module *pbsubstreams.Module
OutputDescriptor *descriptorpb.DescriptorProto
ExampleEntity *ExampleEntity
SpkgProjectName string
// contains filtered or unexported fields
}
func NewProject ¶ added in v1.10.0
func NewProject(name, spkgProjectName, network string, module *pbsubstreams.Module, outputDescriptor *descriptorpb.DescriptorProto, protoTypeMapping map[string]*descriptorpb.DescriptorProto) *Project
func (*Project) BuildExampleEntity ¶ added in v1.10.0
func (*Project) ChainEndpoint ¶ added in v1.10.0
func (*Project) ExampleEntityHasID ¶ added in v1.10.0
func (*Project) GetModuleName ¶ added in v1.10.0
func (*Project) GetOutputProtoPath ¶ added in v1.10.0
func (*Project) GetOutputProtobufPath ¶ added in v1.10.0
func (*Project) HasExampleEntity ¶ added in v1.10.0
func (*Project) OutputName ¶ added in v1.10.0
func (*Project) ProtoOutputName ¶ added in v1.10.0
func (*Project) ProtoOutputNameToSnake ¶ added in v1.10.0
func (*Project) SubstreamsKebabName ¶ added in v1.10.0
type ProtoGenerator ¶
type ProtoGenerator struct {
// contains filtered or unexported fields
}
func NewProtoGenerator ¶
func NewProtoGenerator(outputPath string, excludedPaths []string, generateMod bool) *ProtoGenerator
func (*ProtoGenerator) GenerateProto ¶ added in v0.1.0
func (g *ProtoGenerator) GenerateProto(pkg *pbsubstreams.Package, showBufContent bool) error
Click to show internal directories.
Click to hide internal directories.