-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding vara-extrinsics code generation
- Loading branch information
1 parent
d9d7109
commit 1208fec
Showing
11 changed files
with
154 additions
and
74 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package varaextrinsics | ||
|
||
import "sort" | ||
|
||
type ChainConfig struct { | ||
ID string // Public | ||
DisplayName string // Public | ||
ExplorerLink string | ||
FirehoseEndpoint string | ||
Network string | ||
|
||
initialBlockCache map[string]uint64 | ||
} | ||
|
||
var ChainConfigs []*ChainConfig | ||
|
||
var ChainConfigByID = map[string]*ChainConfig{ | ||
"vara-mainnet": { | ||
DisplayName: "Vara Mainnet", | ||
ExplorerLink: "https://vara.subscan.io/", | ||
FirehoseEndpoint: "mainnet.vara.streamingfast.io:443", | ||
Network: "vara-mainnet", | ||
initialBlockCache: make(map[string]uint64), | ||
}, | ||
"vara-testnet": { | ||
DisplayName: "Vara Testnet", | ||
ExplorerLink: "", | ||
FirehoseEndpoint: "testnet.vara.streamingfast.io:443", | ||
Network: "vara-testnet", | ||
initialBlockCache: make(map[string]uint64), | ||
}, | ||
} | ||
|
||
func init() { | ||
for k, v := range ChainConfigByID { | ||
v.ID = k | ||
ChainConfigs = append(ChainConfigs, v) | ||
} | ||
sort.Slice(ChainConfigs, func(i, j int) bool { | ||
return ChainConfigs[i].DisplayName < ChainConfigs[j].DisplayName | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package soltransactions | ||
package varaextrinsics | ||
|
||
import ( | ||
"testing" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
package soltransactions | ||
package varaextrinsics | ||
|
||
import ( | ||
"github.com/streamingfast/logging" | ||
) | ||
|
||
var zlog, tracer = logging.PackageLogger("vara-extrinsics", "github.com/streamingfast/substreams-codegen/codegen/vara-extrinsics") | ||
var zlog, _ = logging.PackageLogger("vara-extrinsics", "github.com/streamingfast/substreams-codegen/codegen/vara-extrinsics") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Contributing | ||
|
||
## Understand the Generated Project | ||
|
||
Only a `substreams.yaml` file has been generated. This file declares a Substreams module, `filtered_extrinsics`, which uses a Vara Foundational Module (a module built by the StreamingFast team). | ||
|
||
```yaml | ||
specVersion: v0.1.0 | ||
package: | ||
name: {{ .Name }} | ||
version: v0.1.0 | ||
|
||
imports: | ||
vara: https://github.com/streamingfast/substreams-foundational-modules/releases/download/vara-foundational-v0.1.4/foundational-modules-vara-common-v0.1.4.spkg # 1 | ||
|
||
modules: | ||
- name: map_filtered_extrinsics # 2 | ||
use: vara:filtered_extrinsics # 3 | ||
|
||
network: vara-mainnet | ||
|
||
params: | ||
map_filtered_extrinsics: {{ .ExtrinsicId }} # 4 | ||
``` | ||
|
||
1. Import the Vara Foundational Modules. | ||
2. Declare the `map_filtered_extrinsics` module, which you will run later. | ||
3. Use the `filtered_extrinsics` module from the Vara Foundational Modules. | ||
Essentially, you are _using_ the Vara Foundational Module, which is pre-built for you. | ||
4. Pass the regular expression to filter the transactions based on the specified Extrinsic IDs. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
# Vara Extrinsic | ||
|
||
This Substreams project allows you to retrieve Vara transactions filtered by one or several Extrincis (i.e. you will only receive transactions containing the specified Extrinsics). | ||
|
||
## Get Started | ||
|
||
### Build the Substreams | ||
|
||
```bash | ||
substreams build | ||
``` | ||
|
||
### Authenticate | ||
|
||
```bash | ||
substreams auth | ||
``` | ||
|
||
### Run your Substreams | ||
|
||
```bash | ||
substreams gui | ||
``` | ||
|
||
For information on contributing, please refer to [CONTRIBUTING.md](CONTRIBUTING.md). |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,16 @@ | ||
specVersion: v0.1.0 | ||
package: | ||
name: my_project_sol | ||
name: {{ .Name }} | ||
version: v0.1.0 | ||
|
||
imports: | ||
solana: https://spkg.io/streamingfast/solana-common-v0.2.0.spkg | ||
vara: https://github.com/streamingfast/substreams-foundational-modules/releases/download/vara-foundational-v0.1.4/foundational-modules-vara-common-v0.1.4.spkg | ||
|
||
modules: | ||
- name: map_filtered_transactions | ||
use: solana:filtered_transactions_without_votes | ||
|
||
network: solana | ||
- name: map_filtered_extrinsics | ||
use: vara:filtered_extrinsics | ||
|
||
params: | ||
map_filtered_transactions: {{ .ProgramId }} | ||
map_filtered_extrinsics: {{ .ExtrinsicId }} | ||
|
||
network: {{ .ChainNetwork }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters