2018-11-07 21:50:43 +00:00
|
|
|
// VulcanizeDB
|
|
|
|
// Copyright © 2018 Vulcanize
|
|
|
|
|
|
|
|
// This program is free software: you can redistribute it and/or modify
|
|
|
|
// it under the terms of the GNU Affero General Public License as published by
|
|
|
|
// the Free Software Foundation, either version 3 of the License, or
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
// GNU Affero General Public License for more details.
|
|
|
|
|
|
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
|
|
// along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
2017-12-07 19:32:16 +00:00
|
|
|
package core
|
|
|
|
|
2018-03-07 21:29:21 +00:00
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
)
|
|
|
|
|
|
|
|
type NodeType int
|
|
|
|
|
|
|
|
const (
|
|
|
|
GETH NodeType = iota
|
|
|
|
PARITY
|
|
|
|
INFURA
|
2018-11-15 18:53:08 +00:00
|
|
|
GANACHE
|
|
|
|
)
|
|
|
|
|
|
|
|
const (
|
|
|
|
KOVAN_NETWORK_ID = 42
|
2018-03-07 21:29:21 +00:00
|
|
|
)
|
|
|
|
|
2017-12-07 19:32:16 +00:00
|
|
|
type Node struct {
|
|
|
|
GenesisBlock string
|
2018-02-13 16:31:57 +00:00
|
|
|
NetworkID float64
|
|
|
|
ID string
|
2018-01-10 21:54:36 +00:00
|
|
|
ClientName string
|
2017-12-07 19:32:16 +00:00
|
|
|
}
|
2018-03-07 21:29:21 +00:00
|
|
|
|
|
|
|
type ParityNodeInfo struct {
|
|
|
|
Track string
|
|
|
|
ParityVersion `json:"version"`
|
|
|
|
Hash string
|
|
|
|
}
|
|
|
|
|
|
|
|
func (pn ParityNodeInfo) String() string {
|
|
|
|
return fmt.Sprintf("Parity/v%d.%d.%d/", pn.Major, pn.Minor, pn.Patch)
|
|
|
|
}
|
|
|
|
|
|
|
|
type ParityVersion struct {
|
|
|
|
Major int
|
|
|
|
Minor int
|
|
|
|
Patch int
|
|
|
|
}
|