Commit 1fb56eb9 authored by George Hotz's avatar George Hotz

set nodeurl with env var

parent 468e8d19
......@@ -37,6 +37,12 @@ func main() {
defer pprof.StopCPUProfile()
}
newNodeUrl, setNewNodeUrl := os.LookupEnv("NODE")
if setNewNodeUrl {
fmt.Println("override node url", newNodeUrl)
oracle.SetNodeUrl(newNodeUrl)
}
// non mips
if len(os.Args) > 1 {
pkw := oracle.PreimageKeyValueWriter{}
......
......@@ -95,6 +95,7 @@ func Preimage(hash common.Hash) []byte {
}
// these are stubs in embedded world
func SetNodeUrl(newNodeUrl string) {}
func SetRoot(newRoot string) {}
func PrefetchStorage(*big.Int, common.Address, common.Hash, func(map[common.Hash][]byte)) {}
func PrefetchAccount(*big.Int, common.Address, func(map[common.Hash][]byte)) {}
......
......@@ -79,9 +79,12 @@ type Account struct {
CodeHash []byte
}
//var nodeUrl = "http://192.168.1.213:8545"
var nodeUrl = "https://mainnet.infura.io/v3/9aa3d95b3bc440fa88ea12eaa4456161"
func SetNodeUrl(newNodeUrl string) {
nodeUrl = newNodeUrl
}
func toFilename(key string) string {
return fmt.Sprintf("%s/json_%s", root, key)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment