コード例 #1
0
ファイル: flags.go プロジェクト: ssonneborn22/go-ethereum
func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error {
	config := comms.IpcConfig{
		Endpoint: IpcSocketPath(ctx),
	}

	xeth := xeth.New(eth, nil)
	codec := codec.JSON

	apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec, xeth, eth)
	if err != nil {
		return err
	}

	return comms.StartIpc(config, codec, api.Merge(apis...))
}
コード例 #2
0
ファイル: flags.go プロジェクト: General-Beck/go-ethereum
func StartIPC(eth *eth.Ethereum, ctx *cli.Context) error {
	config := comms.IpcConfig{
		Endpoint: IpcSocketPath(ctx),
	}

	initializer := func(conn net.Conn) (comms.Stopper, shared.EthereumApi, error) {
		fe := useragent.NewRemoteFrontend(conn, eth.AccountManager())
		xeth := xeth.New(eth, fe)
		apis, err := api.ParseApiString(ctx.GlobalString(IPCApiFlag.Name), codec.JSON, xeth, eth)
		if err != nil {
			return nil, nil, err
		}
		return xeth, api.Merge(apis...), nil
	}

	return comms.StartIpc(config, codec.JSON, initializer)
}
コード例 #3
0
ファイル: eth.go プロジェクト: zramsay/geth-tmsp
func (app *EthereumApplication) StartIPC(ctx *cli.Context) error {
	eth := app.ethereum
	config := comms.IpcConfig{
		Endpoint: utils.IpcSocketPath(ctx),
	}

	initializer := func(conn net.Conn) (comms.Stopper, shared.EthereumApi, error) {
		fe := useragent.NewRemoteFrontend(conn, eth.AccountManager())
		xeth := xeth.NewFromApp(app, fe)
		ethApi := api.NewEthApi(xeth, eth, codec.JSON)
		personalApi := api.NewPersonalApi(xeth, eth, codec.JSON)
		web3Api := api.NewWeb3Api(xeth, codec.JSON)
		return xeth, api.Merge(ethApi, personalApi, web3Api), nil
	}

	return comms.StartIpc(config, codec.JSON, initializer)
}