Tracking data for concave smart contracts
Note
Get a substreams API KEY and past it in the
.env
, manage also other entries in regards to the smart contracts you're working on.If you run it with Gitpod make sure to add the
STREAMINGFAST_KEY
inside your account page environements. Required:
git clone git@github.com:rrobrms/test-substream.git
# copie the .env.example to .env
- This will first build a
.rs
file inside thesrc/abis
. The name of this file will be the same as theabis/*.json
. - Then, it will read the package name of your
*.proto
files insideproto
, and create a file with the same name, with all the rust types inside thesrc/pb
directory IF you have declare it in side thesubstreams.yaml
under theprotobuf:
section. - Will also create the
pb/*.rs
file from declareimports
*.spkg
file in thesubstreams.yaml
.
make protogen
# substreams protogen ./substreams.yaml --exclude-paths="sf/substreams,google"
- Check the names consistency inside the
substreams.yaml
package: name:
it should be the same across other files:substreams.yaml
binaries file*.wasm
Cargo.toml
package name
- The build will be under
./target/wasm32-unknown-unknown/release/*.wasm
make build
# cargo build --target wasm32-unknown-unknown --release
- Get the
src/lib.rs
map function name and pass it to the run cli. - Check the
.env
for the blocks info - The cmd
make run
will run all prior cmds and will refresh & exportSUBSTREAMS_API_TOKEN=${SF_TOKEN}
- Make sure the names are reported inside the
substreams.yaml
modules. - Da Fook z'gooinnn on!
make run
# substreams run -e $(ENDPOINT) substreams.yaml map_stakings -s $(START_BLOCK) -t $(STOP_BLOCK)
- write the substream protogen substreams.spkg in root directory
make package
# substreams pack -o substreams.spkg substreams.yaml