NOTES 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. index 0
  2. appId 4
  3. textToHexString("guardian");
  4. guardianAddr CLAOUBJPZ5WNLM7ZU237TCOV2WODAGNUX3536PZ3JSWMBN7M46UADLN3GY
  5. ('CLAOUBJPZ5WNLM7ZU237TCOV2WODAGNUX3536PZ3JSWMBN7M46UADLN3GY',
  6. '01befa429d57cd18b7f8a4d91a2da9ab4af05d0fbe00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000677561726469616e')
  7. illness illegal arrive clip fork palm skull south impose verify toss ocean shrug vital swift similar depend margin climb uniform risk pizza canal absorb forward
  8. # Locally in your project.
  9. npm install -D typescript
  10. npm install -D ts-node
  11. # Or globally with TypeScript.
  12. npm install -g typescript
  13. npm install -g ts-node
  14. # Depending on configuration, you may also need these
  15. npm install -D tslib @types/node
  16. go to .../ethereum/
  17. npm ci
  18. go to ..../sdk/js
  19. npm ci; npm run build
  20. Then, in a new window, you can run
  21. tsc -p tsconfig-cjs.json --watch
  22. which will track updates
  23. ts-node foo2.ts
  24. https://github.com/barnjamin/sdk-extras/blob/master/py/block_fetcher.py
  25. package main
  26. import (
  27. "context"
  28. "strings"
  29. "github.com/algorand/go-algorand/rpcs"
  30. "github.com/algorand/indexer/fetcher"
  31. "github.com/sirupsen/logrus"
  32. )
  33. var log = logrus.New()
  34. func main() {
  35. f, err := fetcher.ForNetAndToken("http://localhost:4001", strings.Repeat("a", 64), log)
  36. if err != nil {
  37. log.Fatalf("Failed to create fetcher: %+v", err)
  38. }
  39. f.SetBlockHandler(handler)
  40. f.Run(context.Background())
  41. }
  42. func handler(ctx context.Context, cert *rpcs.EncodedBlockCert) error {
  43. for _, stxn := range cert.Block.Payset {
  44. log.Printf("%+v", stxn.SignedTxn.Txn.Type)
  45. }
  46. return nil
  47. }