Skip to main content

Provably Rare Gem: Raritygems

Project description

raritygems

CI and CD PyPI version fury.io codecov

Provably Rare Gem Raritygems API, currently focused on mining.

Usage on Google Colab

  1. Reinstall jsonschema, cause of the conflict with the Python library web3
!pip install --force-reinstall jsonschema==3.2.0
  1. Install packages
!pip install web3==5.23.0
!pip install raritygems
  1. Download salt_finder and give it permission per execute
!wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=1K5yX7mbIhTg3jKlJMDcrgcY6rAgGeDQO' -O raritygems_salt_finder
!chmod 755 raritygems_salt_finder
  1. Run with Python
from raritygems import raritygems

david = raritygems.Miner(
    user_address="0xxxxx",
    gem_kind=0,  # 0 = Turquoise, 1 = Pearl, ...
    salt_finder_path="/content/raritygems_salt_finder",
    private_key="",  # if "" is provided then it will only find a salt then exit
    line_token="",  # if "" is provided then it will not notify you via LINE
)
david.mine()

You can check more about gem kind here

How it works?

It basically finds a "salt" and sign a transaction for you. The program will do the following

  1. Get the information that needed for mining: user_nonce and gem_difficulty
  2. Use salt_finder to find a salt
  3. Sign a transaction to claim a gem
  4. Go back to step 1.

salt_finder

At first, I start with Python and try to optimize it but I realize Go is must faster. The below is what I have tried roughly on my local machine.

Project Language Iterations per sec
Provably-Rare-Gem-Miner Python 2k
ramen JavaScript 20k
GemMiner-Go Go 30k
go-gem-miner Go 40k

So, I write this "salt_finder" part with Go language instead, and this is command I used to built it.

# to build "salt_finder"
go build -o raritygems_salt_finder main.go

# to build "salt_finder" for Google Colab
GOOS=linux GOARCH=amd64 go build -o raritygems_salt_finder_linux main.go

Feature

  • mining: auto update gem_difficulty
  • lint: setup linting: flask8
  • ci-cd: pypi: publish to pypi
  • ci-cd: CI & CD with GitHub Actions
  • ci-cd: integrate semantic release
  • test: writing automated test
  • perf: performance evaluation
  • info: display your current balance
  • info: display your gems
  • info: estimate how many times you can mine (before your have no gas left)
  • gas: optimize gas price
  • parallel: make it support parallel / multi-threading
  • gpu: create GPU support version
  • noti: refactor notification message
  • noti: add more channels e.g. Facebook Messenger, email
  • web3: auto claim gems
  • network: support Ethereum chain
  • network: support Fantom network
  • info: bot nickname
  • salt_finder: auto load by default when it is not provided

Project setup & CMD

TODO

conda create --name raritygems python=3.7.11
conda activate raritygems
pip uninstall raritygems -y && pip install .
go run main.go \
    -user-nonce=1234 \
    -user-address=0x28bc92e7b7e77d348fd262fb8e29da129308fbd3 \
    -chain-id=250 \
    -gem-difficulty=535996 \
    -gem-address=0x342EbF0A5ceC4404CcFF73a40f9c30288Fc72611 \
    -gem-entropy=0x000080440000047163a56455ac4bc6b1f1b88efadf17db76e5c52c0ca594fd9b \
    -gem-kind=0 \
    -salt=41543544848 \
    -debug=true

Ref

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

raritygems-0.4.0.tar.gz (6.3 kB view details)

Uploaded Source

Built Distribution

raritygems-0.4.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file raritygems-0.4.0.tar.gz.

File metadata

  • Download URL: raritygems-0.4.0.tar.gz
  • Upload date:
  • Size: 6.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.12

File hashes

Hashes for raritygems-0.4.0.tar.gz
Algorithm Hash digest
SHA256 cd69561e51a2b673515a8d67569e8d887739d8778d0d8289811078cb529ca235
MD5 22a453fbddf458aacf32e3f66453b1c5
BLAKE2b-256 f9aadd610a7e8d2a2f38ca319610873d0b1431288dc513ccfcaeb5789e8a8bc3

See more details on using hashes here.

File details

Details for the file raritygems-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: raritygems-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.2 CPython/3.7.12

File hashes

Hashes for raritygems-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d1f1acb314cc1b731d91313c771c709c28f6f55ed2396266f8e28fbb5e012e97
MD5 d8d3d180a402e5bc3c72c6c159c71cf2
BLAKE2b-256 2071231c9b9d7c7c215c9e337d50b11d3b1870d9d51bc6bc61f42cd028e654e2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page