Commit 63da284f authored by Ralph Pichler's avatar Ralph Pichler Committed by GitHub

token migration (#1198)

parent 273f120e
...@@ -59,7 +59,7 @@ jobs: ...@@ -59,7 +59,7 @@ jobs:
run: ./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" run: ./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
- name: Test settlements - name: Test settlements
id: settlements-1 id: settlements-1
run: ./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" -t 100000 run: ./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
- name: Test pushsync (bytes) - name: Test pushsync (bytes)
id: pushsync-bytes-1 id: pushsync-bytes-1
run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3 run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3
...@@ -105,7 +105,7 @@ jobs: ...@@ -105,7 +105,7 @@ jobs:
run: ./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" run: ./beekeeper check fullconnectivity --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
- name: Test settlements - name: Test settlements
id: settlements-2 id: settlements-2
run: ./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" -t 100000 run: ./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
- name: Test pushsync (bytes) - name: Test pushsync (bytes)
id: pushsync-bytes-2 id: pushsync-bytes-2
run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3 run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3
......
...@@ -48,7 +48,7 @@ jobs: ...@@ -48,7 +48,7 @@ jobs:
run: ./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" run: ./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
- name: Test settlements - name: Test settlements
id: settlements-1 id: settlements-1
run: ./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" -t 100000 run: ./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
- name: Test pushsync (bytes) - name: Test pushsync (bytes)
id: pushsync-bytes-1 id: pushsync-bytes-1
run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3 run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3
...@@ -91,7 +91,7 @@ jobs: ...@@ -91,7 +91,7 @@ jobs:
run: ./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" run: ./beekeeper check pingpong --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}"
- name: Test settlements - name: Test settlements
id: settlements-2 id: settlements-2
run: ./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" -t 100000 run: ./beekeeper check settlements --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}"
- name: Test pushsync (bytes) - name: Test pushsync (bytes)
id: pushsync-bytes-2 id: pushsync-bytes-2
run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3 run: ./beekeeper check pushsync --api-scheme http --debug-api-scheme http --disable-namespace --debug-api-domain localhost --api-domain localhost --node-count "${REPLICA}" --upload-node-count "${REPLICA}" --chunks-per-node 3
......
...@@ -193,15 +193,15 @@ func (c *command) setAllFlags(cmd *cobra.Command) { ...@@ -193,15 +193,15 @@ func (c *command) setAllFlags(cmd *cobra.Command) {
cmd.Flags().String(optionNameVerbosity, "info", "log verbosity level 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=trace") cmd.Flags().String(optionNameVerbosity, "info", "log verbosity level 0=silent, 1=error, 2=warn, 3=info, 4=debug, 5=trace")
cmd.Flags().String(optionWelcomeMessage, "", "send a welcome message string during handshakes") cmd.Flags().String(optionWelcomeMessage, "", "send a welcome message string during handshakes")
cmd.Flags().Bool(optionNameGlobalPinningEnabled, false, "enable global pinning") cmd.Flags().Bool(optionNameGlobalPinningEnabled, false, "enable global pinning")
cmd.Flags().String(optionNamePaymentThreshold, "100000", "threshold in BZZ where you expect to get paid from your peers") cmd.Flags().String(optionNamePaymentThreshold, "10000000000000", "threshold in BZZ where you expect to get paid from your peers")
cmd.Flags().String(optionNamePaymentTolerance, "10000", "excess debt above payment threshold in BZZ where you disconnect from your peer") cmd.Flags().String(optionNamePaymentTolerance, "50000000000000", "excess debt above payment threshold in BZZ where you disconnect from your peer")
cmd.Flags().String(optionNamePaymentEarly, "10000", "amount in BZZ below the peers payment threshold when we initiate settlement") cmd.Flags().String(optionNamePaymentEarly, "1000000000000", "amount in BZZ below the peers payment threshold when we initiate settlement")
cmd.Flags().StringSlice(optionNameResolverEndpoints, []string{}, "ENS compatible API endpoint for a TLD and with contract address, can be repeated, format [tld:][contract-addr@]url") cmd.Flags().StringSlice(optionNameResolverEndpoints, []string{}, "ENS compatible API endpoint for a TLD and with contract address, can be repeated, format [tld:][contract-addr@]url")
cmd.Flags().Bool(optionNameGatewayMode, false, "disable a set of sensitive features in the api") cmd.Flags().Bool(optionNameGatewayMode, false, "disable a set of sensitive features in the api")
cmd.Flags().Bool(optionNameClefSignerEnable, false, "enable clef signer") cmd.Flags().Bool(optionNameClefSignerEnable, false, "enable clef signer")
cmd.Flags().String(optionNameClefSignerEndpoint, "", "clef signer endpoint") cmd.Flags().String(optionNameClefSignerEndpoint, "", "clef signer endpoint")
cmd.Flags().String(optionNameSwapEndpoint, "http://localhost:8545", "swap ethereum blockchain endpoint") cmd.Flags().String(optionNameSwapEndpoint, "http://localhost:8545", "swap ethereum blockchain endpoint")
cmd.Flags().String(optionNameSwapFactoryAddress, "", "swap factory address") cmd.Flags().String(optionNameSwapFactoryAddress, "", "swap factory address")
cmd.Flags().String(optionNameSwapInitialDeposit, "100000000", "initial deposit if deploying a new chequebook") cmd.Flags().String(optionNameSwapInitialDeposit, "10000000000000000", "initial deposit if deploying a new chequebook")
cmd.Flags().Bool(optionNameSwapEnable, true, "enable swap") cmd.Flags().Bool(optionNameSwapEnable, true, "enable swap")
} }
...@@ -23,8 +23,8 @@ import ( ...@@ -23,8 +23,8 @@ import (
var ( var (
_ Interface = (*Accounting)(nil) _ Interface = (*Accounting)(nil)
balancesPrefix string = "balance_" balancesPrefix string = "accounting_balance_"
balancesSurplusPrefix string = "surplusbalance_" balancesSurplusPrefix string = "accounting_surplusbalance_"
) )
// Interface is the Accounting interface. // Interface is the Accounting interface.
......
...@@ -82,7 +82,8 @@ func ParseAddress(underlay, overlay, signature []byte, networkID uint64) (*Addre ...@@ -82,7 +82,8 @@ func ParseAddress(underlay, overlay, signature []byte, networkID uint64) (*Addre
func generateSignData(underlay, overlay []byte, networkID uint64) []byte { func generateSignData(underlay, overlay []byte, networkID uint64) []byte {
networkIDBytes := make([]byte, 8) networkIDBytes := make([]byte, 8)
binary.BigEndian.PutUint64(networkIDBytes, networkID) binary.BigEndian.PutUint64(networkIDBytes, networkID)
signData := append(underlay, overlay...) signData := append([]byte("bee-handshake-"), underlay...)
signData = append(signData, overlay...)
return append(signData, networkIDBytes...) return append(signData, networkIDBytes...)
} }
......
...@@ -365,7 +365,7 @@ func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey, ...@@ -365,7 +365,7 @@ func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey,
} }
b.localstoreCloser = storer b.localstoreCloser = storer
retrieve := retrieval.New(swarmAddress, storer, p2ps, kad, logger, acc, accounting.NewFixedPricer(swarmAddress, 10), tracer) retrieve := retrieval.New(swarmAddress, storer, p2ps, kad, logger, acc, accounting.NewFixedPricer(swarmAddress, 1000000000), tracer)
tagService := tags.NewTags(stateStore, logger) tagService := tags.NewTags(stateStore, logger)
b.tagsCloser = tagService b.tagsCloser = tagService
...@@ -387,7 +387,7 @@ func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey, ...@@ -387,7 +387,7 @@ func NewBee(addr string, swarmAddress swarm.Address, publicKey ecdsa.PublicKey,
traversalService := traversal.NewService(ns) traversalService := traversal.NewService(ns)
pushSyncProtocol := pushsync.New(p2ps, storer, kad, tagService, pssService.TryUnwrap, logger, acc, accounting.NewFixedPricer(swarmAddress, 10), tracer) pushSyncProtocol := pushsync.New(p2ps, storer, kad, tagService, pssService.TryUnwrap, logger, acc, accounting.NewFixedPricer(swarmAddress, 1000000000), tracer)
// set the pushSyncer in the PSS // set the pushSyncer in the PSS
pssService.SetPushSyncer(pushSyncProtocol) pssService.SetPushSyncer(pushSyncProtocol)
......
...@@ -29,7 +29,7 @@ const ( ...@@ -29,7 +29,7 @@ const (
// ProtocolName is the text of the name of the handshake protocol. // ProtocolName is the text of the name of the handshake protocol.
ProtocolName = "handshake" ProtocolName = "handshake"
// ProtocolVersion is the current handshake protocol version. // ProtocolVersion is the current handshake protocol version.
ProtocolVersion = "1.0.0" ProtocolVersion = "2.0.0"
// StreamName is the name of the stream used for handshake purposes. // StreamName is the name of the stream used for handshake purposes.
StreamName = "handshake" StreamName = "handshake"
// MaxWelcomeMessageLength is maximum number of characters allowed in the welcome message. // MaxWelcomeMessageLength is maximum number of characters allowed in the welcome message.
......
...@@ -13,10 +13,10 @@ import ( ...@@ -13,10 +13,10 @@ import (
) )
var ( var (
peerPrefix = "chequebook_peer_" peerPrefix = "swap_chequebook_peer_"
peerChequebookPrefix = "peer_chequebook_" peerChequebookPrefix = "swap_peer_chequebook_"
beneficiaryPeerPrefix = "beneficiary_peer_" beneficiaryPeerPrefix = "swap_beneficiary_peer_"
peerBeneficiaryPrefix = "peer_beneficiary_" peerBeneficiaryPrefix = "swap_peer_beneficiary_"
) )
// Addressbook maps peers to beneficaries, chequebooks and in reverse. // Addressbook maps peers to beneficaries, chequebooks and in reverse.
......
...@@ -91,7 +91,7 @@ func NewCashoutService( ...@@ -91,7 +91,7 @@ func NewCashoutService(
// cashoutActionKey computes the store key for the last cashout action for the chequebook // cashoutActionKey computes the store key for the last cashout action for the chequebook
func cashoutActionKey(chequebook common.Address) string { func cashoutActionKey(chequebook common.Address) string {
return fmt.Sprintf("cashout_%x", chequebook) return fmt.Sprintf("swap_cashout_%x", chequebook)
} }
// CashCheque sends a cashout transaction for the last cheque of the chequebook // CashCheque sends a cashout transaction for the last cheque of the chequebook
......
...@@ -24,8 +24,8 @@ import ( ...@@ -24,8 +24,8 @@ import (
type SendChequeFunc func(cheque *SignedCheque) error type SendChequeFunc func(cheque *SignedCheque) error
const ( const (
lastIssuedChequeKeyPrefix = "chequebook_last_issued_cheque_" lastIssuedChequeKeyPrefix = "swap_chequebook_last_issued_cheque"
totalIssuedKey = "chequebook_total_issued_" totalIssuedKey = "swap_chequebook_total_issued_"
) )
var ( var (
...@@ -201,7 +201,7 @@ func (s *service) WaitForDeposit(ctx context.Context, txHash common.Hash) error ...@@ -201,7 +201,7 @@ func (s *service) WaitForDeposit(ctx context.Context, txHash common.Hash) error
// lastIssuedChequeKey computes the key where to store the last cheque for a beneficiary. // lastIssuedChequeKey computes the key where to store the last cheque for a beneficiary.
func lastIssuedChequeKey(beneficiary common.Address) string { func lastIssuedChequeKey(beneficiary common.Address) string {
return fmt.Sprintf("chequebook_last_issued_cheque_%x", beneficiary) return fmt.Sprintf("%s_%x", lastIssuedChequeKeyPrefix, beneficiary)
} }
func (s *service) reserveTotalIssued(ctx context.Context, amount *big.Int) (*big.Int, error) { func (s *service) reserveTotalIssued(ctx context.Context, amount *big.Int) (*big.Int, error) {
......
...@@ -30,7 +30,7 @@ var ( ...@@ -30,7 +30,7 @@ var (
ErrWrongBeneficiary = errors.New("wrong beneficiary") ErrWrongBeneficiary = errors.New("wrong beneficiary")
// ErrBouncingCheque is the error returned if the chequebook is demonstrably illiquid. // ErrBouncingCheque is the error returned if the chequebook is demonstrably illiquid.
ErrBouncingCheque = errors.New("bouncing cheque") ErrBouncingCheque = errors.New("bouncing cheque")
lastReceivedChequePrefix = "chequebook_last_received_cheque_" lastReceivedChequePrefix = "swap_chequebook_last_received_cheque_"
) )
// ChequeStore handles the verification and storage of received cheques // ChequeStore handles the verification and storage of received cheques
...@@ -78,7 +78,7 @@ func NewChequeStore( ...@@ -78,7 +78,7 @@ func NewChequeStore(
// lastReceivedChequeKey computes the key where to store the last cheque received from a chequebook. // lastReceivedChequeKey computes the key where to store the last cheque received from a chequebook.
func lastReceivedChequeKey(chequebook common.Address) string { func lastReceivedChequeKey(chequebook common.Address) string {
return fmt.Sprintf("chequebook_last_received_cheque_%x", chequebook) return fmt.Sprintf("%s_%x", lastReceivedChequePrefix, chequebook)
} }
// LastCheque returns the last cheque we received from a specific chequebook. // LastCheque returns the last cheque we received from a specific chequebook.
......
...@@ -169,7 +169,7 @@ func (c *factory) ERC20Address(ctx context.Context) (common.Address, error) { ...@@ -169,7 +169,7 @@ func (c *factory) ERC20Address(ctx context.Context) (common.Address, error) {
func DiscoverFactoryAddress(chainID int64) (common.Address, bool) { func DiscoverFactoryAddress(chainID int64) (common.Address, bool) {
if chainID == 5 { if chainID == 5 {
// goerli // goerli
return common.HexToAddress("0xA6B88705036F2a56807af157c116b7dfCDabf968"), true return common.HexToAddress("0xf0277caffea72734853b834afc9892461ea18474"), true
} }
return common.Address{}, false return common.Address{}, false
} }
...@@ -17,7 +17,7 @@ import ( ...@@ -17,7 +17,7 @@ import (
"github.com/ethersphere/bee/pkg/storage" "github.com/ethersphere/bee/pkg/storage"
) )
const chequebookKey = "chequebook" const chequebookKey = "swap_chequebook"
func checkBalance( func checkBalance(
ctx context.Context, ctx context.Context,
...@@ -50,7 +50,7 @@ func checkBalance( ...@@ -50,7 +50,7 @@ func checkBalance(
if balance.Cmp(swapInitialDeposit) < 0 { if balance.Cmp(swapInitialDeposit) < 0 {
logger.Warningf("cannot continue until there is sufficient ETH and BZZ available on %x", overlayEthAddress) logger.Warningf("cannot continue until there is sufficient ETH and BZZ available on %x", overlayEthAddress)
if chainId == 5 { if chainId == 5 {
logger.Warningf("on the test network you can get both Goerli ETH and Goerli BZZ from https://faucet.ethswarm.org?address=%x", overlayEthAddress) logger.Warningf("get your Goerli ETH and Goerli BZZ now via the bzzaar at https://bzz.ethswarm.org/?transaction=buy&amount=%d&slippage=30&receiver=%x", new(big.Int).Div(swapInitialDeposit, big.NewInt(10000000000000000)), overlayEthAddress)
} }
select { select {
case <-time.After(backoffDuration): case <-time.After(backoffDuration):
......
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