mirror of
https://gitlab.com/pulsechaincom/prysm-pulse.git
synced 2025-01-01 07:51:21 +00:00
5eb5f6afa9
* second pass at faucet, no rate limiting yet * Add authentication support, step 1. This stuff needs to be refactored and tested * move deposit input to keystore pkg, add proof of possession and withdrawal addr * checkpoint on progress with cluster private key manager * checkpoint w/ bootnode config * checkpoint * resolve todo * encrypt the secrets * add note about querying testnet * workspace * checkpoitn * remove limits * update * checkpoint * checkpoint * remove jwt stuff * fix build * lint * lint * remove init * remove jwt * update * checkpoint
45 lines
1.0 KiB
Go
45 lines
1.0 KiB
Go
package main
|
|
|
|
import (
|
|
"flag"
|
|
"fmt"
|
|
"net"
|
|
|
|
recaptcha "github.com/prestonvanloon/go-recaptcha"
|
|
faucetpb "github.com/prysmaticlabs/prysm/proto/faucet"
|
|
"google.golang.org/grpc"
|
|
"google.golang.org/grpc/reflection"
|
|
)
|
|
|
|
var (
|
|
port = flag.Int("port", 8000, "Port to server gRPC service")
|
|
recaptchaSecret = flag.String("recaptcha_secret", "", "Secret to verify recaptcha")
|
|
rpcPath = flag.String("rpc", "", "RPC address of a running geth node")
|
|
privateKey = flag.String("private-key", "", "The private key of funder")
|
|
)
|
|
|
|
func main() {
|
|
flag.Parse()
|
|
|
|
lis, err := net.Listen("tcp", fmt.Sprintf(":%d", *port))
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
s := grpc.NewServer()
|
|
fmt.Println("recaptcha = " + *recaptchaSecret)
|
|
faucetpb.RegisterFaucetServiceServer(s,
|
|
newFaucetServer(
|
|
recaptcha.Recaptcha{RecaptchaPrivateKey: *recaptchaSecret},
|
|
*rpcPath,
|
|
*privateKey,
|
|
),
|
|
)
|
|
|
|
reflection.Register(s)
|
|
|
|
fmt.Printf("Serving gRPC requests on port %d\n", *port)
|
|
if err := s.Serve(lis); err != nil {
|
|
fmt.Printf("Error: %v", err)
|
|
}
|
|
}
|