mirror of
https://gitlab.com/pulsechaincom/erigon-pulse.git
synced 2025-01-05 10:32:19 +00:00
529d359ca6
An update to the devnet to introduce a local heimdall to facilitate multiple validators without the need for an external process, and hence validator registration/staking etc. In this initial release only span generation is supported. It has the following changes: * Introduction of a local grpc heimdall interface * Allocation of accounts via a devnet account generator () * Introduction on 'Services' for the network config "--chain bor-devnet --bor.localheimdall" will run a 2 validator network with a local service "--chain bor-devnet --bor.withoutheimdall" will sun a single validator with no heimdall service as before --------- Co-authored-by: Alex Sharp <alexsharp@Alexs-MacBook-Pro-2.local>
50 lines
1.2 KiB
Go
50 lines
1.2 KiB
Go
package clerk
|
|
|
|
import (
|
|
"fmt"
|
|
"time"
|
|
|
|
libcommon "github.com/ledgerwatch/erigon-lib/common"
|
|
"github.com/ledgerwatch/erigon-lib/common/hexutility"
|
|
)
|
|
|
|
// EventRecord represents state record
|
|
type EventRecord struct {
|
|
ID uint64 `json:"id" yaml:"id"`
|
|
Contract libcommon.Address `json:"contract" yaml:"contract"`
|
|
Data hexutility.Bytes `json:"data" yaml:"data"`
|
|
TxHash libcommon.Hash `json:"tx_hash" yaml:"tx_hash"`
|
|
LogIndex uint64 `json:"log_index" yaml:"log_index"`
|
|
ChainID string `json:"bor_chain_id" yaml:"bor_chain_id"`
|
|
}
|
|
|
|
type EventRecordWithTime struct {
|
|
EventRecord
|
|
Time time.Time `json:"record_time" yaml:"record_time"`
|
|
}
|
|
|
|
// String returns the string representatin of a state record
|
|
func (e *EventRecordWithTime) String() string {
|
|
return fmt.Sprintf(
|
|
"id %v, contract %v, data: %v, txHash: %v, logIndex: %v, chainId: %v, time %s",
|
|
e.ID,
|
|
e.Contract.String(),
|
|
e.Data.String(),
|
|
e.TxHash.Hex(),
|
|
e.LogIndex,
|
|
e.ChainID,
|
|
e.Time.Format(time.RFC3339),
|
|
)
|
|
}
|
|
|
|
func (e *EventRecordWithTime) BuildEventRecord() *EventRecord {
|
|
return &EventRecord{
|
|
ID: e.ID,
|
|
Contract: e.Contract,
|
|
Data: e.Data,
|
|
TxHash: e.TxHash,
|
|
LogIndex: e.LogIndex,
|
|
ChainID: e.ChainID,
|
|
}
|
|
}
|