-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
statesync: populate parameters dynamically
* flags vochainStateSyncTrustHash and vochainStateSyncTrustHeight take precedence * new flag vochainStateSyncFetchParamsFromAPI allows passing a URL to fetch params dinamically * if vochainStateSyncFetchParamsFromAPI is empty, parameters will be fetch from default URL * to skip this feature, set --vochainStateSyncFetchParamsFromAPI=disabled * as a fallback, added some hardcoded height+hash on genesis.go, with least precedence apiclient: * added var DefaultAPIUrls * added funcs FetchChainHeightAndHash and ...FromDefaultAPI * added method Block() testsuite: * replace brittle hack to populate HASH and HEIGHT with new vochainStateSyncFetchParamsFromAPI * hotfix: make the test actually fail when "Timed out waiting!" * allow passing `BUILD=0 start_test.sh` to skip `docker compose build`
- Loading branch information
Showing
9 changed files
with
137 additions
and
19 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
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
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 |
---|---|---|
|
@@ -14,6 +14,12 @@ var Genesis = map[string]Vochain{ | |
SeedNodes: []string{ | ||
"[email protected]:26656", | ||
}, | ||
StateSync: map[string]StateSyncParams{ | ||
"vocdoni/DEV/32": { | ||
TrustHeight: 10000, | ||
TrustHash: types.HexStringToHexBytes("0x2b430478c7867dc078c0380b81838d75358db7c8b65bfaf84ade85448a0abd54"), | ||
}, | ||
}, | ||
Genesis: &devGenesis, | ||
}, | ||
|
||
|
@@ -23,6 +29,12 @@ var Genesis = map[string]Vochain{ | |
SeedNodes: []string{ | ||
"[email protected]:26656", | ||
}, | ||
StateSync: map[string]StateSyncParams{ | ||
"Vocdoni/STAGE/11": { | ||
TrustHeight: 150000, | ||
TrustHash: types.HexStringToHexBytes("0xd964cd5ec4704d3b3e1864c174edd1331044926bb2e6d3fe0b239b1c59329ff2"), | ||
}, | ||
}, | ||
Genesis: &stageGenesis, | ||
}, | ||
|
||
|
@@ -33,6 +45,12 @@ var Genesis = map[string]Vochain{ | |
"[email protected]:26656", | ||
"[email protected]:26656", | ||
}, | ||
StateSync: map[string]StateSyncParams{ | ||
"Vocdoni/LTS/1.2": { | ||
TrustHeight: 1000000, | ||
TrustHash: types.HexStringToHexBytes("0xd782c4a8e889a12fb326dd7f098336756f4238169a603501ae4a2b2f88c19db9"), | ||
}, | ||
}, | ||
Genesis: <sGenesis, | ||
}, | ||
} | ||
|
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