-
Notifications
You must be signed in to change notification settings - Fork 985
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* proto: illegal wireType 7 :( * set addr to todo for now so somethign gets sent * push latest progress * Add feedback from @raulk. Stream never connects * working handshake handler * add exclusions for relay/bootstrap node * fix tests, still need to add new ones * remove race, fails coverage * Add test for negotiation * gazelle * regen pb * Update shared/p2p/handshake_handler.go Co-Authored-By: prestonvanloon <preston@prysmaticlabs.com>
- Loading branch information
1 parent
7a04af7
commit 210edfc
Showing
13 changed files
with
515 additions
and
95 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package node | ||
|
||
import ( | ||
"io/ioutil" | ||
"net/http" | ||
"sync" | ||
|
||
"github.com/prysmaticlabs/prysm/shared/params" | ||
) | ||
|
||
var cachedDepositAddress string | ||
var fetchLock sync.Mutex | ||
|
||
// fetchDepositContract from the cluster endpoint. | ||
func fetchDepositContract() (string, error) { | ||
fetchLock.Lock() | ||
defer fetchLock.Unlock() | ||
|
||
if cachedDepositAddress != "" { | ||
return cachedDepositAddress, nil | ||
} | ||
|
||
log.WithField( | ||
"endpoint", | ||
params.BeaconConfig().TestnetContractEndpoint, | ||
).Info("Fetching testnet cluster address") | ||
resp, err := http.Get(params.BeaconConfig().TestnetContractEndpoint) | ||
if err != nil { | ||
return "", err | ||
} | ||
contractResponse, err := ioutil.ReadAll(resp.Body) | ||
if err != nil { | ||
return "", err | ||
} | ||
if err := resp.Body.Close(); err != nil { | ||
return "", err | ||
} | ||
|
||
cachedDepositAddress = string(contractResponse) | ||
return cachedDepositAddress, 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
Oops, something went wrong.