Code Monkey home page Code Monkey logo

sol-xen's Introduction

solXEN Token

Installation

From Binaries

Download the package for your OS. Extract and run. https://github.com/FairCrypto/sol-xen/releases/latest

MacOS

# Download
wget https://github.com/faircrypto/sol-xen/releases/latest/download/sol-xen-macos-universal.tar.gz

# Extract
tar xf sol-xen-macos-universal.tar.gz

# Run the miner
./sol-xen-macos-universal/sol-xen-multiminer --help

Linux (x86_64)

# Download
wget https://github.com/faircrypto/sol-xen/releases/latest/download/sol-xen-linux-x86_64.tar.gz

# Extract
tar xf sol-xen-linux-x86_64.tar.gz

# Run the miner
./sol-xen-linux-x86_64/sol-xen-multiminer --help

Linux (arm64)

# Download
wget https://github.com/faircrypto/sol-xen/releases/latest/download/sol-xen-linux-arm64.tar.gz

# Extract
tar xf sol-xen-linux-arm64.tar.gz

# Run the miner
./sol-xen-linux-arm64/sol-xen-multiminer --help

From Source

git clone https://github.com/FairCrypto/sol-xen.git
cd sol-xen

For Typescript client

Install NodeJS

(To test if you have one node --version)

https://nodejs.org/en/download

Install deps

npm i
npm i -g tsx

N.B. you can skip the last one and run only JS files (see below)

Create .env file

USER_WALLET=<path_to_solana_wallet_file (id.json)>
ANCHOR_PROVIDER_URL=https://api.devnet.solana.com
DEBUG=*

PROGRAM_ID_MINTER=3JSyo6R489DcXedDYQUY7XbGXsmCz4mQH7sWeK5VE8vA

⚠ Breaking Changes [Epsilon Build] ⚠

To enable multi-threaded mining, Miner and Minter Solana programs have been separated.

Miner Program

Searches for hash patterns and accumulates hashes, superhashes and points counters for a user.

There are [up to] 4 kinds of Miner program active simultaneously.

Each miner client (TS/JS or a Rust one) communicates with only one Miner program, selected via --kind or -k param (0...3)

Minter Program

Minter program converts points accumulated by looking for hash/superhash patterns into solXEN tokens.

User can run Minter program at any time, frequency of usage will get no different result for tokens minting.

You can convert points only related to a single Miner program at a time. So if you have points with all 4 Miner programs, you'll have to run Minter at least 4 times to convert all points.

Like with Miner, you'll need to indicate it's kind via --kind or -k param (0...3)

Xolana ONLY for now

Please make sure you've switched to Xolana RPC. Check the .env file, make sure to have the right RPC URL:

...
ANCHOR_PROVIDER_URL=http://69.10.34.226:8899
...

You will also need to switch your local Solana command line tool (CLI) to Xolana, to get some test coin, like that:

solana config set -u http://69.10.34.226:8899
solana airdrop 10

Usage

Run miner script

with typescript

tsx ./client/miner.ts mine --address <ethereum address> -f 1 -k 0 // N.B.: -k (--kind) param could be 0..3

or without it

node ./client/miner.js mine --address <ethereum address> -f 1 -k 0 // N.B.: -k (--kind) param could be 0..3

or even without .env file

export USER_WALLET='/path/to/your/solana/wallet/id.json' && export ANCHOR_PROVIDER_URL='https://api.devnet.solana.com' && export DEBUG=* && node ./client/miner.js mine --address <ethereum address> -f 1 -k 0

Run minter script

⚠️ You'll need to supply additional PROGRAM_ID_MINER param

with typescript

tsx ./client/minter.ts mint -f 1 -k 0 // N.B.: -k (--kind) param could be 0..3

or without it

node ./client/minter.js mint -f 1 -k 0 // N.B.: -k (--kind) param could be 0..3

or even without .env file

export USER_WALLET='/path/to/your/solana/wallet/id.json' && export ANCHOR_PROVIDER_URL='https://api.devnet.solana.com' && export DEBUG=* && export PROGRAM_ID_MINER=... && node ./client/minter.js mint -f 1 -k 0

One-input installation of the solXEN miner

Install Rust, Solana, create and fund a wallet on Solana, install NodeJS and run the miner

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
sh -c "$(curl -sSfL https://release.solana.com/stable/install)" && \
export PATH="~/.local/share/solana/install/active_release/bin:$PATH" && \
solana-keygen new --force --no-passphrase && \
solana config set --url https://api.devnet.solana.com && \
solana airdrop 1 && \
git clone https://github.com/FairCrypto/sol-xen.git && \
cd sol-xen && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash && \
source ~/.bashrc && \
nvm install --lts && \
export USER_WALLET="$HOME/.config/solana/id.json" && \
export ANCHOR_PROVIDER_URL='https://api.devnet.solana.com' && \
export DEBUG=* && \
npm install dotenv && \
npm install -g dotenv && \
read -p "Enter your Ethereum address: " ethereum_address && \
read -p "Enter the number of runs: " num_runs && \
read -p "Enter the fee: " fee && \
node ./client/miner.js mine --address "$ethereum_address" -fee "$fee" -r "$num_runs"

N.B. if there's "Error: airdrop request failed" it means that the faucet is empty. It's necessary to copy the public key and use another faucet (eg. https://faucet.solana.com) and then continue with the installation.

git clone https://github.com/FairCrypto/sol-xen.git && \
cd sol-xen && \
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash && \
source ~/.bashrc && \
nvm install --lts && \
export USER_WALLET="$HOME/.config/solana/id.json" && \
export ANCHOR_PROVIDER_URL='https://api.devnet.solana.com' && \
export DEBUG=* && \
npm install dotenv && \
npm install -g dotenv && \
read -p "Enter your Ethereum address: " ethereum_address && \
read -p "Enter the number of runs: " num_runs && \
read -p "Enter the fee: " fee && \
node ./client/miner.js mine --address "$ethereum_address" -fee "$fee" -r "$num_runs"

Full options list

miner.ts [command]

Commands:
  miner.ts mine     Checks gas-related params returned by current network
  miner.ts balance  Checks balance of a master account

Options:
      --version          Show version number                           [boolean]
  -f, --priorityFee      Solana priority fee, micro-lamports
                                                           [number] [default: 1]
  -u, --units            Solana MAX Compute Units    [number] [default: 1400000]
      --address, --addr  Ethereum address to relate XN points to        [string]
  -r, --runs             Number of runs                    [number] [default: 1]
      --help             Show help                                     [boolean]

Run event listener script

tsx ./client/listener.ts

Run test client script

tsx ./client/user.ts

Testing

References

sol-xen's People

Contributors

lbelyaev avatar jacklevin74 avatar nibty avatar commoneffort avatar xenartist avatar

Stargazers

 avatar AJ Taylor avatar  avatar  avatar Owen avatar Archie avatar  avatar  avatar Kurisu avatar zhiyuan888 avatar sfter avatar FrancelWebdev avatar Stone Gao avatar  avatar don.b avatar  avatar  avatar Piotr Trochymiak avatar JZ avatar  avatar Ajdin Dracic avatar 0xwolverine avatar  avatar  avatar SFHJavaer avatar mmc avatar Jimmy Bai avatar 白起 avatar Mwalusakaa of Zed avatar TheLoneCoder avatar

Watchers

 avatar  avatar Salce avatar  avatar Kurisu avatar SFHJavaer avatar  avatar

sol-xen's Issues

can not mining

Failed: Error { request: Some(SendTransaction), kind: RpcError(RpcResponseError { code: -32002, message: "Transaction simulation failed: Error processing Instruction 2: custom program error: 0xbc2", data: SendTransactionPreflightFailure(RpcSimulateTransactionResult { err: Some(InstructionError(2, Custom(3010))), logs: Some(["Program ComputeBudget111111111111111111111111111111 invoke [1]", "Program ComputeBudget111111111111111111111111111111 success", "Program ComputeBudget111111111111111111111111111111 invoke [1]", "Program ComputeBudget111111111111111111111111111111 success", "Program Dx7zjkWZbUStmhjo8BrhbprtQCcMByJgCTEC6TLgkH8n invoke [1]", "Program log: Instruction: MintTokens", "Program log: AnchorError caused by account: user. Error Code: AccountNotSigner. Error Number: 3010. Error Message: The given account did not sign.", "Program Dx7zjkWZbUStmhjo8BrhbprtQCcMByJgCTEC6TLgkH8n consumed 5102 of 1399700 compute units", "Program Dx7zjkWZbUStmhjo8BrhbprtQCcMByJgCTEC6TLgkH8n failed: custom program error: 0xbc2"]), accounts: None, units_consumed: Some(5402), return_data: None, inner_instructions: None }) }) }

AnchorError

Version
20.5.1

Platform
window 10

'Program log: AnchorError caused by account: user_xn_address_records. Error Code: ConstraintSeeds. Error Number: 2006. Error Message: A seeds constraint was violated.',
'Program log: Left:',
'Program log: 6eiNxXNpREVBgXSNkhGN13o8gLmiV2GU7a4GEY4csa7V',
'Program log: Right:',
'Program log: 8MaQgyEKWnKrzggzR3naHXfZSG8759BqGuQRkCv29kua',
'Program 5kKinDAVeUYhMJ3W8iGh9qnDGmdUrzEgDLTcPQetbFaX consumed 24704 of 1399700 compute units',
'Program 5kKinDAVeUYhMJ3W8iGh9qnDGmdUrzEgDLTcPQetbFaX failed: custom program error: 0x7d6'
],
error: {
errorCode: { code: 'ConstraintSeeds', number: 2006 },
errorMessage: 'A seeds constraint was violated',
comparedValues: [
[PublicKey [PublicKey(6eiNxXNpREVBgXSNkhGN13o8gLmiV2GU7a4GEY4csa7V)]],
[PublicKey [PublicKey(8MaQgyEKWnKrzggzR3naHXfZSG8759BqGuQRkCv29kua)]]
],
origin: 'user_xn_address_records'
},
_programErrorStack: ProgramErrorStack {
stack: [
[PublicKey [PublicKey(5kKinDAVeUYhMJ3W8iGh9qnDGmdUrzEgDLTcPQetbFaX)]]
]
}
}

can not mint

node ./client/minter.js mint -k 1

Running on https://api.mainnet-beta.solana.com
Using user wallet xxxxx
Block height=248877864
SOL balance=0.903635094
Program ID=5tungisGgk1fmGXxacNT1NkPtZgRwJnJPVMK5kfHqx2m
Miner Program ID=2Ewuie2KnTvMLwGqKWvEM1S2gUStHzDUfrANdJfu45QJ
Running auto mint with params: priorityFee=1, interval=1000 slots
Error: Account does not exist or has no data 5HW46bLgB12ydiXjqZQwjj6kQzo5GSqwWnGUrga6y4uz
    at AccountClient.fetch (/opt/solxen/sol-xen/node_modules/@coral-xyz/anchor/dist/cjs/program/namespace/account.js:110:19)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async doMint (file:///opt/solxen/sol-xen/client/minter.js:140:37)
    at async main (file:///opt/solxen/sol-xen/client/minter.js:176:9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.