-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Conduit: Postgres exporter initial implementation (#1114)
* Local Ledger (#1011) * integrate block processor * Local Ledger Deployment (#1013) * add simple local ledger migration * add deleted opts * fast catchup (#1023) * add fast catchup * Localledger merge (#1036) * return empty lists from fetchApplications and fetchAppLocalStates (#1010) * Update model to converge with algod (#1005) * New Feature: Adds Data Directory Support (#1012) - Updates the go-algorand submodule hash to point to rel/beta - Moves the cpu profiling file, pid file and indexer configuration file to be options of only the daemon sub-command - Changes os.Exit() to be a panic with a special handler. This is so that defer's are handled instead of being ignored. - Detects auto-loading configuration files in the data directory and issues errors if equivalent command line arguments are supplied. - Updates the README with instructions on how to use the auto-loading configuration files and the data directory. * Update mockery version Co-authored-by: erer1243 <[email protected]> Co-authored-by: AlgoStephenAkiki <[email protected]> * recovery scenario (#1024) * handle ledger recovery scenario * refactor create genesis block (#1026) * refactor create genesis block * Adds Local Ledger Readme (#1035) * Adds Local Ledger Readme Resolves #4109 Starts Readme docs * Update docs/LocalLedger.md Co-authored-by: Will Winder <[email protected]> * Update docs/LocalLedger.md Co-authored-by: Will Winder <[email protected]> * Update docs/LocalLedger.md Co-authored-by: Will Winder <[email protected]> * Removed troubleshooting section Co-authored-by: Will Winder <[email protected]> * update ledger file path and migration (#1042) * LocalLedger Refactoring + Catchpoint Service (#1049) Part 1 cleanup genesis file access. put node catchup into a function that can be swapped out with the catchup service. pass the indexer logger into the block processor. move open ledger into a util function, and move the initial state util function into a new ledger util file. add initial catchupservice implementation. move ledger init from daemon.go to constructor. Merge multiple read genesis functions. Part 2 Merge local_ledger migration package into blockprocessor. Rename Migration to Initialize Use logger in catchup service catchup Part 3 Update submodule and use NewWrappedLogger. Make util.CreateInitState private * build: merge develop into localledger/integration (#1062) * Ledger init status (#1058) * Generate an error if the catchpoint is not valid for initialization. (#1075) * Use main logger in handler and fetcher. (#1077) * Switch from fullNode catchup to catchpoint catchup service. (#1076) * Refactor daemon, add more tests (#1039) Refactors daemon cmd into separate, testable pieces. * Merge develop into localledger/integration (#1083) * Misc Local Ledger cleanup (#1086) * Update processor/blockprocessor/initialize.go Co-authored-by: Zeph Grunschlag <[email protected]> * commit * fix function call args * RFC-0001: Rfc 0001 impl (#1069) Adds an Exporter interface and a noop exporter implementation with factory methods for construction * Fix test errors * Add/fix tests * Add postgresql_exporter tests * Update config loading * Change BlockExportData to pointers * Move and rename ExportData * Add Empty func to BlockData * Add comment Co-authored-by: shiqizng <[email protected]> Co-authored-by: [email protected] <[email protected]> Co-authored-by: erer1243 <[email protected]> Co-authored-by: AlgoStephenAkiki <[email protected]> Co-authored-by: Will Winder <[email protected]> Co-authored-by: Zeph Grunschlag <[email protected]>
- Loading branch information
1 parent
54d39d7
commit 3c8c150
Showing
15 changed files
with
488 additions
and
65 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,39 @@ | ||
package data | ||
|
||
import ( | ||
"github.com/algorand/go-algorand/agreement" | ||
"github.com/algorand/go-algorand/data/bookkeeping" | ||
"github.com/algorand/go-algorand/ledger/ledgercore" | ||
) | ||
|
||
// RoundProvider is the interface which all data types sent to Exporters should implement | ||
type RoundProvider interface { | ||
Round() uint64 | ||
Empty() bool | ||
} | ||
|
||
// BlockData is provided to the Exporter on each round. | ||
type BlockData struct { | ||
// Block is the block data written to the blockchain. | ||
Block *bookkeeping.Block | ||
|
||
// Delta contains a list of account changes resulting from the block. Processor plugins may have modify this data. | ||
Delta *ledgercore.StateDelta | ||
|
||
// Certificate contains voting data that certifies the block. The certificate is non deterministic, a node stops collecting votes once the voting threshold is reached. | ||
Certificate *agreement.Certificate | ||
} | ||
|
||
// Round returns the round to which the BlockData corresponds | ||
func (blkData BlockData) Round() uint64 { | ||
return uint64(blkData.Block.Round()) | ||
} | ||
|
||
// Empty returns whether the Block contains Txns. Assumes the Block is never nil | ||
func (blkData BlockData) Empty() (bool, error) { | ||
payset, err := blkData.Block.DecodePaysetFlat() | ||
if err != nil { | ||
return true, err | ||
} | ||
return len(payset) > 0, nil | ||
} |
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
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,32 @@ | ||
package exporters | ||
|
||
import ( | ||
"github.com/algorand/indexer/plugins" | ||
) | ||
|
||
// ExporterMetadata returns fields relevant to identification and description of plugins. | ||
type ExporterMetadata struct { | ||
ExpName string | ||
ExpDescription string | ||
ExpDeprecated bool | ||
} | ||
|
||
// Type implements the Plugin.Type interface | ||
func (meta ExporterMetadata) Type() plugins.PluginType { | ||
return plugins.Exporter | ||
} | ||
|
||
// Name implements the Plugin.Name interface | ||
func (meta ExporterMetadata) Name() string { | ||
return meta.ExpName | ||
} | ||
|
||
// Description provides a brief description of the purpose of the Exporter | ||
func (meta *ExporterMetadata) Description() string { | ||
return meta.ExpDescription | ||
} | ||
|
||
// Deprecated is used to warn users against deprecated plugins | ||
func (meta *ExporterMetadata) Deprecated() bool { | ||
return meta.ExpDeprecated | ||
} |
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
Oops, something went wrong.