Go-tool for copying Aurora/Near block JetStreams, using content verification and independent NATS configurations.
aurora- will retrieve height, hash and prevHash from aurora-type blocks.near- will retrieve height, hash and prevHash from near-type blocks.unverified- will retrieve height fromNats-Msg-Idheader, hash-checks will not be performed.
[Input|Output].Subject- can be left empty, than will be figured automatically.Reader.MaxRps- maximum pull consumer fetches per second.Reader.BufferSize- how many blocks will be prefetched in advance (useful for async decoupling of reader/writer goroutines).Reader.InactiveThresholdSeconds- used for consumer to survive long reconnection.Reader.SortBatch- sorts messages by sequence id within each batch (I wasn't sure if it's sorted by default).Reader.LastSeqUpdateIntervalSeconds- defines frequency of input stream size fetch, the more frequent it is - the more precise batch size is selected (when close to the tip).Reader.StrictStart- if true, will ensure that first message seq is equal to startSeq. Only useful for unverified mode.Writer.TipTtlSeconds- defines how frequently writer will refresh information about the actual output tip. Needed to not fall out of dedup window. If lower than dedupWindow / 2 - will be automatically lowered.InputStartSequence- inclusive, set0to start from beginning.InputEndSequence- exclusive, set0to never end.RestartDelayMs- if connection was lost, this amount of milliseconds will be waited before starting next reconnection.ToleranceWindow- Maximum number of consecutive blocks that are corrupted, or blocks whoseprev_hashdoesn't match the hash of last block in output stream. After tolerance window is exceeded, program exits with error.Metrics.Labels- absolutely custom keys and values, sysadmin is free to arrange it in a way that will help him distinguishing different metrics in grafana.Metrics.StdoutIntervalSeconds- how frequently a basic metric representation should be spewed out to stdout.0means never.
- Pipeline starts.
- On any read/write error pipeline will be stopped, reconnection attempt will be done after
RestartDelayMs, and then pipeline will start again. - If last block in output stream is present but can't be decoded - program exits with an error.
- If pipeline gets too many (see
ToleranceWindowoption) consecutive blocks that don't make sense - program exits with an error. - If pipeline reaches the
InputEndSequenceand successfully writes it - program stops gracefully. - On
SIGHUP,SIGTERM,SIGQUIT,SIGABRT,SIGINT,SIGUSR1- program stops gracefully. - If metrics server dies - program exits with an error.