Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions cmd/geth/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ var (
utils.UltraLightServersFlag,
utils.UltraLightFractionFlag,
utils.UltraLightOnlyAnnounceFlag,
utils.LespayTestModuleFlag,
utils.WhitelistFlag,
utils.CacheFlag,
utils.CacheDatabaseFlag,
Expand Down
1 change: 1 addition & 0 deletions cmd/geth/usage.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ var AppHelpFlagGroups = []flagGroup{
utils.UltraLightServersFlag,
utils.UltraLightFractionFlag,
utils.UltraLightOnlyAnnounceFlag,
utils.LespayTestModuleFlag,
},
},
{
Expand Down
7 changes: 7 additions & 0 deletions cmd/utils/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,10 @@ var (
Usage: "Maximum number of light clients to serve, or light servers to attach to",
Value: eth.DefaultConfig.LightPeers,
}
LespayTestModuleFlag = cli.BoolFlag{
Name: "lespay.testmodule",
Usage: "Enable dummy payment module (for testing only)",
}
UltraLightServersFlag = cli.StringFlag{
Name: "ulc.servers",
Usage: "List of trusted ultra-light servers",
Expand Down Expand Up @@ -1009,6 +1013,9 @@ func setLes(ctx *cli.Context, cfg *eth.Config) {
if ctx.GlobalIsSet(UltraLightOnlyAnnounceFlag.Name) {
cfg.UltraLightOnlyAnnounce = ctx.GlobalBool(UltraLightOnlyAnnounceFlag.Name)
}
if ctx.GlobalIsSet(LespayTestModuleFlag.Name) {
cfg.LespayTestModule = true
}
}

// makeDatabaseHandles raises out the number of allowed file handles per process
Expand Down
3 changes: 3 additions & 0 deletions eth/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ type Config struct {
UltraLightFraction int `toml:",omitempty"` // Percentage of trusted servers to accept an announcement
UltraLightOnlyAnnounce bool `toml:",omitempty"` // Whether to only announce headers, or also serve them

// Light client payment options
LespayTestModule bool

// Database options
SkipBcVersionCheck bool `toml:"-"`
DatabaseHandles int `toml:"-"`
Expand Down
6 changes: 6 additions & 0 deletions eth/gen_config.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

48 changes: 48 additions & 0 deletions internal/web3ext/web3ext.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var Modules = map[string]string{
"swarmfs": SwarmfsJs,
"txpool": TxpoolJs,
"les": LESJs,
"lespay": LESPAYJs,
}

const ChequebookJs = `
Expand Down Expand Up @@ -856,3 +857,50 @@ web3._extend({
]
});
`

const LESPAYJs = `
web3._extend({
property: 'lespay',
methods:
[
new web3._extend.Method({
name: 'connection',
call: 'lespay_connection',
params: 6
}),
new web3._extend.Method({
name: 'deposit',
call: 'lespay_deposit',
params: 4
}),
new web3._extend.Method({
name: 'buyTokens',
call: 'lespay_buyTokens',
params: 6
}),
new web3._extend.Method({
name: 'buyTokens',
call: 'lespay_sellTokens',
params: 6
}),
new web3._extend.Method({
name: 'getBalance',
call: 'lespay_getBalance',
params: 2
}),
new web3._extend.Method({
name: 'info',
call: 'lespay_info',
params: 2
}),
new web3._extend.Method({
name: 'receiverInfo',
call: 'lespay_receiverInfo',
params: 3
}),
],
properties:
[
]
});
`
Loading