@ -130,7 +130,7 @@ var nextIPC = uint32(0)
func startGethWithIpc ( t * testing . T , name string , args ... string ) * gethrpc {
func startGethWithIpc ( t * testing . T , name string , args ... string ) * gethrpc {
ipcName := fmt . Sprintf ( "geth-%d.ipc" , atomic . AddUint32 ( & nextIPC , 1 ) )
ipcName := fmt . Sprintf ( "geth-%d.ipc" , atomic . AddUint32 ( & nextIPC , 1 ) )
args = append ( [ ] string { "--networkid=42" , "--port=0" , "--nousb" , "-- ipcpath" , ipcName } , args ... )
args = append ( [ ] string { "--networkid=42" , "--port=0" , "--ipcpath" , ipcName } , args ... )
t . Logf ( "Starting %v with rpc: %v" , name , args )
t . Logf ( "Starting %v with rpc: %v" , name , args )
g := & gethrpc {
g := & gethrpc {
@ -148,7 +148,7 @@ func startGethWithIpc(t *testing.T, name string, args ...string) *gethrpc {
}
}
func initGeth ( t * testing . T ) string {
func initGeth ( t * testing . T ) string {
args := [ ] string { "--nousb" , "--n etworkid=42" , "init" , "./testdata/clique.json" }
args := [ ] string { "--networkid=42" , "init" , "./testdata/clique.json" }
t . Logf ( "Initializing geth: %v " , args )
t . Logf ( "Initializing geth: %v " , args )
g := runGeth ( t , args ... )
g := runGeth ( t , args ... )
datadir := g . Datadir
datadir := g . Datadir
@ -159,7 +159,7 @@ func initGeth(t *testing.T) string {
func startLightServer ( t * testing . T ) * gethrpc {
func startLightServer ( t * testing . T ) * gethrpc {
datadir := initGeth ( t )
datadir := initGeth ( t )
t . Logf ( "Importing keys to geth" )
t . Logf ( "Importing keys to geth" )
runGeth ( t , "--nousb" , "-- datadir" , datadir , "--password" , "./testdata/password.txt" , "account" , "import" , "./testdata/key.prv" , "--lightkdf" ) . WaitExit ( )
runGeth ( t , "--datadir" , datadir , "--password" , "./testdata/password.txt" , "account" , "import" , "./testdata/key.prv" , "--lightkdf" ) . WaitExit ( )
account := "0x02f0d131f1f97aef08aec6e3291b957d9efe7105"
account := "0x02f0d131f1f97aef08aec6e3291b957d9efe7105"
server := startGethWithIpc ( t , "lightserver" , "--allow-insecure-unlock" , "--datadir" , datadir , "--password" , "./testdata/password.txt" , "--unlock" , account , "--mine" , "--light.serve=100" , "--light.maxpeers=1" , "--nodiscover" , "--nat=extip:127.0.0.1" , "--verbosity=4" )
server := startGethWithIpc ( t , "lightserver" , "--allow-insecure-unlock" , "--datadir" , datadir , "--password" , "./testdata/password.txt" , "--unlock" , account , "--mine" , "--light.serve=100" , "--light.maxpeers=1" , "--nodiscover" , "--nat=extip:127.0.0.1" , "--verbosity=4" )
return server
return server