Skip to content

Commit

Permalink
mainnet-beta8
Browse files Browse the repository at this point in the history
  • Loading branch information
mmc committed May 31, 2024
1 parent 1e01d59 commit 41ed8f6
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 19 deletions.
1 change: 0 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ require (
github.com/gagliardetto/solana-go v1.10.0
github.com/gagliardetto/treeout v0.1.4
github.com/logrusorgru/aurora v2.0.3+incompatible
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe
github.com/mr-tron/base58 v1.2.0
github.com/spf13/cobra v1.8.0
github.com/stretchr/testify v1.9.0
Expand Down
1 change: 0 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe h1:iruDEfMl2E6fbMZ9s0scYfZQ84/6SPL6zC8ACM2oIL0=
github.com/montanaflynn/stats v0.0.0-20171201202039-1bf9dbcd8cbe/go.mod h1:wL8QJuTMNUDYhXwkmfOly8iTdp5TEcJFWZD2D7SIkUc=
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1 h1:mPMvm6X6tf4w8y7j9YIt6V9jfWhL6QlbEc7CCmeQlWk=
github.com/mostynb/zstdpool-freelist v0.0.0-20201229113212-927304c0c3b1/go.mod h1:ye2e/VUEtE2BHE+G/QcKkcLQVAEJoYRFj5VUOQatCRE=
Expand Down
31 changes: 15 additions & 16 deletions internal/logic/miner.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/gagliardetto/solana-go"
computebudget "github.com/gagliardetto/solana-go/programs/compute-budget"
"github.com/gagliardetto/solana-go/rpc"
"github.com/montanaflynn/stats"
"github.com/zeromicro/go-zero/core/errorx"
"github.com/zeromicro/go-zero/core/logx"
"github.com/zeromicro/go-zero/core/mr"
Expand All @@ -31,21 +30,21 @@ func (l *Producer) Miner() error {
eth.Address = uint8Array
eth.AddressStr = ethAccount.String()

out := make([]rpc.PriorizationFeeResult, 0)
feeAccount := []solana.PublicKey{
solana.MustPublicKeyFromBase58(l.svcCtx.Config.Sol.ProgramId),
}
// out := make([]rpc.PriorizationFeeResult, 0)
// feeAccount := []solana.PublicKey{
// solana.MustPublicKeyFromBase58(l.svcCtx.Config.Sol.ProgramId),
// }

fee := l.svcCtx.Config.Sol.Fee
if fee == 0 {
out, _ = l.svcCtx.SolCli.GetRecentPrioritizationFees(l.ctx, feeAccount)
var feeFata []float64
for _, item := range out {
feeFata = append(feeFata, float64(item.PrioritizationFee))
}
_fee, _ := stats.Mean(feeFata)
fee = uint64(_fee) * 1_000_000
}
// fee := l.svcCtx.Config.Sol.Fee
// if fee == 0 {
// out, _ = l.svcCtx.SolCli.GetRecentPrioritizationFees(l.ctx, feeAccount)
// var feeFata []float64
// for _, item := range out {
// feeFata = append(feeFata, float64(item.PrioritizationFee))
// }
// _fee, _ := stats.Mean(feeFata)
// fee = uint64(_fee) * 1_000_000
// }
feesInit := computebudget.NewSetComputeUnitPriceInstructionBuilder().SetMicroLamports(l.svcCtx.Config.Sol.Fee).Build()

for _index, _account := range l.svcCtx.AddrList {
Expand Down Expand Up @@ -216,7 +215,7 @@ func (l *Producer) Miner() error {

logx.Infof("account:%v fee:%v slot:%v kind:%v hashs:%v superhashes:%v Points:%v t:%v",
account.PublicKey(),
fee,
l.svcCtx.Config.Sol.Fee,
recent.Context.Slot,
kind,
// common.Bytes2Hex(maybe_user_account_data_raw.Nonce[:]),
Expand Down
3 changes: 2 additions & 1 deletion solxen-tx.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ Sol:
Url: "https://api.mainnet-beta.solana.com" # rpc地址 [rpc address]
Mnemonic: "" # 助记词 [mnemonic phrase]
Num: 1 # 并发数 [concurrency]
Fee: 0 # 优先级费用 [priority fee]
Fee: 3000 # 优先级费用 [priority fee]
Kind: -1
ToAddr: "0x405113f4376A7769E61e82c5cdA16c80Cc9c0bd8" # eth空投地址 [eth address for receiving xn airdrop]
ProgramID: "5tungisGgk1fmGXxacNT1NkPtZgRwJnJPVMK5kfHqx2m" # solxen合约地址 [solxen contract address]
Time: 1000 # 间隔时间(单位毫秒) [interval time (milliseconds)]
Expand Down

0 comments on commit 41ed8f6

Please sign in to comment.